Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bahamas10/flame
Generate a flamegraph the easy way with DTrace and stackvis
https://github.com/bahamas10/flame
Last synced: 15 days ago
JSON representation
Generate a flamegraph the easy way with DTrace and stackvis
- Host: GitHub
- URL: https://github.com/bahamas10/flame
- Owner: bahamas10
- Created: 2015-08-07T19:40:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-07T19:42:29.000Z (over 9 years ago)
- Last Synced: 2024-11-14T05:43:17.034Z (about 2 months ago)
- Language: Shell
- Size: 117 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
flame(1)
========Generate a flamegraph the easy way with DTrace and stackvis
Dependencies
------------The system you are on must support DTrace, and `stackvis` must be installed with
npm install -g stackvis
Example
-------Generate a flamegraph and write the output to an HTML file
# flame zoneadm list -cv > flamegraph.html
> program is 'zoneadm' - using ustack stack function
> calling dtrace: "-n" "profile-97 /pid == $target/ { @[ustack(80, 8192)] = count(); }" "-o" "/tmp/flame-dtrace-out.27416.XXXXXXX.txt" "-c" "/tmp/flame-dtrace-prog.27416.XuDa0yn /tmp/flame-dtrace-prog-args.27416.XxDa2yn"
dtrace: description 'profile-97 ' matched 1 probe
dtrace: pid 27423 has exited
> cleaning temporary files
# scp flamegraph.html webserver:/var/wwwGenerate a flamegraph and share it on manta
# flame zoneadm list -cv | stackvis share
> program is 'zoneadm' - using ustack stack function
> calling dtrace: "-n" "profile-97 /pid == $target/ { @[ustack(80, 8192)] = count(); }" "-o" "/tmp/flame-dtrace-out.28054.XXXXXXX.txt" "-c" "/tmp/flame-dtrace-prog.28054.Xe3aYSn /tmp/flame-dtrace-prog-args.28054.Xh3a0Sn"
dtrace: description 'profile-97 ' matched 1 probe
dtrace: pid 28062 has exited
> cleaning temporary files
http://us-east.manta.joyent.com/bahamas10/public/stackvis/e9541153-c253-4b19-bafd-eb4a13ff262b/index.htm(see http://us-east.manta.joyent.com/bahamas10/public/stackvis/e9541153-c253-4b19-bafd-eb4a13ff262b/index.htm)
Trace `rsyslogd` for 10 seconds and create a flame graph
# flame -p "$(pgrep rsyslogd)" -t 10 > graph.html
Usage
-----$ flame -h
Usage: flame [-o] [-p pid] [-s stack] [-t secs] prog argsGenerate a flamegraph easily using DTrace and optionally stackvis.
A program can be specified as the operands to be executed, or an
already running program can be given by pid with -p.Examples
Generate a flamegraph for zoneadm list and write the HTML to file
# flame zoneadm list -cv > graph.htmlGenerate a flamegraph and share it to Manta for rsyslog for 20 seconds
# flame -p "$(pgrep rsyslogd)" -t 20 | stackvis shareDump unmodified DTrace output to stdout for a node program (raw mode)
# flame -r node foo.jsOptions
-h print this message and exit
-p trace the pid given
-r raw mode, don't run stackvis just print what dtrace outputs
-s stack function to use, defaults to stack() or jstack() depend on execname
-t seconds to trace when run with "-p ", defaults to 30License
-------MIT License