[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: OProfile: no kernel symbols

Vladimir G. Ivanovic wrote:
I can't get OProfile to give me profiling information for kernel symbols:

   # opreport --threshold=5 --symbols /boot/vmlinux-2.4.22-1.2188.nptlsmp
   CPU: PIII, speed 1004.54 MHz (estimated)
   Counted CPU_CLK_UNHALTED events (clocks processor is not halted) with a unit mask of 0x00 (No unit mask) count 502271
   vma      samples  %           symbol name
   00000000 2034171  100.0000    (no symbols)

I get the required information with a binary (or a shared object

The build system strips out the symbols from executables in the rpms and generates separate debuginfo rpms that contain that information in .debug files. Right now Red Hat doesn't seem to have these in a public place.

The debug information contained is matched up using checksums on the original executable. As a result of the check, the debuginfo RPM and binary RPM have to be from the same build. You couldn't take a debuginfo RPM you build locally, install it, and expect it to work with the binary RPM built by Red Hat. You need to use the locally build binary RPM for this to work.

   $ opreport --threshold=5 --no-header --symbols /usr/local/bin/xemacs-21.4.15
   08083168 5249     10.2400     mark_object
   08083670 3793      7.3995     mark_cons
   08083e18 2975      5.8037     sweep_conses

I started OProfile with:

opcontrol --setup --event=default --vmlinux=/boot/vmlinux-`uname -r` --start

and I am using:

   * oprofile-0.7cvs-0.20030829.6 (the latest for Fedora Core 1)
   * kernel-smp-2.4.22-1.2188.nptl
   * kernel-source-2.4.22-1.2188.nptl

The file /boot/System-map-2.4.22-1.2188.nptlsmp is present and seems to
contain the required symbols.

The map information is not used by oprofile to map the address back to functions. OProfile uses the symbol information in the executable or the associated .debug file from the debuginfo rpm. Most executables do not have System-map files. Kernels can be built with symbols like other executables, so it didn't seem to make much sense to have special case code for the kernel.

What am I doing wrong?

Either you need to install a matching debuginfo rpm or uses a custom kernel. The custom kernels do not have the symbols stripped out.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]