Git Product home page Git Product logo

etwtopprof's Introduction

EtwToPprof

EtwToPprof exports ETW traces to pprof protobuf format. It uses the .NET TraceProcessing API to process ETW traces.

This tool was built for processing ETW traces from Chrome, so the default values of the flags are based on that use case. It uses _NT_SYMCACHE_PATH and _NT_SYMBOL_PATH for symbolizing traces if set, otherwise it uses WPA defaults.

Building

Build the provided Visual Studio Solution with VS 2019.

Nuget dependencies (included in solution)

  • CommandLineParser v2.8.0
  • Google.Protobuf v3.11.4
  • Microsoft.Windows.EventTracing.Processing.All v1.0.0

Examples

Export to specified pprof profile using default options:

EtwToPprof -o profile.pb.gz trace.etl

Export samples from specified process names:

EtwToPprof -p viz_perftests.exe,dwm.exe trace.etl

Export samples from all processes from 10s to 30s:

EtwToPprof -p * --timeEnd 30 --timeStart 10 trace.etl

Export inlined functions and thread/process ids:

EtwToPprof --includeInlinedFunctions --includeProcessAndThreadIds trace.etl

Command line flags

-o, --outputFileName            (Default: profile.pb.gz) Output file name for gzipped pprof profile.

-p, --processFilter             (Default: chrome.exe,dwm.exe,audiodg.exe) Filter for process names (comma-separated) to be included in the exported profile. All processes will be exported if set to *.

--includeInlinedFunctions       (Default: false) Whether inlined functions should be included in the exported profile (slow).

--stripSourceFileNamePrefix     (Default: ^c:/b/s/w/ir/cache/builder/) Prefix regex to strip out of source file names in the exported profile.

--timeStart                     Start of time range to export in seconds

--timeEnd                       End of time range to export in seconds

--includeProcessIds             (Default: false) Whether process ids are included in the exported profile.

--includeProcessAndThreadIds    (Default: false) Whether process and thread ids are included in the exported profile.

--splitChromeProcesses          (Default: true) Whether chrome.exe processes are split by type (parsed from command line).

--loadSymbols                   (Default: true) Whether symbols should be loaded.

--help                          Display this help screen.

--version                       Display version information.

etlFileName (pos. 0)            Required. ETL trace file name.

Disclaimer:

This is not an officially supported Google product.

etwtopprof's People

Contributors

dependabot[bot] avatar sunnyps avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

etwtopprof's Issues

Process Annotation

A useful feature for doing diffs between profile runs with Chrome is process annotations. Since Chrome is multiprocess comparing profile runs is tricky. If process ids are not included, then all chrome.exe processes get merged into one stack frame by pprof (since they have the same name). If the pid is included, then diffing is impossible since the stack frames have different names.

I suggest an approach for annotating process frames based on their pid.

For example a flag

--tag-pid=<pid>:<tag> would tag process with pid pid, such that the function name of the frame in pprof would be like <process-name> (<tag>).

An example with Chrome could be --tag-pid=1234:GPU, resulting in process 1234 being chrome.exe (GPU) in pprof.

Some considerations,

  1. This should at least send a warning if a tag was not consumed. This means the user specified a pid that was not present in the trace.
  2. This should perhaps be exclusive from the --includeProcessAndThreadIds flag, and should exit if both flags are present.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.