Changes between Version 2 and Version 3 of ProfilingOProfile


Ignore:
Timestamp:
Jan 18, 2012, 2:05:53 PM (6 years ago)
Author:
vorner
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ProfilingOProfile

    v2 v3  
    44
    55However, it is available only on linux and with reasonably new CPU, it needs a kernel support and you need to run the opcontrol tool as root (the other „examination“ tools can be run as normal user).
     6
     7It lives on http://oprofile.sourceforge.net/docs/.
    68
    79== Installation ==
     
    2628== Initialization ==
    2729
    28 First, you need to set parameters. Once you do, they are remembered until you change them to something else (even between restarts). You can do so for example this way:
     30First, you need to set parameters. Once you do, they are remembered until you change them to something else (even between restarts). You can do so for example this way (as root):
    2931
    3032{{{
     
    3840The --separate options tells oprofile to assign samples to running programs in addition to library names (if they happen inside library) ‒ so you see b10-auth as well as libdns++.so.0.0 or like.
    3941
    40 Note that each parameter is configured separately, so if you set the events only, the `--no-vmlinux` and `--separate` options stay the same. You need to restart the daemon for it to make effect (eg. `opcontrol --deinit` before starting next profiling).
     42Note that each parameter is configured separately, so if you set the events only, the `--no-vmlinux` and `--separate` options stay the same. You need to restart the daemon for it to make effect (eg. `opcontrol --deinit` before starting next profiling). You can reset the events to default by `-e default`.
     43
     44//If you have an Intel CPU, you can't use IBS_*, you can use the CPU_CLK_UNHALTED as the less accurate equivalent of IBS_OP_ALL.//
    4145
    4246== Data gathering ==
     
    4448First, prepare whatever you are going to profile, so the preparation itself doesn't clutter the data too much (it could be filtered, but why care). Be sure to have an optimized build (I usually pass -O0 to my build to speed it up, so not for profiling ;-), but with debugging symbols (they are not necessary to profile, but the output is not very useful then). You can even start the bind10 before starting to gather profiling data.
    4549
    46 So, now remove data from previous sessions (if any) and start the profiling by
     50So, now remove data from previous sessions (if any) and start the profiling by (as root):
    4751
    4852{{{
     
    8185opreport -lg ~/work/bind10/src/bin/auth/.libs/b10-auth
    8286}}}
     87
     88//Note: The exact path may depend on your OS and version of libtool. Some report to be in the form of `.libs/lt-b10-auth`//
    8389
    8490The output would look something like this: