Bug 113032

Summary: Failed analysis of shared libraries with .debug files
Product: [Retired] Red Hat Raw Hide Reporter: William Cohen <wcohen>
Component: oprofileAssignee: William Cohen <wcohen>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: oprofile-0.8-0.20040121.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-01-22 22:38:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description William Cohen 2004-01-07 16:54:01 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030922

Description of problem:
Shared libraries (.so files) leave the symbols for the functions in
the code. The .debug file only has the debugging information with line
information. When analyzing the shared library OProfile checks to see
if there is a corresponding .debug file for the .so file. If the
debuginfo rpm is installed, the .debug file for the shared libraries
is used rather than the shared library. However, all the symbols are
in the .so file, not the .debug file. OProfile's opreport cannot
generate per-function accounting of the samples when there is a valid
.debug file for the shared library.

Either the .debug file needs to have the symbols or OProfile needs to
check the .so file for symbols.

Version-Release number of selected component (if applicable):
oprofile-0.7.1-0.20031124.3

How reproducible:
Always

Steps to Reproduce:
1. With machine with OProfile set up collect some samples. As root

/usr/bin/opcontrol --setup --vmlinux=/boot/vmlinux-`uname -r`
/usr/bin/opcontrol --start
/usr/bin/opcontrol --dump

2. Find a .so file with samples

opreport --long-filenames
(pick out .so with samples, e.g. /lib/ld-2.3.2.so)

rpm -qf /lib/ld-2.3.2.so
(install debuginfo rpm for the associated rpm)
rpm -Uvh glibc-debuginfo-2.3.2-101.1

3. opreport -l image:/lib/ld-2.3.2.so
    

Actual Results:  get (no symbols) for the shared libaries

$ opreport -l image:/lib/ld-2.3.2.so
CPU: P4 / Xeon, speed 2386.63 MHz (estimated)
Counted GLOBAL_POWER_EVENTS events (time during which processor is not
stopped) with a unit mask of 0x01 (count cycles when processor is
active) count 100000
samples  %        symbol name
137      100.000  (no symbols)


Expected Results:  list out samples for the functions in
/lib/ld-2.3.2.so like the following


$ opreport -l image:/lib/ld-2.3.2.so
CPU: P4 / Xeon, speed 2386.63 MHz (estimated)
Counted GLOBAL_POWER_EVENTS events (time during which processor is not
stopped) with a unit mask of 0x01 (count cycles when processor is
active) count 100000
samples  %        symbol name
621      71.6263  _dl_sysinfo_int80
60        6.9204  do_lookup_versioned
26        2.9988  strcmp
19        2.1915  _dl_lookup_versioned_symbol_internal
14        1.6148  _dl_map_object_from_fd
...

Additional info:

opreport analysis will work if the debuginfo rpm for the shared
library is removed.