Index ¦ Archives ¦ RSS


Estimated read time: 2 minutes

I did not have to work with a profiling tool for C so far, so here is my first experience.

The kernel has to have oprofile support (the kernel in Frugalware-current does not have it, I'll add it after 1.0pre2). You'll need a kernel vmlinux file if you want to benchmark the syscalls as well (I did not need this one).

Then there are 3 levels of starting: opcontrol --init/--deinit, --start-daemon/--shutdown and --start/--stop. The first one prepares /dev/profile, the second one starts the deamon, finally the third one start profiling. Obviously the second part does the opposite.

Once you did a --stop, you can get the results. Example output:

$ opreport -l /home/vmiklos/git/git/git /usr/lib/|head
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
samples  %        app name                 symbol name
22823    56.4898            inflate_fast
6019     14.8978            adler32
5975     14.7889            inflate
4233     10.4772            inflate_table
456       1.1287            crc32
252       0.6237  git                      patch_delta
55        0.1361  git                      use_pack

which is pretty much what I expected - I did a 'git verify-pack' between --start/--stop, so the time spent with reading the compressed git object database.

TBH I miss a strace/sudo-like simple wrapper as well...

© Miklos Vajna. Built using Pelican. Theme by Giulio Fidente on github.