From: Maynard J. <may...@us...> - 2013-05-03 13:18:14
|
On 05/02/2013 08:34 PM, RocChen wrote: > Yes, I execute a 'opcontrol --deinit' after every iteration of the command sequence. > > Above all, I must thank to the warmhearted people here for helping me to get the expected profiling results with oprofile. > > Currently, the only problem for me seems to be that it sometimes gives the profiling results with thousands or more samples for the user application functions, libaries and the no-vmlinux (I call it 'nice results'), but some other times it only gives several tens of samples totally ('bad results'). > Besides, it seems to have no issue with the '--image' parameter for this problem. The profiling results are sometimes 'nice' or somtimes 'bad' or even sometimes reporting no samples no matter I set the parameter '--image=all' or '--image=<application name>' or just leave it out. *Will*, is it possible the ARM oprofile kernel driver (or perf_events subsystem) had a bug in kernel 3.3 involving PMU hardware reservation and/or resource release? A couple years ago, when perf_events was first being introduced, I recall seeing a similar symptom, where oprofile would simply stop getting PMU interrupts, and it had to do with some incorrect handshaking between oprofile and perf_events. -Maynard > Same opcontrol command sequence (the sample event may be different on different CPUs, for example, I use the 'global_power_events:6000' event on the i386/p4-ht CPU) and applications on my PCs (x86 platform) work very well and always give the nice profiling results. > > On Mon, Apr 29, 2013 at 10:08 PM, Maynard Johnson <may...@us... <mailto:may...@us...>> wrote: > > On 04/27/2013 03:44 AM, RocChen wrote: > > Thank you for your enthusiastic guidance, sir: > > > > I could get nice profiling results with the command list. (but with another issue I can not understand, described below) > > > > Command List: > >> rm -rf /var/lib/oprofile > >> rm -rf /root/.oprofile > >> opcontrol --init > >> opcontrol --no-vmlinux > >> opcontrol --setup --event=CPU_CYCLES:10000 --separate=lib,kernel > >> opcontrol --start --image=all > >> ./array > >> ./../mpeg2dec/oprofile_results/mpeg2dec -b ../mpeg2dec/input_base/input_base_4CIF_96bps.mpg -o3 output_base_4CIF_96bps_%03d > >> opcontrol --dump > >> opreport -l array > >> opreport -l ./../mpeg2dec/oprofile_results/mpeg2dec > > > > Nice Results: > > [root]$ opreport -l array > > Using /var/lib/oprofile/samples/ for samples directory. > > warning: /no-vmlinux could not be found. > > CPU: ARM Cortex-A9, speed 1998 MHz (estimated) > > Counted CPU_CYCLES events (CPU cycle) with a unit mask of 0x00 (No unit mask) count 10000 > > samples % image name symbol name > > 70547 95.8858 array slow_multiply > > 1181 1.6052 array fast_multiply > > 983 1.3361 array main > > 828 1.1254 no-vmlinux /no-vmlinux > > 29 0.0394 ld-2.13.so <http://ld-2.13.so> <http://ld-2.13.so> /lib/arm-linux-gnueabi/ld-2.13.so <http://ld-2.13.so> <http://ld-2.13.so> > > 6 0.0082 libc-2.13.so <http://libc-2.13.so> <http://libc-2.13.so> /lib/arm-linux-gnueabi/libc-2.13.so <http://libc-2.13.so> <http://libc-2.13.so> > > [root]$ opreport -l mpeg2decode > > Using /var/lib/oprofile/samples/ for samples directory. > > warning: /no-vmlinux could not be found. > > CPU: ARM Cortex-A9, speed 1998 MHz (estimated) > > Counted CPU_CYCLES events (CPU cycle) with a unit mask of 0x00 (No unit mask) count 10000 > > samples % image name symbol name > > 23899 16.9694 mpeg2decode conv420to422 > > 23648 16.7912 mpeg2decode store_ppm_tga > > 16695 11.8542 mpeg2decode conv422to444 > > 16072 11.4119 mpeg2decode Decode_Picture > > 15934 11.3139 mpeg2decode Fast_IDCT > > 15133 10.7451 no-vmlinux /no-vmlinux > > 14614 10.3766 mpeg2decode putbyte > > 9260 6.5750 mpeg2decode form_component_prediction > > 1631 1.1581 mpeg2decode Flush_Buffer > > 825 0.5858 mpeg2decode Decode_MPEG2_Intra_Block > > 481 0.3415 mpeg2decode form_prediction.constprop.0 > > 415 0.2947 mpeg2decode Decode_MPEG2_Non_Intra_Block > > 304 0.2159 mpeg2decode Get_Bits > > 200 0.1420 mpeg2decode Show_Bits > > 195 0.1385 mpeg2decode macroblock_modes > > ........ > > > > (*) However, there is an issue that I can hardly understand: after I repeated the commands list above several times (with the same event and sample rate, just exactly the same command sequences), it may give the different results, the total sample numbers are only several tens and no samples for user application functions. > > From the sequence of commands listed above, I don't see that you ever issue any commands to stop, shutdown or deinit oprofile. If you simply leave oprofile running and issue another opcontrol --start' command, that should basically be a NOP, so I'm not aware of any oprofile userspace issues with what you're doing. Have you tried any of the '--stop', '--shutdown', or '--deinit' options between profiling runs? > > -Maynard > > > > In my thought, the profiling shoud be at least similar to above nice results. > > > > Bad results: > > [root]$ opreport -l array > > Using /var/lib/oprofile/samples/ for samples directory. > > warning: /no-vmlinux could not be found. > > CPU: ARM Cortex-A9, speed 1998 MHz (estimated) > > Counted CPU_CYCLES events (CPU cycle) with a unit mask of 0x00 (No unit mask) count 10000 > > samples % image name symbol name > > 63 92.6471 no-vmlinux /no-vmlinux > > 5 7.3529 libc-2.13.so <http://libc-2.13.so> <http://libc-2.13.so> /lib/arm-linux-gnueabi/libc-2.13.so <http://libc-2.13.so> <http://libc-2.13.so> > > (0)-(linaro-chenp)-[Sat Apr 27][15:06:36]-[.=~/Workspace/Zynq/testbench-zynq/hotcode-profiling/mediabench2_video/workspace] > > [root]$ opreport -l mpeg2decode > > Using /var/lib/oprofile/samples/ for samples directory. > > warning: /no-vmlinux could not be found. > > CPU: ARM Cortex-A9, speed 1998 MHz (estimated) > > Counted CPU_CYCLES events (CPU cycle) with a unit mask of 0x00 (No unit mask) count 10000 > > samples % image name symbol name > > 69 95.8333 no-vmlinux /no-vmlinux > > 3 4.1667 libc-2.13.so <http://libc-2.13.so> <http://libc-2.13.so> /lib/arm-linux-gnueabi/libc-2.13.so <http://libc-2.13.so> <http://libc-2.13.so> > > > > |