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
5
votes
2 answers

.Net 4.5 EventSource ETW provider not showing up in provider list

I have been working on using .NET4.5 new feature ETW(EventSource). I have trouble having it show up on the trace provider lists using perfmon->Data Collector Sets. I was able to see the logs using perfview. I was able to generate manifest from…
Rajesh B
  • 63
  • 1
  • 8
4
votes
2 answers

When inserting log events the TimeCreated field is not accurate enough

I'm trying to do application logging to the windows event log in c# with .net framework 4, but when I insert the log entries the TimeCreated field (Event viewer -> Windows Logs -> Application -> -> Details -> Friendly View -> System) gets a value…
Jonas Granvik
  • 935
  • 7
  • 13
4
votes
1 answer

EnumerateTraceGuids returns "The parameter is incorrect" (87)

i am trying to call the Windows API function EnumerateTraceGuids: ULONG EnumerateTraceGuids( __inout PTRACE_GUID_PROPERTIES *GuidPropertiesArray, __in ULONG PropertyArrayCount, __out PULONG GuidCount ); Starting from the code sample…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
4
votes
2 answers

Windows ETW: Kernel consumer receives no EventCallback or BufferCallback events

i am trying to listen to ETW kernel events. Step 1: Call OpenTrace, specifying the EventCallback and optional BufferCallback functions that will be called during my call to ProcessTrace: var logFile: EVENT_TRACE_LOGFILE; currentTrace:…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
4
votes
3 answers

Optimizing Stack-Walking performance

Currently i use the dbghelp library to walk through the stack of some process' thread (using GetThreadContext() and StackWalk64()) and collect only the return addresses each frame contains. However, the overhead of doing so is too big for the…
Hagay Myr
  • 299
  • 2
  • 6
  • 16
4
votes
0 answers

Why is my Azure App Service complaining that ETW resources have been exhausted?

I have two code-identical .NET 6 applications running on two separate App Services under two separate App Service Plans on Azure. The first one I deployed a few months back and seems to be running fine, but my most recently-deployed one (two weeks…
Daniel Attfield
  • 2,024
  • 2
  • 24
  • 40
4
votes
6 answers

Programatically read program's page fault count on Windows

I'd like to my Windows C++ program to be able to read the number of hard page faults it has caused. The program isn't running as administrator. Edited to add: To be clear, I'm not as interested in the aggregate page fault count of the whole…
Justin L.
  • 3,957
  • 3
  • 31
  • 29
4
votes
2 answers

List files accessed per-process with xperf?

With xperf I can generate a trace and get a "flat" listing of all files read like so: xperf -on FileIO+FILE_IO+FILE_IO_INIT+FILENAME -stackwalk FileRead+FileWrite+FileDelete xperf -start FileIOSession -heap -PidNewProcess "C:\Python27\x86\python.exe…
Zadan
  • 71
  • 5
4
votes
2 answers

Registering the same ETW TraceLogging Provider GUID from multiple processes and within the same process

From TraceLogging documentation: If you attempt to register a provider that is already registered, the registration will fail. It's unclear whether 'provider' refers to the GUID or the object represented by hProvider. Can anyone confirm if it's a…
anik3th
  • 81
  • 3
4
votes
2 answers

Performance counters compatibility with .Net Core

Is there any nuget packages or helpers for controlling custom performance counters in .Net Core? I'm using System.Diagnostics.PerformanceCounter package. Visual Studio has PerfWatson2 (Developer Analytics Tools) extension which runs when debugging…
3lvinaz
  • 113
  • 3
  • 12
4
votes
2 answers

'Insufficient system resources' when I listen ETW events with EventFlow on ServiceFabric cluster

I have an ETW listener using EventFlow running on Service Fabric. This is my configuration file (eventFlowConfig.json): { "inputs": [ { "type": "ETW", "sessionNamePrefix": "MyListenerService", "cleanupOldSessions": true, …
Alpha75
  • 2,140
  • 1
  • 26
  • 49
4
votes
1 answer

System.Diagnostics.Tracing.EventSource vs System.Diagnostics.Trace

I'm not sure I understand the major differences between ETW using System.Diagnostics.Tracing, and using System.Diagnostics.Trace. I understand that with both of them I can dump events onto some output stream, and that I can use various listeners to…
user884248
  • 2,134
  • 3
  • 32
  • 57
4
votes
2 answers

How to view generic event details with wpa?

I record ETW events for CLR provider: xperf -start clr -on e13c0d23-ccbc-4e12-931b-d9cc2eee27e4 -f clr.etl ... xperf -stop clr then open clr.etl in wpa.exe and see plenty of 'generic event'. But seems wpa do not display some data, which described…
Sergey Azarkevich
  • 2,641
  • 2
  • 22
  • 38
4
votes
1 answer

The ASP.NET ETW provider on a win7 PC is missing

I am writing an ETW consumer to listen for ASP.NET events. I have the sample code below working nicely on a Windows 2008 server where it can see the ASP.NET provider. The problem that I am running into is that on my Win7 (64) PC, I do not see the…
Scott Manning
  • 163
  • 3
  • 10
4
votes
1 answer

Strange threads in application in Win7 WOW64

We are observing 4-6 threads on Windows 7 x64 in the application which have 3 threads and behaves normally on any Windows (either 32 or 64 bit) prior Windows 7. Process Explorer shows the following "unknown"…
Shcheklein
  • 5,979
  • 7
  • 44
  • 53