Skip to content

Converts linux `perf` tool output to .cpuprofile files readable by chromiums devtools

Notifications You must be signed in to change notification settings

Swatinem/perf-cpuprofile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PerfCpuprofile

Converts linux perf tool output to .cpuprofile files readable by chromiums devtools

Build Status Coverage Status Dependency Status

Installation

$ npm install -g perf-cpuprofile

Usage

Generate a perf trace:

$ perf record -p `pidof sourceview` -g dwarf

Then simply run:

$ perf-cpuprofile

Or if you have custom file names or just love to pipe:

$ cat custom.perf.data | perf script | perf-cpuprofile -- > custom.cpuprofile

Calling perf-cpuprofile with the argument -- makes it output to stdout instead of writing to the default perf.cpuprofile file.

Then just open up the file in chromiums devtools profile tab, and voilà:

chromiums profiler next to perf

It still has some issues with unresolvable functions and finding the callers for _mcount, but overall, I’m very happy with it :-)

Helpers

Run node with --perf-basic-prof to prodive js stacks. You can then try to filter the output as explained in this gist.

$ time perf record -F 10000 --no-buffering -g node --harmony --perf-basic-prof /usr/lib/node_modules/nlz/bin/nlz-build.js
$ perf script | egrep "(cycles|LazyCompile|(^$))" | perf-cpuprofile

License

GPLv3

About

Converts linux `perf` tool output to .cpuprofile files readable by chromiums devtools

Resources

Stars

Watchers

Forks

Packages

No packages published