Last active
January 28, 2020 17:49
-
-
Save paroj/6bb7547b2b5b7367fd149c91b58cd53e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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