From: BruceSong <bru...@gm...> - 2010-06-23 09:15:03
|
Hi, I am a new learner for oprofile. Those day, I use it to test my binary. But i meet some problems, here is the detailed steps: [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ uname -r 2.6.18-128.el5PAE [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ ls /dev/oprofile/ 0 1 backtrace_depth buffer buffer_size buffer_watershed cpu_buffer_size cpu_type dump enable pointer_size stats [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ more /dev/oprofile/cpu_type i386/core_2 [brucehuang@rat013:~/dev/workspace/CAPC2]$ ophelp -v ophelp: oprofile 0.9.6 compiled on Jun 22 2010 17:28:26 [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ sudo opcontrol --init [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ sudo opcontrol --start --verbose Parameters used: SESSION_DIR /var/lib/oprofile LOCK_FILE /var/lib/oprofile/lock SAMPLES_DIR /var/lib/oprofile/samples CURRENT_SAMPLES_DIR /var/lib/oprofile/samples/current CPUTYPE i386/core_2 BUF_SIZE default value BUF_WATERSHED default value CPU_BUF_SIZE default value SEPARATE_LIB 1 SEPARATE_KERNEL 0 SEPARATE_THREAD 0 SEPARATE_CPU 0 CALLGRAPH 4 VMLINUX none KERNEL_RANGE XENIMAGE none XEN_RANGE executing oprofiled --session-dir=/var/lib/oprofile --separate-lib=1 --separate-kernel=0 --separate-thread=0 --separate-cpu=0 --events=CPU_CLK_UNHALTED:60:0:100000:0:1:1, --no-vmlinux --verbose=all Events: CPU_CLK_UNHALTED:60:0:100000:0:1:1, Using 2.6+ OProfile kernel interface. Using log file /var/lib/oprofile/samples/oprofiled.log Daemon started. Profiler running. [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ ./a.out 1 This is a test arg[1]=1 ++1++ ++1++ [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ opreport|less CPU: Core 2, speed 2800 MHz (estimated) Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000 CPU_CLK_UNHALT...| samples| %| ------------------ 4693115 49.3060 a.out CPU_CLK_UNHALT...| samples| %| ------------------ 4369967 93.1144 libc-2.5.so 322982 6.8820 a.out 77 0.0016 [vdso] (tgid:6181 range:0x9f7000-0x9f8000) 76 0.0016 [vdso] (tgid:7370 range:0xd90000-0xd91000) 12 2.6e-04 ld-2.5.so 1 2.1e-05 [vdso] (tgid:9493 range:0x8ad000-0x8ae000) ...... [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ opreport -lc /home/brucehuang/Desktop/ToolAssessment/oprofile/a.out|less warning: [vdso] (tgid:6181 range:0x9f7000-0x9f8000) could not be found. warning: [vdso] (tgid:7370 range:0xd90000-0xd91000) could not be found. warning: [vdso] (tgid:9493 range:0x8ad000-0x8ae000) could not be found. CPU: Core 2, speed 2800 MHz (estimated) Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000 So it is clear that the last step appears error. Error happens when I use -l to lit per-symbol information instead of a binary image summary or use -c to show callgraph information. Would you please help me? Thanks very much in advance! Best regards, Bruce.Huang -- View this message in context: http://old.nabble.com/Error-happens-when-using-command-%22opreport--lc%22-tp28969440p28969440.html Sent from the oprofile-list mailing list archive at Nabble.com. |
From: Maynard J. <may...@us...> - 2010-06-23 19:59:07
|
BruceSong wrote: > > Hi, > > I am a new learner for oprofile. Those day, I use it to test my binary. But > i meet some problems, here is the detailed steps: > > [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ uname -r > 2.6.18-128.el5PAE > > [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ ls /dev/oprofile/ > 0 1 backtrace_depth buffer buffer_size buffer_watershed > cpu_buffer_size cpu_type dump enable pointer_size stats > > [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ more > /dev/oprofile/cpu_type > i386/core_2 > > [brucehuang@rat013:~/dev/workspace/CAPC2]$ ophelp -v > ophelp: oprofile 0.9.6 compiled on Jun 22 2010 17:28:26 > > [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ sudo opcontrol --init > > [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ sudo opcontrol > --start --verbose > Parameters used: > SESSION_DIR /var/lib/oprofile > LOCK_FILE /var/lib/oprofile/lock > SAMPLES_DIR /var/lib/oprofile/samples > CURRENT_SAMPLES_DIR /var/lib/oprofile/samples/current > CPUTYPE i386/core_2 > BUF_SIZE default value > BUF_WATERSHED default value > CPU_BUF_SIZE default value > SEPARATE_LIB 1 > SEPARATE_KERNEL 0 > SEPARATE_THREAD 0 > SEPARATE_CPU 0 > CALLGRAPH 4 > VMLINUX none > KERNEL_RANGE > XENIMAGE none > XEN_RANGE > executing oprofiled --session-dir=/var/lib/oprofile --separate-lib=1 > --separate-kernel=0 --separate-thread=0 --separate-cpu=0 > --events=CPU_CLK_UNHALTED:60:0:100000:0:1:1, --no-vmlinux --verbose=all > Events: CPU_CLK_UNHALTED:60:0:100000:0:1:1, > Using 2.6+ OProfile kernel interface. > Using log file /var/lib/oprofile/samples/oprofiled.log > Daemon started. > Profiler running. > > [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ ./a.out 1 > This is a test > arg[1]=1 > ++1++ > ++1++ > > [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ opreport|less > CPU: Core 2, speed 2800 MHz (estimated) > Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit > mask of 0x00 (Unhalted core cycles) count 100000 > CPU_CLK_UNHALT...| > samples| %| > ------------------ > 4693115 49.3060 a.out > CPU_CLK_UNHALT...| > samples| %| > ------------------ > 4369967 93.1144 libc-2.5.so > 322982 6.8820 a.out > 77 0.0016 [vdso] (tgid:6181 range:0x9f7000-0x9f8000) > 76 0.0016 [vdso] (tgid:7370 range:0xd90000-0xd91000) > 12 2.6e-04 ld-2.5.so > 1 2.1e-05 [vdso] (tgid:9493 range:0x8ad000-0x8ae000) > ...... > > [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ opreport -lc > /home/brucehuang/Desktop/ToolAssessment/oprofile/a.out|less > warning: [vdso] (tgid:6181 range:0x9f7000-0x9f8000) could not be found. > warning: [vdso] (tgid:7370 range:0xd90000-0xd91000) could not be found. > warning: [vdso] (tgid:9493 range:0x8ad000-0x8ae000) could not be found. > CPU: Core 2, speed 2800 MHz (estimated) > Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit > mask of 0x00 (Unhalted core cycles) count 100000 So your opreport output just ends here . . .-----^ ? Try running 'opreport -l --verbose=all'. -Maynard > > So it is clear that the last step appears error. Error happens when I use -l > to lit per-symbol information instead of a binary image summary or use -c to > show callgraph information. > Would you please help me? Thanks very much in advance! > > Best regards, > Bruce.Huang > |
From: BruceSong <bru...@gm...> - 2010-06-24 03:17:03
|
Hi Maynard, Thanks for your quick reply, here comes the debug info: [brucehuang@rat013:/sandbox/oprofiletest]$ opreport --verbose=all -c ./a.out ./a.out Archive: Matched sample files: 4 /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/lib/ld-2.5.so/CPU_CLK_UNHALTED.100000.0.all.all.all /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/lib/ld-2.5.so/{cg}/{root}/lib/ld-2.5.so/CPU_CLK_UNHALTED.100000.0.all.all.all /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/sandbox/oprofiletest/a.out/CPU_CLK_UNHALTED.100000.0.all.all.all /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/sandbox/oprofiletest/a.out/{cg}/{root}/sandbox/oprofiletest/a.out/CPU_CLK_UNHALTED.100000.0.all.all.all profile_classes: event: cpuinfo: CPU: Core 2, speed 2800 MHz (estimated) class #0: name: CPU_CLK_UNHALTED:100000 longname: Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000 ptemplate: event: CPU_CLK_UNHALTED count: 100000 unitmask: 0 tgid: all tid: all cpu: all profiles_set #0: image: /sandbox/oprofiletest/a.out profile_sample_files #0: sample_filename: /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/sandbox/oprofiletest/a.out/CPU_CLK_UNHALTED.100000.0.all.all.all callgraph filenames: /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/sandbox/oprofiletest/a.out/{cg}/{root}/sandbox/oprofiletest/a.out/CPU_CLK_UNHALTED.100000.0.all.all.all profile_dep_set #0: lib_image: /lib/ld-2.5.so profile_sample_files #0: sample_filename: /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/lib/ld-2.5.so/CPU_CLK_UNHALTED.100000.0.all.all.all callgraph filenames: profile_dep_set #1: lib_image: /lib/ld-2.5.so profile_sample_files #0: sample_filename: callgraph filenames: /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/lib/ld-2.5.so/{cg}/{root}/lib/ld-2.5.so/CPU_CLK_UNHALTED.100000.0.all.all.all CPU: Core 2, speed 2800 MHz (estimated) Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000 op_bfd ctor for /lib/ld-2.5.so Segmentation fault (core dumped) Thanks! Bruce Maynard Johnson wrote: > > BruceSong wrote: >> >> Hi, >> >> I am a new learner for oprofile. Those day, I use it to test my binary. >> But >> i meet some problems, here is the detailed steps: >> >> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ uname -r >> 2.6.18-128.el5PAE >> >> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ ls /dev/oprofile/ >> 0 1 backtrace_depth buffer buffer_size buffer_watershed >> cpu_buffer_size cpu_type dump enable pointer_size stats >> >> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ more >> /dev/oprofile/cpu_type >> i386/core_2 >> >> [brucehuang@rat013:~/dev/workspace/CAPC2]$ ophelp -v >> ophelp: oprofile 0.9.6 compiled on Jun 22 2010 17:28:26 >> >> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ sudo opcontrol >> --init >> >> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ sudo opcontrol >> --start --verbose >> Parameters used: >> SESSION_DIR /var/lib/oprofile >> LOCK_FILE /var/lib/oprofile/lock >> SAMPLES_DIR /var/lib/oprofile/samples >> CURRENT_SAMPLES_DIR /var/lib/oprofile/samples/current >> CPUTYPE i386/core_2 >> BUF_SIZE default value >> BUF_WATERSHED default value >> CPU_BUF_SIZE default value >> SEPARATE_LIB 1 >> SEPARATE_KERNEL 0 >> SEPARATE_THREAD 0 >> SEPARATE_CPU 0 >> CALLGRAPH 4 >> VMLINUX none >> KERNEL_RANGE >> XENIMAGE none >> XEN_RANGE >> executing oprofiled --session-dir=/var/lib/oprofile --separate-lib=1 >> --separate-kernel=0 --separate-thread=0 --separate-cpu=0 >> --events=CPU_CLK_UNHALTED:60:0:100000:0:1:1, --no-vmlinux --verbose=all >> Events: CPU_CLK_UNHALTED:60:0:100000:0:1:1, >> Using 2.6+ OProfile kernel interface. >> Using log file /var/lib/oprofile/samples/oprofiled.log >> Daemon started. >> Profiler running. >> >> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ ./a.out 1 >> This is a test >> arg[1]=1 >> ++1++ >> ++1++ >> >> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ opreport|less >> CPU: Core 2, speed 2800 MHz (estimated) >> Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a >> unit >> mask of 0x00 (Unhalted core cycles) count 100000 >> CPU_CLK_UNHALT...| >> samples| %| >> ------------------ >> 4693115 49.3060 a.out >> CPU_CLK_UNHALT...| >> samples| %| >> ------------------ >> 4369967 93.1144 libc-2.5.so >> 322982 6.8820 a.out >> 77 0.0016 [vdso] (tgid:6181 range:0x9f7000-0x9f8000) >> 76 0.0016 [vdso] (tgid:7370 range:0xd90000-0xd91000) >> 12 2.6e-04 ld-2.5.so >> 1 2.1e-05 [vdso] (tgid:9493 range:0x8ad000-0x8ae000) >> ...... >> >> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ opreport -lc >> /home/brucehuang/Desktop/ToolAssessment/oprofile/a.out|less >> warning: [vdso] (tgid:6181 range:0x9f7000-0x9f8000) could not be found. >> warning: [vdso] (tgid:7370 range:0xd90000-0xd91000) could not be found. >> warning: [vdso] (tgid:9493 range:0x8ad000-0x8ae000) could not be found. >> CPU: Core 2, speed 2800 MHz (estimated) >> Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a >> unit >> mask of 0x00 (Unhalted core cycles) count 100000 > > So your opreport output just ends here . . .-----^ ? Try running > 'opreport -l --verbose=all'. > > -Maynard > >> >> So it is clear that the last step appears error. Error happens when I use >> -l >> to lit per-symbol information instead of a binary image summary or use -c >> to >> show callgraph information. >> Would you please help me? Thanks very much in advance! >> >> Best regards, >> Bruce.Huang >> > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > oprofile-list mailing list > opr...@li... > https://lists.sourceforge.net/lists/listinfo/oprofile-list > > -- View this message in context: http://old.nabble.com/Error-happens-when-using-command-%22opreport--lc%22-tp28969440p28978555.html Sent from the oprofile-list mailing list archive at Nabble.com. |
From: BruceSong <bru...@gm...> - 2010-06-24 10:21:42
|
Hi Maynard, I find some information in internet, and recompile the oprofile using the latest binutils package, especially with the latest libbfd.a. Now it works. But sometimes, when I do some attempt, such as: sudo opcontrol --event=CPU_CLK_UNHALTED:100000:0:1:1, or other configuration. And then using opreport, it does not work. For example: [brucehuang@rat013:~]$ sudo opcontrol --init [brucehuang@rat013:~]$ sudo opcontrol --status Daemon not running Event 0: CPU_CLK_UNHALTED:100000:0:1:1 Separate options: library vmlinux file: none Image filter: none Call-graph depth: 4 [brucehuang@rat013:~]$ sudo opcontrol --start --verbose Parameters used: SESSION_DIR /var/lib/oprofile LOCK_FILE /var/lib/oprofile/lock SAMPLES_DIR /var/lib/oprofile/samples CURRENT_SAMPLES_DIR /var/lib/oprofile/samples/current CPUTYPE i386/core_2 BUF_SIZE default value BUF_WATERSHED default value CPU_BUF_SIZE default value SEPARATE_LIB 1 SEPARATE_KERNEL 0 SEPARATE_THREAD 0 SEPARATE_CPU 0 CALLGRAPH 4 VMLINUX none KERNEL_RANGE XENIMAGE none XEN_RANGE executing oprofiled --session-dir=/var/lib/oprofile --separate-lib=1 --separate-kernel=0 --separate-thread=0 --separate-cpu=0 --events=CPU_CLK_UNHALTED:60:0:100000:0:1:1, --no-vmlinux --image=none --verbose=all Events: CPU_CLK_UNHALTED:60:0:100000:0:1:1, Using 2.6+ OProfile kernel interface. Using log file /var/lib/oprofile/samples/oprofiled.log Daemon started. Profiler running. [brucehuang@rat013:~]$ opreport --verbose=all WARNING! The OProfile kernel driver reports sample buffer overflows. Such overflows can result in incorrect sample attribution, invalid sample files and other symptoms. See the oprofiled.log for details. You should adjust your sampling frequency to eliminate (or at least minimize) these overflows. Archive: Matched sample files: 0 profile_classes: event: cpuinfo: error: no sample files found: profile specification too strict ? You can see that error happens, and also it shows one warning. So why error happens? And also i think sample frequency is not higher since i set 100000 count. What should be done for this warning? Thanks a lot! Bruce BruceSong wrote: > > Hi Maynard, > > Thanks for your quick reply, here comes the debug info: > [brucehuang@rat013:/sandbox/oprofiletest]$ opreport --verbose=all -c > ./a.out > ./a.out > > Archive: > Matched sample files: 4 > /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/lib/ld-2.5.so/CPU_CLK_UNHALTED.100000.0.all.all.all > /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/lib/ld-2.5.so/{cg}/{root}/lib/ld-2.5.so/CPU_CLK_UNHALTED.100000.0.all.all.all > /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/sandbox/oprofiletest/a.out/CPU_CLK_UNHALTED.100000.0.all.all.all > /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/sandbox/oprofiletest/a.out/{cg}/{root}/sandbox/oprofiletest/a.out/CPU_CLK_UNHALTED.100000.0.all.all.all > profile_classes: > event: > cpuinfo: CPU: Core 2, speed 2800 MHz (estimated) > class #0: > name: CPU_CLK_UNHALTED:100000 > longname: Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) > with a unit mask of 0x00 (Unhalted core cycles) count 100000 > ptemplate: > event: CPU_CLK_UNHALTED > count: 100000 > unitmask: 0 > tgid: all > tid: all > cpu: all > profiles_set #0: > image: /sandbox/oprofiletest/a.out > profile_sample_files #0: > sample_filename: > /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/sandbox/oprofiletest/a.out/CPU_CLK_UNHALTED.100000.0.all.all.all > callgraph filenames: > /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/sandbox/oprofiletest/a.out/{cg}/{root}/sandbox/oprofiletest/a.out/CPU_CLK_UNHALTED.100000.0.all.all.all > profile_dep_set #0: > lib_image: /lib/ld-2.5.so > profile_sample_files #0: > sample_filename: > /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/lib/ld-2.5.so/CPU_CLK_UNHALTED.100000.0.all.all.all > callgraph filenames: > profile_dep_set #1: > lib_image: /lib/ld-2.5.so > profile_sample_files #0: > sample_filename: > callgraph filenames: > /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/lib/ld-2.5.so/{cg}/{root}/lib/ld-2.5.so/CPU_CLK_UNHALTED.100000.0.all.all.all > > CPU: Core 2, speed 2800 MHz (estimated) > Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit > mask of 0x00 (Unhalted core cycles) count 100000 > op_bfd ctor for /lib/ld-2.5.so > Segmentation fault (core dumped) > > And also here is what gdb says: > (gdb) run > Starting program: /usr/local/bin/opreport --verbose=all -c > /sandbox/oprofiletest/a.out > /sandbox/oprofiletest/a.out > > WARNING! The OProfile kernel driver reports sample buffer overflows. > Such overflows can result in incorrect sample attribution, invalid sample > files and other symptoms. See the oprofiled.log for details. > You should adjust your sampling frequency to eliminate (or at least > minimize) > these overflows. > Archive: > Matched sample files: 4 > /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/lib/ld-2.5.so/CPU_CLK_UNHALTED.100000.0.all.all.all > /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/lib/ld-2.5.so/{cg}/{root}/lib/ld-2.5.so/CPU_CLK_UNHALTED.100000.0.all.all.all > /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/sandbox/oprofiletest/a.out/CPU_CLK_UNHALTED.100000.0.all.all.all > /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/sandbox/oprofiletest/a.out/{cg}/{root}/sandbox/oprofiletest/a.out/CPU_CLK_UNHALTED.100000.0.all.all.all > profile_classes: > event: > cpuinfo: CPU: Core 2, speed 2800 MHz (estimated) > class #0: > name: CPU_CLK_UNHALTED:100000 > longname: Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) > with a unit mask of 0x00 (Unhalted core cycles) count 100000 > ptemplate: > event: CPU_CLK_UNHALTED > count: 100000 > unitmask: 0 > tgid: all > tid: all > cpu: all > profiles_set #0: > image: /sandbox/oprofiletest/a.out > profile_sample_files #0: > sample_filename: > /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/sandbox/oprofiletest/a.out/CPU_CLK_UNHALTED.100000.0.all.all.all > callgraph filenames: > /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/sandbox/oprofiletest/a.out/{cg}/{root}/sandbox/oprofiletest/a.out/CPU_CLK_UNHALTED.100000.0.all.all.all > profile_dep_set #0: > lib_image: /lib/ld-2.5.so > profile_sample_files #0: > sample_filename: > /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/lib/ld-2.5.so/CPU_CLK_UNHALTED.100000.0.all.all.all > callgraph filenames: > profile_dep_set #1: > lib_image: /lib/ld-2.5.so > profile_sample_files #0: > sample_filename: > callgraph filenames: > /var/lib/oprofile/samples/current/{root}/sandbox/oprofiletest/a.out/{dep}/{root}/lib/ld-2.5.so/{cg}/{root}/lib/ld-2.5.so/CPU_CLK_UNHALTED.100000.0.all.all.all > > CPU: Core 2, speed 2800 MHz (estimated) > Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit > mask of 0x00 (Unhalted core cycles) count 100000 > op_bfd ctor for /lib/ld-2.5.so > > Program received signal SIGSEGV, Segmentation fault. > op_bfd (this=0xbfc3b648, fname=@0x9cab298, symbol_filter=@0x818a824, > extra_images=@0xbfc3b7b4, ok=@0xbfc3b739) at op_bfd.cpp:161 > 161 if (sect->flags & SEC_CODE) { > (gdb) > > B.T.W, I can,t find libbfd.a or libbfd.so is linked to opreport binary. > Why? > [brucehuang@rat013:/sandbox/binutils-2.20.1]$ ldd /usr/local/bin/opreport > linux-gate.so.1 => (0x002b8000) > libpopt.so.0 => /usr/lib/libpopt.so.0 (0x0046f000) > libdl.so.2 => /lib/libdl.so.2 (0x00c78000) > libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x07363000) > libm.so.6 => /lib/libm.so.6 (0x00c4f000) > libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x07355000) > libc.so.6 => /lib/libc.so.6 (0x00b09000) > /lib/ld-linux.so.2 (0x00ae6000) > [brucehuang@rat013:/sandbox/binutils-2.20.1]$ ls /usr/lib/libbfd* > /usr/lib/libbfd-2.17.50.0.6-9.el5.so /usr/lib/libbfd.a > > Thanks! > Bruce > > > Maynard Johnson wrote: >> >> BruceSong wrote: >>> >>> Hi, >>> >>> I am a new learner for oprofile. Those day, I use it to test my binary. >>> But >>> i meet some problems, here is the detailed steps: >>> >>> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ uname -r >>> 2.6.18-128.el5PAE >>> >>> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ ls /dev/oprofile/ >>> 0 1 backtrace_depth buffer buffer_size buffer_watershed >>> cpu_buffer_size cpu_type dump enable pointer_size stats >>> >>> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ more >>> /dev/oprofile/cpu_type >>> i386/core_2 >>> >>> [brucehuang@rat013:~/dev/workspace/CAPC2]$ ophelp -v >>> ophelp: oprofile 0.9.6 compiled on Jun 22 2010 17:28:26 >>> >>> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ sudo opcontrol >>> --init >>> >>> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ sudo opcontrol >>> --start --verbose >>> Parameters used: >>> SESSION_DIR /var/lib/oprofile >>> LOCK_FILE /var/lib/oprofile/lock >>> SAMPLES_DIR /var/lib/oprofile/samples >>> CURRENT_SAMPLES_DIR /var/lib/oprofile/samples/current >>> CPUTYPE i386/core_2 >>> BUF_SIZE default value >>> BUF_WATERSHED default value >>> CPU_BUF_SIZE default value >>> SEPARATE_LIB 1 >>> SEPARATE_KERNEL 0 >>> SEPARATE_THREAD 0 >>> SEPARATE_CPU 0 >>> CALLGRAPH 4 >>> VMLINUX none >>> KERNEL_RANGE >>> XENIMAGE none >>> XEN_RANGE >>> executing oprofiled --session-dir=/var/lib/oprofile --separate-lib=1 >>> --separate-kernel=0 --separate-thread=0 --separate-cpu=0 >>> --events=CPU_CLK_UNHALTED:60:0:100000:0:1:1, --no-vmlinux --verbose=all >>> Events: CPU_CLK_UNHALTED:60:0:100000:0:1:1, >>> Using 2.6+ OProfile kernel interface. >>> Using log file /var/lib/oprofile/samples/oprofiled.log >>> Daemon started. >>> Profiler running. >>> >>> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ ./a.out 1 >>> This is a test >>> arg[1]=1 >>> ++1++ >>> ++1++ >>> >>> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ opreport|less >>> CPU: Core 2, speed 2800 MHz (estimated) >>> Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a >>> unit >>> mask of 0x00 (Unhalted core cycles) count 100000 >>> CPU_CLK_UNHALT...| >>> samples| %| >>> ------------------ >>> 4693115 49.3060 a.out >>> CPU_CLK_UNHALT...| >>> samples| %| >>> ------------------ >>> 4369967 93.1144 libc-2.5.so >>> 322982 6.8820 a.out >>> 77 0.0016 [vdso] (tgid:6181 range:0x9f7000-0x9f8000) >>> 76 0.0016 [vdso] (tgid:7370 range:0xd90000-0xd91000) >>> 12 2.6e-04 ld-2.5.so >>> 1 2.1e-05 [vdso] (tgid:9493 range:0x8ad000-0x8ae000) >>> ...... >>> >>> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ opreport -lc >>> /home/brucehuang/Desktop/ToolAssessment/oprofile/a.out|less >>> warning: [vdso] (tgid:6181 range:0x9f7000-0x9f8000) could not be found. >>> warning: [vdso] (tgid:7370 range:0xd90000-0xd91000) could not be found. >>> warning: [vdso] (tgid:9493 range:0x8ad000-0x8ae000) could not be found. >>> CPU: Core 2, speed 2800 MHz (estimated) >>> Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a >>> unit >>> mask of 0x00 (Unhalted core cycles) count 100000 >> >> So your opreport output just ends here . . .-----^ ? Try running >> 'opreport -l --verbose=all'. >> >> -Maynard >> >>> >>> So it is clear that the last step appears error. Error happens when I >>> use -l >>> to lit per-symbol information instead of a binary image summary or use >>> -c to >>> show callgraph information. >>> Would you please help me? Thanks very much in advance! >>> >>> Best regards, >>> Bruce.Huang >>> >> >> >> ------------------------------------------------------------------------------ >> ThinkGeek and WIRED's GeekDad team up for the Ultimate >> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the >> lucky parental unit. See the prize list and enter to win: >> http://p.sf.net/sfu/thinkgeek-promo >> _______________________________________________ >> oprofile-list mailing list >> opr...@li... >> https://lists.sourceforge.net/lists/listinfo/oprofile-list >> >> > > -- View this message in context: http://old.nabble.com/Error-happens-when-using-command-%22opreport--lc%22-tp28969440p28981012.html Sent from the oprofile-list mailing list archive at Nabble.com. |
From: BruceSong <bru...@gm...> - 2010-06-24 14:53:09
|
Hi Maynard, Thanks for your quick reply. I search some information in this forum, and find that maybe I need recompile the oprofile using the latest binutils package, especially with libbfd.a. So I recompile again. Now it works. Thanks! Bruce Maynard Johnson wrote: > > BruceSong wrote: >> >> Hi, >> >> I am a new learner for oprofile. Those day, I use it to test my binary. >> But >> i meet some problems, here is the detailed steps: >> >> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ uname -r >> 2.6.18-128.el5PAE >> >> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ ls /dev/oprofile/ >> 0 1 backtrace_depth buffer buffer_size buffer_watershed >> cpu_buffer_size cpu_type dump enable pointer_size stats >> >> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ more >> /dev/oprofile/cpu_type >> i386/core_2 >> >> [brucehuang@rat013:~/dev/workspace/CAPC2]$ ophelp -v >> ophelp: oprofile 0.9.6 compiled on Jun 22 2010 17:28:26 >> >> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ sudo opcontrol >> --init >> >> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ sudo opcontrol >> --start --verbose >> Parameters used: >> SESSION_DIR /var/lib/oprofile >> LOCK_FILE /var/lib/oprofile/lock >> SAMPLES_DIR /var/lib/oprofile/samples >> CURRENT_SAMPLES_DIR /var/lib/oprofile/samples/current >> CPUTYPE i386/core_2 >> BUF_SIZE default value >> BUF_WATERSHED default value >> CPU_BUF_SIZE default value >> SEPARATE_LIB 1 >> SEPARATE_KERNEL 0 >> SEPARATE_THREAD 0 >> SEPARATE_CPU 0 >> CALLGRAPH 4 >> VMLINUX none >> KERNEL_RANGE >> XENIMAGE none >> XEN_RANGE >> executing oprofiled --session-dir=/var/lib/oprofile --separate-lib=1 >> --separate-kernel=0 --separate-thread=0 --separate-cpu=0 >> --events=CPU_CLK_UNHALTED:60:0:100000:0:1:1, --no-vmlinux --verbose=all >> Events: CPU_CLK_UNHALTED:60:0:100000:0:1:1, >> Using 2.6+ OProfile kernel interface. >> Using log file /var/lib/oprofile/samples/oprofiled.log >> Daemon started. >> Profiler running. >> >> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ ./a.out 1 >> This is a test >> arg[1]=1 >> ++1++ >> ++1++ >> >> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ opreport|less >> CPU: Core 2, speed 2800 MHz (estimated) >> Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a >> unit >> mask of 0x00 (Unhalted core cycles) count 100000 >> CPU_CLK_UNHALT...| >> samples| %| >> ------------------ >> 4693115 49.3060 a.out >> CPU_CLK_UNHALT...| >> samples| %| >> ------------------ >> 4369967 93.1144 libc-2.5.so >> 322982 6.8820 a.out >> 77 0.0016 [vdso] (tgid:6181 range:0x9f7000-0x9f8000) >> 76 0.0016 [vdso] (tgid:7370 range:0xd90000-0xd91000) >> 12 2.6e-04 ld-2.5.so >> 1 2.1e-05 [vdso] (tgid:9493 range:0x8ad000-0x8ae000) >> ...... >> >> [brucehuang@rat013:~/Desktop/ToolAssessment/oprofile]$ opreport -lc >> /home/brucehuang/Desktop/ToolAssessment/oprofile/a.out|less >> warning: [vdso] (tgid:6181 range:0x9f7000-0x9f8000) could not be found. >> warning: [vdso] (tgid:7370 range:0xd90000-0xd91000) could not be found. >> warning: [vdso] (tgid:9493 range:0x8ad000-0x8ae000) could not be found. >> CPU: Core 2, speed 2800 MHz (estimated) >> Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a >> unit >> mask of 0x00 (Unhalted core cycles) count 100000 > > So your opreport output just ends here . . .-----^ ? Try running > 'opreport -l --verbose=all'. > > -Maynard > >> >> So it is clear that the last step appears error. Error happens when I use >> -l >> to lit per-symbol information instead of a binary image summary or use -c >> to >> show callgraph information. >> Would you please help me? Thanks very much in advance! >> >> Best regards, >> Bruce.Huang >> > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > oprofile-list mailing list > opr...@li... > https://lists.sourceforge.net/lists/listinfo/oprofile-list > > -- View this message in context: http://old.nabble.com/Error-happens-when-using-command-%22opreport--lc%22-tp28969440p28983314.html Sent from the oprofile-list mailing list archive at Nabble.com. |
From: Maynard J. <may...@us...> - 2010-06-24 14:10:13
|
On 06/24/2010 5:22 AM, BruceSong wrote: > > Hi Maynard, > > I find some information in internet, and recompile the oprofile using the > latest binutils package, especially with the latest libbfd.a. Now it works. > > But sometimes, when I do some attempt, such as: > sudo opcontrol --event=CPU_CLK_UNHALTED:100000:0:1:1, or other > configuration. And then using opreport, it does not work. > > For example: > [brucehuang@rat013:~]$ sudo opcontrol --init > > [brucehuang@rat013:~]$ sudo opcontrol --status > Daemon not running > Event 0: CPU_CLK_UNHALTED:100000:0:1:1 > Separate options: library > vmlinux file: none > Image filter: none > Call-graph depth: 4 > [brucehuang@rat013:~]$ sudo opcontrol --start --verbose Do *NOT* use '--verbose' for normal profile runs. Use it *ONLY* for debugging problems. This adds a tremendous amount of overhead to the oprofile daemon, almost ensuring you'll get the "WARNING! The OProfile kernel driver reports sample buffer overflows" message. > Parameters used: > SESSION_DIR /var/lib/oprofile > LOCK_FILE /var/lib/oprofile/lock > SAMPLES_DIR /var/lib/oprofile/samples > CURRENT_SAMPLES_DIR /var/lib/oprofile/samples/current > CPUTYPE i386/core_2 > BUF_SIZE default value > BUF_WATERSHED default value > CPU_BUF_SIZE default value > SEPARATE_LIB 1 > SEPARATE_KERNEL 0 > SEPARATE_THREAD 0 > SEPARATE_CPU 0 > CALLGRAPH 4 Doing callgraph profiling also adds a lot of overhead, both in kernel and userspace. Whereas your sampling interval of one sample per 100,000 CPU_CLK_UNHALTED events might be fine ordinarily, I suspect that's a bit too much when you're also doing callgraph profiling. For profiling on cycles-based events (like CPU_CLK_UNHALTED), you can easily get a statistically valid profile by setting the count value pretty high--in your case, you can probably go up to 500,000. If you're collecting a profile where you just want to see hotspots and don't *need* to see callgraph data, then be sure to set --callgraph=0 to reduce or eliminate buffer overflows. > VMLINUX none > KERNEL_RANGE > XENIMAGE none > XEN_RANGE > executing oprofiled --session-dir=/var/lib/oprofile --separate-lib=1 > --separate-kernel=0 --separate-thread=0 --separate-cpu=0 > --events=CPU_CLK_UNHALTED:60:0:100000:0:1:1, --no-vmlinux --image=none > --verbose=all > Events: CPU_CLK_UNHALTED:60:0:100000:0:1:1, > Using 2.6+ OProfile kernel interface. > Using log file /var/lib/oprofile/samples/oprofiled.log > Daemon started. > Profiler running. > > [brucehuang@rat013:~]$ opreport --verbose=all > > > WARNING! The OProfile kernel driver reports sample buffer overflows. > Such overflows can result in incorrect sample attribution, invalid sample > files and other symptoms. See the oprofiled.log for details. > You should adjust your sampling frequency to eliminate (or at least > minimize) > these overflows. > Archive: > Matched sample files: 0 > profile_classes: > event: > cpuinfo: > > error: no sample files found: profile specification too strict ? > > You can see that error happens, and also it shows one warning. So why error > happens? And also i think sample frequency is not higher since i set 100000 > count. What should be done for this warning? Try my suggestions above and see if you get some good reports. You ask what can be done about this warning? Coincidentally, I just helped write an article on this subject, which you can find at: https://www.ibm.com/developerworks/wikis/display/LinuxP/Handling+oprofile+sample+buffer+overflows Let me know if that article helps clarify how to respond to the buffer overflow message. -Maynard > > Thanks a lot! > Bruce > |
From: BruceSong <bru...@gm...> - 2010-06-25 03:04:02
|
Hi Maynard, I retry according to your comments, but it still does not work. Please see the following steps: [brucehuang@rat013:/var/lib/oprofile/samples]$ sudo opcontrol --init [brucehuang@rat013:/var/lib/oprofile/samples]$ sudo opcontrol --reset [brucehuang@rat013:/var/lib/oprofile/samples]$ echo >/var/lib/oprofile/samples/oprofiled.log [brucehuang@rat013:/var/lib/oprofile/samples]$ sudo opcontrol --start Using 2.6+ OProfile kernel interface. Using log file /var/lib/oprofile//samples/oprofiled.log Daemon started. Profiler running. [brucehuang@rat013:/var/lib/oprofile/samples]$ sudo opcontrol --dump [brucehuang@rat013:/var/lib/oprofile/samples]$ ls -ltr /var/lib/oprofile/samples/ total 16 drwxr-xr-x 3 root root 4096 Jun 23 14:14 aaa drwxr-xr-x 4 root root 4096 Jun 25 10:40 tmp drwxr-xr-x 4 root root 4096 Jun 25 10:55 current -rwxrwxrwx 1 root root 67 Jun 25 10:56 oprofiled.log [brucehuang@rat013:/var/lib/oprofile/samples]$ sudo opcontrol --status Daemon running: pid 7646 Event 0: CPU_CLK_UNHALTED:500000:0:1:1 Separate options: library vmlinux file: none Image filter: none Call-graph depth: 0 [brucehuang@rat013:/var/lib/oprofile/samples]$ opreport --verbose=all Overflow stats not available Archive: Matched sample files: 0 profile_classes: event: cpuinfo: error: no sample files found: profile specification too strict ? [brucehuang@rat013:/var/lib/oprofile/samples]$ sudo opcontrol --shutdown Stopping profiling. Killing daemon. [brucehuang@rat013:/var/lib/oprofile/samples]$ more /var/lib/oprofile/samples/oprofiled.log oprofiled started Fri Jun 25 10:56:03 2010 kernel pointer size: 4 Fri Jun 25 10:59:15 2010 -- OProfile Statistics -- Nr. sample dumps: 6 Nr. non-backtrace samples: 45735 Nr. kernel samples: 19807 Nr. lost samples (no kernel/user): 0 Nr. lost kernel samples: 0 Nr. incomplete code structs: 0 Nr. samples lost due to sample file open failure: 0 Nr. samples lost due to no permanent mapping: 169 Nr. event lost due to buffer overflow: 0 Nr. samples lost due to no mapping: 37 Nr. backtraces skipped due to no file mapping: 0 Nr. samples lost due to no mm: 551 ---- Statistics for cpu : 1 Nr. samples lost cpu buffer overflow: 0 Nr. samples received: 51942 Nr. backtrace aborted: 0 ---- Statistics for cpu : 0 Nr. samples lost cpu buffer overflow: 0 Nr. samples received: 35983 Nr. backtrace aborted: 0 oprofiled stopped Fri Jun 25 10:59:15 2010 >From oprofiled.log, we can see it have achieved to get samples information successfully, but it does not work when using "opreport", why? I am very confused by this issue. Any help is appreciated. Thanks! Bruce Maynard Johnson wrote: > > On 06/24/2010 5:22 AM, BruceSong wrote: >> >> Hi Maynard, >> >> I find some information in internet, and recompile the oprofile using the >> latest binutils package, especially with the latest libbfd.a. Now it >> works. >> >> But sometimes, when I do some attempt, such as: >> sudo opcontrol --event=CPU_CLK_UNHALTED:100000:0:1:1, or other >> configuration. And then using opreport, it does not work. >> >> For example: >> [brucehuang@rat013:~]$ sudo opcontrol --init >> >> [brucehuang@rat013:~]$ sudo opcontrol --status >> Daemon not running >> Event 0: CPU_CLK_UNHALTED:100000:0:1:1 >> Separate options: library >> vmlinux file: none >> Image filter: none >> Call-graph depth: 4 >> [brucehuang@rat013:~]$ sudo opcontrol --start --verbose > > Do *NOT* use '--verbose' for normal profile runs. Use it *ONLY* for > debugging > problems. This adds a tremendous amount of overhead to the oprofile > daemon, > almost ensuring you'll get the "WARNING! The OProfile kernel driver > reports > sample buffer overflows" message. > >> Parameters used: >> SESSION_DIR /var/lib/oprofile >> LOCK_FILE /var/lib/oprofile/lock >> SAMPLES_DIR /var/lib/oprofile/samples >> CURRENT_SAMPLES_DIR /var/lib/oprofile/samples/current >> CPUTYPE i386/core_2 >> BUF_SIZE default value >> BUF_WATERSHED default value >> CPU_BUF_SIZE default value >> SEPARATE_LIB 1 >> SEPARATE_KERNEL 0 >> SEPARATE_THREAD 0 >> SEPARATE_CPU 0 >> CALLGRAPH 4 > > Doing callgraph profiling also adds a lot of overhead, both in kernel and > userspace. Whereas your sampling interval of one sample per 100,000 > CPU_CLK_UNHALTED events might be fine ordinarily, I suspect that's a bit > too > much when you're also doing callgraph profiling. For profiling on > cycles-based > events (like CPU_CLK_UNHALTED), you can easily get a statistically valid > profile > by setting the count value pretty high--in your case, you can probably go > up to > 500,000. > > If you're collecting a profile where you just want to see hotspots and > don't > *need* to see callgraph data, then be sure to set --callgraph=0 to reduce > or > eliminate buffer overflows. > >> VMLINUX none >> KERNEL_RANGE >> XENIMAGE none >> XEN_RANGE >> executing oprofiled --session-dir=/var/lib/oprofile --separate-lib=1 >> --separate-kernel=0 --separate-thread=0 --separate-cpu=0 >> --events=CPU_CLK_UNHALTED:60:0:100000:0:1:1, --no-vmlinux --image=none >> --verbose=all >> Events: CPU_CLK_UNHALTED:60:0:100000:0:1:1, >> Using 2.6+ OProfile kernel interface. >> Using log file /var/lib/oprofile/samples/oprofiled.log >> Daemon started. >> Profiler running. >> >> [brucehuang@rat013:~]$ opreport --verbose=all >> >> >> WARNING! The OProfile kernel driver reports sample buffer overflows. >> Such overflows can result in incorrect sample attribution, invalid sample >> files and other symptoms. See the oprofiled.log for details. >> You should adjust your sampling frequency to eliminate (or at least >> minimize) >> these overflows. >> Archive: >> Matched sample files: 0 >> profile_classes: >> event: >> cpuinfo: >> >> error: no sample files found: profile specification too strict ? >> >> You can see that error happens, and also it shows one warning. So why >> error >> happens? And also i think sample frequency is not higher since i set >> 100000 >> count. What should be done for this warning? > > Try my suggestions above and see if you get some good reports. You ask > what can > be done about this warning? Coincidentally, I just helped write an > article on > this subject, which you can find at: > https://www.ibm.com/developerworks/wikis/display/LinuxP/Handling+oprofile+sample+buffer+overflows > > Let me know if that article helps clarify how to respond to the buffer > overflow > message. > > -Maynard >> >> Thanks a lot! >> Bruce >> > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > oprofile-list mailing list > opr...@li... > https://lists.sourceforge.net/lists/listinfo/oprofile-list > > -- View this message in context: http://old.nabble.com/Error-happens-when-using-command-%22opreport--lc%22-tp28969440p28988689.html Sent from the oprofile-list mailing list archive at Nabble.com. |
From: BruceSong <bru...@gm...> - 2010-06-25 06:49:31
|
dddd BruceSong wrote: > > Hi Maynard, > > I retry according to your comments, but it still does not work. Please see > the following steps: > > [brucehuang@rat013:/var/lib/oprofile/samples]$ sudo opcontrol --init > [brucehuang@rat013:/var/lib/oprofile/samples]$ sudo opcontrol --reset > [brucehuang@rat013:/var/lib/oprofile/samples]$ echo > >/var/lib/oprofile/samples/oprofiled.log > [brucehuang@rat013:/var/lib/oprofile/samples]$ sudo opcontrol --start > Using 2.6+ OProfile kernel interface. > Using log file /var/lib/oprofile//samples/oprofiled.log > Daemon started. > Profiler running. > [brucehuang@rat013:/var/lib/oprofile/samples]$ sudo opcontrol --dump > [brucehuang@rat013:/var/lib/oprofile/samples]$ ls -ltr > /var/lib/oprofile/samples/ > total 16 > drwxr-xr-x 3 root root 4096 Jun 23 14:14 aaa > drwxr-xr-x 4 root root 4096 Jun 25 10:40 tmp > drwxr-xr-x 4 root root 4096 Jun 25 10:55 current > -rwxrwxrwx 1 root root 67 Jun 25 10:56 oprofiled.log > [brucehuang@rat013:/var/lib/oprofile/samples]$ ls current/ > stats > [brucehuang@rat013:/var/lib/oprofile/samples]$ sudo opcontrol --status > Daemon running: pid 7646 > Event 0: CPU_CLK_UNHALTED:500000:0:1:1 > Separate options: library > vmlinux file: none > Image filter: none > Call-graph depth: 0 > [brucehuang@rat013:/var/lib/oprofile/samples]$ opreport --verbose=all > > Overflow stats not available > Archive: > Matched sample files: 0 > profile_classes: > event: > cpuinfo: > > error: no sample files found: profile specification too strict ? > [brucehuang@rat013:/var/lib/oprofile/samples]$ sudo opcontrol --shutdown > Stopping profiling. > Killing daemon. > [brucehuang@rat013:/var/lib/oprofile/samples]$ more > /var/lib/oprofile/samples/oprofiled.log > > oprofiled started Fri Jun 25 10:56:03 2010 > kernel pointer size: 4 > > Fri Jun 25 10:59:15 2010 > > > -- OProfile Statistics -- > Nr. sample dumps: 6 > Nr. non-backtrace samples: 45735 > Nr. kernel samples: 19807 > Nr. lost samples (no kernel/user): 0 > Nr. lost kernel samples: 0 > Nr. incomplete code structs: 0 > Nr. samples lost due to sample file open failure: 0 > Nr. samples lost due to no permanent mapping: 169 > Nr. event lost due to buffer overflow: 0 > Nr. samples lost due to no mapping: 37 > Nr. backtraces skipped due to no file mapping: 0 > Nr. samples lost due to no mm: 551 > > ---- Statistics for cpu : 1 > Nr. samples lost cpu buffer overflow: 0 > Nr. samples received: 51942 > Nr. backtrace aborted: 0 > > ---- Statistics for cpu : 0 > Nr. samples lost cpu buffer overflow: 0 > Nr. samples received: 35983 > Nr. backtrace aborted: 0 > oprofiled stopped Fri Jun 25 10:59:15 2010 > > From oprofiled.log, we can see it have achieved to get samples information > successfully,but it does not work when using "opreport", why? > > I am very confused by this issue. Any help is appreciated. > > Thanks! > Bruce > > > > Maynard Johnson wrote: >> >> On 06/24/2010 5:22 AM, BruceSong wrote: >>> >>> Hi Maynard, >>> >>> I find some information in internet, and recompile the oprofile using >>> the >>> latest binutils package, especially with the latest libbfd.a. Now it >>> works. >>> >>> But sometimes, when I do some attempt, such as: >>> sudo opcontrol --event=CPU_CLK_UNHALTED:100000:0:1:1, or other >>> configuration. And then using opreport, it does not work. >>> >>> For example: >>> [brucehuang@rat013:~]$ sudo opcontrol --init >>> >>> [brucehuang@rat013:~]$ sudo opcontrol --status >>> Daemon not running >>> Event 0: CPU_CLK_UNHALTED:100000:0:1:1 >>> Separate options: library >>> vmlinux file: none >>> Image filter: none >>> Call-graph depth: 4 >>> [brucehuang@rat013:~]$ sudo opcontrol --start --verbose >> >> Do *NOT* use '--verbose' for normal profile runs. Use it *ONLY* for >> debugging >> problems. This adds a tremendous amount of overhead to the oprofile >> daemon, >> almost ensuring you'll get the "WARNING! The OProfile kernel driver >> reports >> sample buffer overflows" message. >> >>> Parameters used: >>> SESSION_DIR /var/lib/oprofile >>> LOCK_FILE /var/lib/oprofile/lock >>> SAMPLES_DIR /var/lib/oprofile/samples >>> CURRENT_SAMPLES_DIR /var/lib/oprofile/samples/current >>> CPUTYPE i386/core_2 >>> BUF_SIZE default value >>> BUF_WATERSHED default value >>> CPU_BUF_SIZE default value >>> SEPARATE_LIB 1 >>> SEPARATE_KERNEL 0 >>> SEPARATE_THREAD 0 >>> SEPARATE_CPU 0 >>> CALLGRAPH 4 >> >> Doing callgraph profiling also adds a lot of overhead, both in kernel and >> userspace. Whereas your sampling interval of one sample per 100,000 >> CPU_CLK_UNHALTED events might be fine ordinarily, I suspect that's a bit >> too >> much when you're also doing callgraph profiling. For profiling on >> cycles-based >> events (like CPU_CLK_UNHALTED), you can easily get a statistically valid >> profile >> by setting the count value pretty high--in your case, you can probably go >> up to >> 500,000. >> >> If you're collecting a profile where you just want to see hotspots and >> don't >> *need* to see callgraph data, then be sure to set --callgraph=0 to reduce >> or >> eliminate buffer overflows. >> >>> VMLINUX none >>> KERNEL_RANGE >>> XENIMAGE none >>> XEN_RANGE >>> executing oprofiled --session-dir=/var/lib/oprofile --separate-lib=1 >>> --separate-kernel=0 --separate-thread=0 --separate-cpu=0 >>> --events=CPU_CLK_UNHALTED:60:0:100000:0:1:1, --no-vmlinux --image=none >>> --verbose=all >>> Events: CPU_CLK_UNHALTED:60:0:100000:0:1:1, >>> Using 2.6+ OProfile kernel interface. >>> Using log file /var/lib/oprofile/samples/oprofiled.log >>> Daemon started. >>> Profiler running. >>> >>> [brucehuang@rat013:~]$ opreport --verbose=all >>> >>> >>> WARNING! The OProfile kernel driver reports sample buffer overflows. >>> Such overflows can result in incorrect sample attribution, invalid >>> sample >>> files and other symptoms. See the oprofiled.log for details. >>> You should adjust your sampling frequency to eliminate (or at least >>> minimize) >>> these overflows. >>> Archive: >>> Matched sample files: 0 >>> profile_classes: >>> event: >>> cpuinfo: >>> >>> error: no sample files found: profile specification too strict ? >>> >>> You can see that error happens, and also it shows one warning. So why >>> error >>> happens? And also i think sample frequency is not higher since i set >>> 100000 >>> count. What should be done for this warning? >> >> Try my suggestions above and see if you get some good reports. You ask >> what can >> be done about this warning? Coincidentally, I just helped write an >> article on >> this subject, which you can find at: >> https://www.ibm.com/developerworks/wikis/display/LinuxP/Handling+oprofile+sample+buffer+overflows >> >> Let me know if that article helps clarify how to respond to the buffer >> overflow >> message. >> >> -Maynard >>> >>> Thanks a lot! >>> Bruce >>> >> >> >> ------------------------------------------------------------------------------ >> ThinkGeek and WIRED's GeekDad team up for the Ultimate >> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the >> lucky parental unit. See the prize list and enter to win: >> http://p.sf.net/sfu/thinkgeek-promo >> _______________________________________________ >> oprofile-list mailing list >> opr...@li... >> https://lists.sourceforge.net/lists/listinfo/oprofile-list >> >> > > -- View this message in context: http://old.nabble.com/Error-happens-when-using-command-%22opreport--lc%22-tp28969440p28989473.html Sent from the oprofile-list mailing list archive at Nabble.com. |
From: Maynard J. <may...@us...> - 2010-06-25 14:54:01
|
BruceSong wrote: > > Hi Maynard, > > I retry according to your comments, but it still does not work. Please see > the following steps: > > [brucehuang@rat013:/var/lib/oprofile/samples]$ sudo opcontrol --init > [brucehuang@rat013:/var/lib/oprofile/samples]$ sudo opcontrol --reset > [brucehuang@rat013:/var/lib/oprofile/samples]$ echo >> /var/lib/oprofile/samples/oprofiled.log > [brucehuang@rat013:/var/lib/oprofile/samples]$ sudo opcontrol --start > Using 2.6+ OProfile kernel interface. > Using log file /var/lib/oprofile//samples/oprofiled.log > Daemon started. > Profiler running. > [brucehuang@rat013:/var/lib/oprofile/samples]$ sudo opcontrol --dump So, you're dumping out the samples right after doing --start? Doesn't seem like you've done anything to to get samples yet. Here are the steps for profiling: 1. opcontrol --init 2. opcontrol --reset 3. opcontrol --setup (e.g., set a vmlinux file, set the event(s) to profile -- this only needs to be done the first time, in case you want to run these steps again to collect another profile with same profiling parameters.) 4. opcontrol --start 5. Run your application, which needs to run long enough for some samples to be taken. 6. opcontrol --dump | --stop | --shutdown Any of these three options above will cause samples to be flushed to the file system. --dump: profiling continues --stop: profiling stops, but userspace daemon is still alive, thus, profiling can be quickly restarted with '--start' --shutdown: profiling stops AND userspace daemon is ended. If you want to change profiling parameters (like changing the event to profile on), you must shutdown the daemon and restart it with --start in order for it to pick up the new parameters. 7. opreport -Maynard > [brucehuang@rat013:/var/lib/oprofile/samples]$ ls -ltr > /var/lib/oprofile/samples/ > total 16 > drwxr-xr-x 3 root root 4096 Jun 23 14:14 aaa > drwxr-xr-x 4 root root 4096 Jun 25 10:40 tmp > drwxr-xr-x 4 root root 4096 Jun 25 10:55 current > -rwxrwxrwx 1 root root 67 Jun 25 10:56 oprofiled.log > [brucehuang@rat013:/var/lib/oprofile/samples]$ sudo opcontrol --status > Daemon running: pid 7646 > Event 0: CPU_CLK_UNHALTED:500000:0:1:1 > Separate options: library > vmlinux file: none > Image filter: none > Call-graph depth: 0 > [brucehuang@rat013:/var/lib/oprofile/samples]$ opreport --verbose=all > > > Overflow stats not available > Archive: > Matched sample files: 0 > profile_classes: > event: > cpuinfo: > > error: no sample files found: profile specification too strict ? > [brucehuang@rat013:/var/lib/oprofile/samples]$ sudo opcontrol --shutdown > Stopping profiling. > Killing daemon. > [brucehuang@rat013:/var/lib/oprofile/samples]$ more > /var/lib/oprofile/samples/oprofiled.log > > oprofiled started Fri Jun 25 10:56:03 2010 > kernel pointer size: 4 > > Fri Jun 25 10:59:15 2010 > > > -- OProfile Statistics -- > Nr. sample dumps: 6 > Nr. non-backtrace samples: 45735 > Nr. kernel samples: 19807 > Nr. lost samples (no kernel/user): 0 > Nr. lost kernel samples: 0 > Nr. incomplete code structs: 0 > Nr. samples lost due to sample file open failure: 0 > Nr. samples lost due to no permanent mapping: 169 > Nr. event lost due to buffer overflow: 0 > Nr. samples lost due to no mapping: 37 > Nr. backtraces skipped due to no file mapping: 0 > Nr. samples lost due to no mm: 551 > > ---- Statistics for cpu : 1 > Nr. samples lost cpu buffer overflow: 0 > Nr. samples received: 51942 > Nr. backtrace aborted: 0 > > ---- Statistics for cpu : 0 > Nr. samples lost cpu buffer overflow: 0 > Nr. samples received: 35983 > Nr. backtrace aborted: 0 > oprofiled stopped Fri Jun 25 10:59:15 2010 > >>From oprofiled.log, we can see it have achieved to get samples information > successfully, but it does not work when using "opreport", why? > > I am very confused by this issue. Any help is appreciated. > > Thanks! > Bruce > > > > Maynard Johnson wrote: >> >> On 06/24/2010 5:22 AM, BruceSong wrote: >>> >>> Hi Maynard, >>> >>> I find some information in internet, and recompile the oprofile using the >>> latest binutils package, especially with the latest libbfd.a. Now it >>> works. >>> >>> But sometimes, when I do some attempt, such as: >>> sudo opcontrol --event=CPU_CLK_UNHALTED:100000:0:1:1, or other >>> configuration. And then using opreport, it does not work. >>> >>> For example: >>> [brucehuang@rat013:~]$ sudo opcontrol --init >>> >>> [brucehuang@rat013:~]$ sudo opcontrol --status >>> Daemon not running >>> Event 0: CPU_CLK_UNHALTED:100000:0:1:1 >>> Separate options: library >>> vmlinux file: none >>> Image filter: none >>> Call-graph depth: 4 >>> [brucehuang@rat013:~]$ sudo opcontrol --start --verbose >> >> Do *NOT* use '--verbose' for normal profile runs. Use it *ONLY* for >> debugging >> problems. This adds a tremendous amount of overhead to the oprofile >> daemon, >> almost ensuring you'll get the "WARNING! The OProfile kernel driver >> reports >> sample buffer overflows" message. >> >>> Parameters used: >>> SESSION_DIR /var/lib/oprofile >>> LOCK_FILE /var/lib/oprofile/lock >>> SAMPLES_DIR /var/lib/oprofile/samples >>> CURRENT_SAMPLES_DIR /var/lib/oprofile/samples/current >>> CPUTYPE i386/core_2 >>> BUF_SIZE default value >>> BUF_WATERSHED default value >>> CPU_BUF_SIZE default value >>> SEPARATE_LIB 1 >>> SEPARATE_KERNEL 0 >>> SEPARATE_THREAD 0 >>> SEPARATE_CPU 0 >>> CALLGRAPH 4 >> >> Doing callgraph profiling also adds a lot of overhead, both in kernel and >> userspace. Whereas your sampling interval of one sample per 100,000 >> CPU_CLK_UNHALTED events might be fine ordinarily, I suspect that's a bit >> too >> much when you're also doing callgraph profiling. For profiling on >> cycles-based >> events (like CPU_CLK_UNHALTED), you can easily get a statistically valid >> profile >> by setting the count value pretty high--in your case, you can probably go >> up to >> 500,000. >> >> If you're collecting a profile where you just want to see hotspots and >> don't >> *need* to see callgraph data, then be sure to set --callgraph=0 to reduce >> or >> eliminate buffer overflows. >> >>> VMLINUX none >>> KERNEL_RANGE >>> XENIMAGE none >>> XEN_RANGE >>> executing oprofiled --session-dir=/var/lib/oprofile --separate-lib=1 >>> --separate-kernel=0 --separate-thread=0 --separate-cpu=0 >>> --events=CPU_CLK_UNHALTED:60:0:100000:0:1:1, --no-vmlinux --image=none >>> --verbose=all >>> Events: CPU_CLK_UNHALTED:60:0:100000:0:1:1, >>> Using 2.6+ OProfile kernel interface. >>> Using log file /var/lib/oprofile/samples/oprofiled.log >>> Daemon started. >>> Profiler running. >>> >>> [brucehuang@rat013:~]$ opreport --verbose=all >>> >>> >>> WARNING! The OProfile kernel driver reports sample buffer overflows. >>> Such overflows can result in incorrect sample attribution, invalid sample >>> files and other symptoms. See the oprofiled.log for details. >>> You should adjust your sampling frequency to eliminate (or at least >>> minimize) >>> these overflows. >>> Archive: >>> Matched sample files: 0 >>> profile_classes: >>> event: >>> cpuinfo: >>> >>> error: no sample files found: profile specification too strict ? >>> >>> You can see that error happens, and also it shows one warning. So why >>> error >>> happens? And also i think sample frequency is not higher since i set >>> 100000 >>> count. What should be done for this warning? >> >> Try my suggestions above and see if you get some good reports. You ask >> what can >> be done about this warning? Coincidentally, I just helped write an >> article on >> this subject, which you can find at: >> https://www.ibm.com/developerworks/wikis/display/LinuxP/Handling+oprofile+sample+buffer+overflows >> >> Let me know if that article helps clarify how to respond to the buffer >> overflow >> message. >> >> -Maynard >>> >>> Thanks a lot! >>> Bruce >>> >> >> >> ------------------------------------------------------------------------------ >> ThinkGeek and WIRED's GeekDad team up for the Ultimate >> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the >> lucky parental unit. See the prize list and enter to win: >> http://p.sf.net/sfu/thinkgeek-promo >> _______________________________________________ >> oprofile-list mailing list >> opr...@li... >> https://lists.sourceforge.net/lists/listinfo/oprofile-list >> >> > |
From: BruceSong <bru...@gm...> - 2010-06-26 13:27:11
|
Hi Maynard, Yes, I execute the commands as you said. But sometimes it does not work. And if I first remove the file /root/.oprofile/de, then run again, it works. As I wrote in above note, now I have the following questions. -- View this message in context: http://old.nabble.com/Error-happens-when-using-command-%22opreport--lc%22-tp28969440p29000384.html Sent from the oprofile-list mailing list archive at Nabble.com. |
From: Maynard J. <may...@us...> - 2010-06-28 14:57:32
|
On 06/26/2010 8:27 AM, BruceSong wrote: > > Hi Maynard, > > Yes, I execute the commands as you said. But sometimes it does not work. And > if I first remove the file /root/.oprofile/de, then run again, it works. As There is no such oprofile file called "/root/.oprofile/de", but I presume you mean "/root/.oprofile/daemonrc". The daemonrc file is used to cache your profiling parameters that you set up via 'opcontrol' command. If you get what appear to be bogus results sometimes and that removing this file and starting over makes things right, this tells me you're probably not using the commands correctly. One thing I noted from a previous posting of yours . . . I saw "--image=none" being passed to the oprofile daemon, which you only see if you are specifying "--image=none" on the opcontrol command. This implies to me you've probably been using this option at other times to set the image filter to some real binary. While this is perfectly fine to do if you know what its effect is, I suggest you don't use this option. The reason is that image filter is cached. So the next time you try to profile some binary other than the one you previously had set the "--image=" option with, oprofile will quietly refuse to store any samples for it. Thus, when you run opreport, you get "error: no sample files found: profile specification too strict ?" You can override the cached image filter value by passing "--image=none" or by removing the daemonrc file and starting over, as you say you've done. You can do filtering in the post-processing phase by using the following technique: 'opreport --symbols <app_name>' -Maynard > I wrote in above note, now I have the following questions. > > > |