Git Product home page Git Product logo

idlewakeups's Introduction

IdleWakeups

IdleWakeups detects idle wakeups in Chrome (using an ETW trace) and exports symbolized callstacks related to these wakeups into a gzip-compressed protocol buffer.

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.

See this blog post for details of the Trace Processor package used to drive this.

More explanations of the techniques used in this program can be found here.

The style and structure of this project is inspired by work in EtwToPprof.

Building

Build the provided Visual Studio Solution with VS 2022.

NuGet dependencies (included in solution)

Examples

Export idle wakeup callstacks found in trace.etl to specified pprof profile using default options:

IdleWakeups -o profile.pb.gz trace.etl

Export idle wakeup callstacks from all processes from 20s to 30s to default pprof profile:

IdleWakeups -p * --timeEnd 30 --timeStart 20 trace.etl

Export idle wakeup callstacks from specified process names:

IdleWakeups -p audiodg.exe,dwm.exe trace.etl

Export idle wakeup callstacks and thread/process ids:

IdleWakeups --includeProcessAndThreadIds trace.etl

Show summary of idle wakeup statistics but don't export to pprof:

IdleWakeups --exportToPprof False --writeSummary trace.etl

Reduce time to load symbols by reading from symbol cache which already contains symbols:

IdleWakeups --loadFromSymCache trace.etl

Command line flags

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

-p, --processFilter                 (Default: chrome.exe) Filter for process names
                                    (comma-separated) to be included in the analysis. All
                                    processes will be analyzed 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 analyze in seconds

--timeEnd                           End of time range to analyze in seconds

--includeProcessIds                 (Default: false) Includes process ids in the exported
                                    profile.

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

--includeWokenThreadIdsForWakers    (Default: false) Adds ids of woken threads for waker
                                    threads in the exported profile.

--splitChromeProcesses              (Default: true) Splits chrome.exe processes by type in the
                                    exported profile.

-s, --writeSummary                  (Default: false) Writes a summary after analysis has
                                    completed.
                                
--loadSymbols                       (Default: true) Whether symbols should be loaded.

--loadFromSymCache                  (Default: false) Loads symbols from cache where processed
                                    symbols are stored.

--exportToPprof                     (Default: true) Whether results shall be exported to a
                                    gzipped pprof profile.

--pprofComment                      (Default: ) Free-form annotation to add to the exported
                                    profile as comment.

--listProcesses                     (Default: false) Whether all process names (unique) shall
                                    be printed out instead of running an analysis.

-t, --tabbed                        (Default: false) Print results as a tab-separated grid.

-v, --verboseOutput                 (Default: false) Set output to verbose messages.

--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.

idlewakeups's People

Contributors

henrikand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.