-
Notifications
You must be signed in to change notification settings - Fork 0
Home
rysto32 edited this page Aug 24, 2016
·
3 revisions
Quick how-to for generating profiles with this tool:
- kenv kern.hwpmc.callchaindepth="32"
- put 'kern.hwpmc.callchaindepth="32"' in /boot/loader.conf to persist this across a reboot
- kldload hwpmc
- pmcstat -S unhalted-cycles -O samples.out sleep 10
- Collect samples for 10 seconds
- limits -v 4G pmcprofiler -f samples.out -F flame.out
- Generate flamegraph input
- flamegraph.pl < flame.out > flame.svg
- FlameGraph can be checked out here: https://github.com/brendangregg/FlameGraph
Other options to pmcprofiler:
- -o flat
- Generate flat (no callchain) output, including a per-instruction view
- -G leaf
- Generate text-based callchain output, starting from leaf functions and moving up the stack
- -r root
- Generate text-based callchain output, starting from the root of the callchain and moving down the stack
- -N kernel
- Specify alternate kernel file (default is $(sysctl kern.bootfile))
- -m module path
- Specify alternate module path (default is $(sysctl kern.module_path))