Questions tagged [etw]

Event Tracing for Windows (ETW) is a high-speed tracing facility provided by the Windows Operating System which was first introduced in Windows 2000.

Event Tracing for Windows (ETW) is a general-purpose, high-speed tracing facility provided by the Windows operating system. Using a buffering and logging mechanism implemented in the kernel, ETW provides a tracing mechanism for events raised by both user-mode applications and kernel-mode device drivers.

Additionally, ETW gives you the ability to enable and disable logging dynamically, making it easy to perform detailed tracing in production environments without requiring reboots or application restarts. The logging mechanism uses per-processor buffers that are written to disk by an asynchronous writer thread. This allows large-scale server applications to write events with minimum disturbance.

ETW is the core tracing facility in Windows on top of which both the Event Log and WPP are built.

ETW was first introduced on Windows 2000. Since then, various core OS and server components have adopted ETW to instrument their activities, and it's now one of the key instrumentation technologies on Windows platforms.

On Windows Vista, ETW has gone through a major upgrade, and one of the most significant changes is the introduction of the unified event provider model and APIs. In short, the new unified APIs combine logging traces and writing to the Event Viewer into one consistent, easy-to-use mechanism for event providers. At the same time, several new features have been added to improve developer and end user experience.

445 questions
3
votes
1 answer

.Net: subclassing subclasses of EventSource

I have a C# solution which spans many, many projects. I created a tracing class that inherits from Systme.Diagnostics.Tracing.EventSource, called MyCustomEventSource, which handles most of my tracing events. I want to create subclasses of this class…
user884248
  • 2,134
  • 3
  • 32
  • 57
3
votes
1 answer

How do I read boot time events on Windows 7?

I am trying to use the ETW functions without success to read the file: C:\Windows\System32\winevt\Logs\Microsoft-Windows-Diagnostics-Performance%4Operational.evtx In order to capture boot time events. I have tried various functions - OpenTrace…
Paul Dolphin
  • 758
  • 2
  • 8
  • 18
3
votes
1 answer

Send ETW events to Application Insights?

I have some legacy code hosted in an Azure WebJob (.exe) that is generating a lot of ETW events for logging to a custom Event Provider. How can I get those ETW events to Application Insights in an easy way? I would like them to show up in the same…
Lee G.
  • 173
  • 1
  • 1
  • 7
3
votes
0 answers

ETW filter by event ID using TraceEvent

I'm emitting the ETW events using the Microsoft.Diagnostics.Tracing.EventSource nuget version 1.1.28 and tracing the events on the fly using the Microsoft.Diagnostics.Tracing.TraceEvent nuget version 1.0.41. What I'm trying to do is filter the…
Vedran Zakanj
  • 101
  • 1
  • 6
3
votes
0 answers

Intercept ETW event and log the event parameters in UWP apps

I have a use case where, in UWP, I need to subscribe to an ETW provider. And whenever an event is logged to the provider, I would like to intercept that event and log parts of the event (for example - Details, LogLevel, etc.) to a custom file in…
Alex
  • 31
  • 1
3
votes
1 answer

Diagnostic Events Viewer in Visual Studio - how to configure

Question regarding the Diagnostic Events window (not the Diagnostic Tools window). When running a service fabric project, the diagnostics event viewer appears. I want to be able to add my own provider to this list rather than copy-paste the…
MarkD
  • 1,511
  • 18
  • 32
3
votes
1 answer

How do I log events in Windows IoT?

WebUI for Windows IoT (as seen on Raspberry PI) features the following Event Tracing screen: How do I write into an event log from a uwp program and then later examine what's written there? This answer (which is not about Windows IoT) suggests that…
Andrew Savinykh
  • 25,351
  • 17
  • 103
  • 158
3
votes
1 answer

How can I interpret the RtlUsrThreadStart in perfview?

Looking at the sshot from CPU stacks in PerfView I'm not sure how to interpret the first record. I can't safely exclude the record, because every thread in CallTree starts with this frame. But what's bothering me is why the frame takes exclusive…
stej
  • 28,745
  • 11
  • 71
  • 104
3
votes
1 answer

Manifest-based ETW provider - Decoding File Locations

I am trying to add ETW tracing to a DLL (written in C++) I have created. I am using the manifest-based method. Tracing is working, but it appears I need to set the "Decoding File Locations" in the manifest to an absolute path before building the…
jamesd
  • 45
  • 5
3
votes
0 answers

Unspecified ETW events - GC/Mark, GC/Triggered, GC/GenerationRange etc

I ran perfview and looked at GC events. There is a list of events that can be found in perfview events view - https://msdn.microsoft.com/en-us/library/ff356162(v=vs.100).aspx My question is: where can I find the missing events like GC/Triggered,…
stej
  • 28,745
  • 11
  • 71
  • 104
3
votes
0 answers

Enable ETW logging on an Azure Worker Role

I m working on a classic Azure Worker Role and I want to enable logging using the Table storage method. I checked "Enable diagnostics" in the worker role's properties file, and, in the "ETW Logs" tabs after clicking on the "Configure" button in the…
Rotan
  • 577
  • 6
  • 16
3
votes
1 answer

System.Diagnostic.Tracing.EventListener for existing ETW Providers

I am confused how to create an EventListener for an existing system ETW Provider. The EnableEvents method expects to be passed in a EventSource instance. Do I need to create that by hand? Is there a way to generate that EventSource class? I can find…
Cameron Taggart
  • 5,771
  • 4
  • 45
  • 70
3
votes
0 answers

How to unit test my own implementation of EventSource

I'm using System.Diagnostics.EventSource for semantic logging (.net 4.5). I would like to create proper unit tests to make sure that the events were actually fired with the appropriate content. How can I do that? Example of method to…
rlesias
  • 4,786
  • 3
  • 15
  • 20
3
votes
1 answer

How to link ETW start/stop Opcode concurrent events

I'm using ETW, and logging some events that have stop & stop opcodes, e.g. [Event(1, Task = Tasks.ActivateTask, Opcode = EventOpcode.Start)] public void ActivateTaskStart(string TaskName) { if (IsEnabled()) { WriteEvent(1,…
Wilka
  • 28,701
  • 14
  • 75
  • 97
3
votes
1 answer

Trace DNS query / answer with Event Tracing for Windows

Which ETW provider can be used to trace DNS queries / answers? I already tried Microsoft-Windows-DNS-Client but it does not provide any data.
joe-jeff
  • 324
  • 1
  • 9
  • 27