Skip to content

Instantly share code, notes, and snippets.

@beaugunderson
Created March 22, 2013 17:57
Show Gist options
  • Select an option

  • Save beaugunderson/5223393 to your computer and use it in GitHub Desktop.

Select an option

Save beaugunderson/5223393 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Gathering 60s of data for process ID $1"
dtrace -n "profile-997/pid == $1 && arg1/{
@[jstack(50, 2048)] = count(); } tick-30s { exit(0); }" > $1.out
echo "Filtering..."
c++filt < $1.out > $1-demangled.out
echo "Generating flamegraph..."
stackvis dtrace flamegraph-svg < $1-demangled.out > $1-demangled.svg
echo "Generating collapsed flamegraph..."
stackvis dtrace collapsed < $1-demangled.out > $1-collapsed.out
stackvis collapsed flamegraph-svg < $1-collapsed.out > $1-collapsed.svg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment