Simple GPUView custom event markers

GPUView is a powerful tool for GPU/CPU interaction profiling for Windows. It’s interface isn’t very user friendly, but it gets job done. I used it for optimizing in-house GPU lightmapper and spend some time trying to find a way to add custom event markers.

Most solutions on web are quite complicated – involving writing strange DLLs, manifests, using ECManGen.exe… Thankfully there is a much simpler solution.

First register an event handler using custom GUID:

REGHANDLE gEventHandle;
GUID guid;
UuidFromString( (RPC_CSTR) "a9744ea3-e5ac-4f2f-be6a-42aad08a9c6f", &guid );
EventRegister( &guid, nullptr, nullptr, &gEventHandle );

Then just call EventWriteString with custom text:

EventWriteString( gEventHandle, 0, 0, L"Render" );

Final step is to modify log.cmd in order to add this custom GUID for tracing (same one, which was passed to EventRegister). Just pass it as new Xperf parameter (see TRACE_DSHOW or TRACE_DX variables for reference).

During next GPUView profiling session open “Event Listing” dialog and locate custom event by GUID:

eventListing

I guess it should also work for XPerf and other tools which use windows event tracing. For better integration look up Writing anifest-based eventsWriting an Instrumentation Manifest and ECManGen.exe on MSDN.

Advertisements
This entry was posted in Graphics. Bookmark the permalink.

One Response to Simple GPUView custom event markers

  1. Arthy Sundaram says:

    Is it possible to provide the instrumentation manual – the xml file as input so that the gpuview would parse the ‘private data’ ?

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s