kernel: linux-2.6.14
~/.oprofile/daemonrc
SESSION_DIR=/var/lib/oprofile
NR_CHOSEN=0
SEPARATE_LIB=1
SEPARATE_KERNEL=0
SEPARATE_THREAD=1
SEPARATE_CPU=0
VMLINUX=/boot/vmlinux
IMAGE_FILTER=/bin/cli
CPU_BUF_SIZE=0
CALLGRAPH=15
KERNEL_RANGE=c0100000,c0419a24
XENIMAGE=none
output of command "
-bash-3.00# opreport
CPU: P4 / Xeon with 2 hyper-threads, speed 2992.68 MHz (estimated)
Counted GLOBAL_POWER_EVENTS events (time during which processor is not stopped) with a unit mask of 0x01 (mandatory) count 100000
GLOBAL_POWER_E...|
samples| %|
------------------
1266042 100.000 rimacli
GLOBAL_POWER_E...|
samples| %|
------------------
1258582 99.4108 libparser.so
5910 0.4668 libc-2.3.4.so
1079 0.0852 ld-2.3.4.so
341 0.0269 libcli.so
92 0.0073 libchartdir.so.4.1.0
19 0.0015 libpthread-2.3.4.so
4 3.2e-04 libsuc.so
4 3.2e-04 libreason.so
3 2.4e-04 libzebra.so.0.0.0
2 1.6e-04 libppp.so
1 7.9e-05 liblbioctl.so
1 7.9e-05 libcomm.so
1 7.9e-05 libll2.so
1 7.9e-05 libsuccli.so
1 7.9e-05 libdl-2.3.4.so
1 7.9e-05 libxml2.so.2.6.22
but the command "opreport -l " will caused Segmentation fault
-bash-3.00# opreport -l
CPU: P4 / Xeon with 2 hyper-threads, speed 2992.68 MHz (estimated)
Counted GLOBAL_POWER_EVENTS events (time during which processor is not stopped) with a unit mask of 0x01 (mandatory) count 100000
Segmentation fault
-bash-3.00# vim /root/.oprofile/daemonrc
-bash-3.00# opreport -l
CPU: P4 / Xeon with 2 hyper-threads, speed 2992.68 MHz (estimated)
Counted GLOBAL_POWER_EVENTS events (time during which processor is not stopped) with a unit mask of 0x01 (mandatory) count 100000
Segmentation fault
Logged In: YES
user_id=2042160
Originator: YES
-bash-3.00# opreport -l --verbose=all /lib/libc-2.3.4.so
/lib/libc-2.3.4.so
Archive:
Matched sample files: 1
/var/lib/oprofile/samples/current/{root}/a10/bin/rimacli/{dep}/{root}/lib/libc-2.3.4.so/GLOBAL_POWER_EVENTS.100000.1.26298.26298.all
profile_classes:
event:
cpuinfo: CPU: P4 / Xeon with 2 hyper-threads, speed 2992.68 MHz (estimated)
class #0:
name: GLOBAL_POWER_EVENTS:100000
longname: Counted GLOBAL_POWER_EVENTS events (time during which processor is not stopped) with a unit mask of 0x01 (mandatory) count 100000
ptemplate:
event: GLOBAL_POWER_EVENTS
count: 100000
unitmask: 1
tgid: 26298
tid: 26298
cpu: all
profiles_set #0:
image: /a10/bin/rimacli
profile_dep_set #0:
lib_image: /lib/libc-2.3.4.so
profile_sample_files #0:
sample_filename: /var/lib/oprofile/samples/current/{root}/a10/bin/rimacli/{dep}/{root}/lib/libc-2.3.4.so/GLOBAL_POWER_EVENTS.100000.1.26298.26298.all
callgraph filenames:
CPU: P4 / Xeon with 2 hyper-threads, speed 2992.68 MHz (estimated)
Counted GLOBAL_POWER_EVENTS events (time during which processor is not stopped) with a unit mask of 0x01 (mandatory) count 100000
op_bfd ctor for /lib/libc-2.3.4.so
Segmentation fault
-bash-3.00# gdb opreport -l /lib/libc-2.3.4.so
Program received signal SIGSEGV, Segmentation fault.
0x080c61f9 in op_bfd (this=0xbfabe7b0, archive=@0x43, fname=@0x43, symbol_filter=@0x43,
ok=@0xbfabe70f) at op_bfd.cpp:138
138 if (sect->flags & SEC_CODE) {
133 goto out_fail;
134 }
135
136 // find .text and use it
137 for (sect = ibfd.abfd->sections; sect; sect = sect->next) {
138 if (sect->flags & SEC_CODE) {
139 if (filepos_map[sect->name] != 0) {
140 cerr << "Found section \"" << sect->name
141 << "\" twice for " << get_filename()
142 << endl;
Logged In: YES
user_id=318973
Originator: NO
Can you check there is no bfd.h in the include path which do not match the libbfd.so used by opreport ? Like a bfd.h in /usr/local/include but linking is done with /usr/lib/libbfd[...].so
Logged In: YES
user_id=2042160
Originator: YES
-bash-3.00# find / -name bfd.h
./usr/include/bfd.h
-bash-3.00# ldd /usr/local/bin/opreport
linux-gate.so.1 => (0xffffe000)
libpopt.so.0 => /usr/lib/libpopt.so.0 (0xb7ef5000)
libbfd-2.15.94.0.2.2.so => /usr/lib/libbfd-2.15.94.0.2.2.so (0xb7e79000)
libdl.so.2 => /lib/libdl.so.2 (0xb7e75000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7da4000)
libm.so.6 => /lib/libm.so.6 (0xb7d81000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb7d78000)
libc.so.6 => /lib/libc.so.6 (0xb7c5d000)
/lib/ld-linux.so.2 (0xb7f02000)
So i think the header file bfd.h and bfd library are right.
I use oprofile-0.9.3
gcc version is 3.4.3
binutils-2.15.94.0.2.2
any suggestion ?
thank you
Logged In: YES
user_id=2042160
Originator: YES
The problem has fixed after i upgrade binutils to version 2.18 and recompile the oprofile.
It caused by oprofile-0.9.3 is depend on the version of the library it used.
I think it is better to add comment of the version gcc, binutils etc that oprofile depend on.
thanks.
Logged In: YES
user_id=318973
Originator: NO
> I use oprofile-0.9.3
> gcc version is 3.4.3
> binutils-2.15.94.0.2.2
nearest version I tried:
gcc version is 3.4.6
libbfd-2.15.92.0.2.so