Skip to content

Sampling profiler for native applications on Windows, based on ETW

License

Notifications You must be signed in to change notification settings

Donpedro13/etwprof

Repository files navigation

etwprof

Build Status

etwprof is a lightweight, self-contained sampling profiler for native applications on Windows. It's based on the Event Tracing for Windows (ETW) framework.

This profiler has the following design goals:

  • No installable dependencies of any sort
  • Lightweight
  • Processor architecture and model independent
  • It must be viable to be used as a technical support tool

Unlike Microsoft provided ETW-based performance profilers (such as xperf, Windows Performance Recorder, etc.), etwprof performs filtering, so sampled profile data relevant only to the target processes are saved. This results in much smaller .etl output files compared to other ETW-based tools.

Usage

etwprof is a command line tool. To profile (already running) processes, launch etwprof as an Administrator, and pass either the PID or the name of the executable that you'd like to profile. The following example will profile notepad.exe, write the resulting .etl file to the user's home folder, and will also create one minidump at the beginning:

etwprof profile -t=notepad.exe --outdir=%USERPROFILE% -m

While profiling is in progress, you should see a colorful, spinning progress indicator:

Profile feedback

Profiling stops either when you stop it explicitly by pressing CTRL+C, or when the target processes exit.

The resulting .etl file can be opened with a tool of your choice, such as Windows Performance Analyzer. If you open the trace with WPA, there's a small quirk: CPU usage not belonging to the target processes will show up attributed to "Unknown (0)". This can be worked around easily with filtering:

WPA

For a list of command line options and more examples, see the dedicated documentation page about Usage. If you have any questions, please consult the FAQ page first.

System requirements

etwprof requires no 3rd party installations (no Visual Studio redistributable, no Windows SDK, etc.).

At least Windows 7 is required for this program to operate. On Windows 7 specifically, etwprof will not work if the system is out of date (an update package is required that was released in 2013). There are individual features that might be unavailable or limited on certain OS versions, see Limitations and known issues for details.

Only 64-bit OSes are supported at this time (profiling of 32-bit processes a.k.a. WoW64 is supported, however).

Download

The latest version of etwprof is 0.3 (released 2024-04-27). Binary distributions are available on the Releases page.

For a list of fixes and improvements, check CHANGELOG.txt.

Documentation

More detailed documentation is available in the "Documentation" folder:

License

This project is released under the MIT License. Please see LICENSE.txt for details.