1

After trying to get ETW activity tracking working in my project for quite a while without much success, I figured I should take a step back and see if the demo project by Microsoft, available on this page was working for me. Unfortunately, it wasn't neither. The problem is, that the events do show up in the Diagnostic Events window of VS but they have a normal GUID as ActivityID instead of a hierarchical activity id and the the RelatedActivityID only contains a null value:

enter image description here

After trying for a few hours, I figured out that there's one way to get it to work: When I'm collecting data with PerfView while the events are generated, they suddenly do get a hierarchical id like they should and even have the related activity id set:

enter image description here

But as soon as I stop collecting events with PerfViewer, the events, again, only have a GUID for an activity id and miss the related activity id.

Does anyone know why this is happening? Does this really only work if an external application is monitoring the events, or can I somehow get this to work just in VS? And does anybody maybe have an idea if this will work with Azure Diagnostics? I'd like to listen to the events with Azure Diagnostics later on but it won't be of much use to me if no hierarchical ids are generated that way.

Thank you very much!

djvg
  • 11,722
  • 5
  • 72
  • 103
Yuk
  • 101
  • 1
  • 3
  • 7

1 Answers1

1

PerfView turns this feature on by setting the keyword 0x80 (TasksFlowActivityIds) for the 2e5dba47-a3d2-4d16-8ee0-6671ffdcd7b5 (System.Threading.Tasks.TplEventSource) event source as explained here.

I don't beleive setting this keyword for that event source from the Diagnostics Events in VS is possible.

Lars Truijens
  • 42,837
  • 6
  • 126
  • 143