Skip to content

Instantly share code, notes, and snippets.

@paroj
Last active January 28, 2020 17:49
Embed
What would you like to do?
#!/bin/sh
# compile with -fno-omit-frame-pointer
# usermode
sudo sh -c "echo 0 > /proc/sys/kernel/kptr_restrict"
sudo sh -c 'echo 1 >/proc/sys/kernel/perf_event_paranoid'
# record with callgraph
perf record -g $1
# display with inverse callgraph
perf report -g 'graph,0.5,caller'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment