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: