Make sure you have the same path to the binaries you want to profile on your target device as your workstation.
On your profiling target as root:
export KREXP=
dpkg -L kernel-debug | grep "vmlinux-2.6"
opcontrol --init
opcontrol --vmlinux=$KREXP
opcontrol --separate=kernel
opcontrol --status
opcontrol -c=8
start your application
as root again:
commence activity you want to profile - i.e. scroll around wildly, play a video, etcopcontrol --stop; opcontrol --reset; opcontrol --start; sleep 5; opcontrol --stop
on your workstation/host environment:
rm -rf /var/lib/oprofile && scp -r root@192.168.2.15:/var/lib/oprofile /var/lib/
this should give you some log info:
opreport -l -r
to finally generate the fancy svg:
opreport -c /path/to/binary_to_profile > /tmp/opreport.txt
oprofile-callgraph-to-svg -e 1 -n 1 /tmp/opreport.txt
your result should look like this
Continue reading How to generate fancy callgraphs from oprofile.