perf-cpuprofile

0.0.5 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i perf-cpuprofile

Weekly Downloads

0

Version

0.0.5

License

LGPLv3

Last publish

Collaborators

  • swatinem