File: perf_flamegraph.sh

package info (click to toggle)
jgmenu 4.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,464 kB
  • sloc: ansic: 13,215; perl: 4,953; sh: 3,009; python: 600; makefile: 294; xml: 98
file content (15 lines) | stat: -rwxr-xr-x 438 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

# Based on https://gitlab.com/o9000/tint2/wikis/profile
# and https://github.com/brendangregg/FlameGraph

fgdir="$HOME/src/FlameGraph"
cmd="jgmenu_run csv"
svgfile=log.svg

sudo sh -c 'echo 0 > /proc/sys/kernel/kptr_restrict'
cd ${fgdir}
perf record -F 999 -g --call-graph dwarf ${cmd}
perf script | ./stackcollapse-perf.pl| ./flamegraph.pl > ${svgfile}
xdg-open ${svgfile}
sudo sh -c 'echo 1 > /proc/sys/kernel/kptr_restrict'