From: <job...@ao...> - 2009-11-19 00:11:12
|
Sent from my iPhone 3G On Nov 18, 2009, at 4:00 PM, Maynard Johnson <may...@us...> wrote: > job...@ao... wrote: >> On Nov 18, 2009, at 10:08 AM, Maynard Johnson <may...@us...> >> wrote: >> >>> job...@ao... wrote: >>>> On Nov 17, 2009, at 9:23 AM, job...@ao... wrote: >>>> >>>>> By looking at EIP values, I can see that samples are being >>>>> collected >>>>> for my test module. In the function get_file in daemon/ >>>>> opd_sfile.c >>>>> which is called after issuing the opcontrol --shutdown command, I >>>>> can see trans->pc values that correspond to the EIP values of >>>>> samples collected for my test module but no new sample file is >>>>> created for these samples. >>>>> >>>>> Since I can see the samples are there for my test module, why >>>>> isn't >>>>> a sample file created for the test module samples? >>>> When get_file is called for the samples for my test module, the >>>> file >>>> it gets is /var/lib/oprofile/samples//current/{kern}/no-vmlinux/ >>>> {dep}/ >>>> {kern}/no-vmlinux/TIMER.0.0.all.all.all, which has a nonzero count. >>>> Thus, no sample file is created for my test module. >>>> >>>> Why would samples for my test module result in getting the sample >>>> file >>>> for no-vmlinux? >>> Back on Nov 10, Jose Santos correctly told you that using the --no- >>> vmlinux option will not work if you want to see samples for kernel >>> modules. When you use that option, oprofile throws all kernel >>> samples (whether from base kernel or kernel modules) into the no- >>> vmlinux sample file. >>> >>> -Maynard >> >> Thank you for the clarification. Here are the commands I am now >> using >> after the system boots up: >> >> Eclipse # rm -rf /var/lib/oprofile/ >> Eclipse # mkdir /var/lib/oprofile/ >> Eclipse # mount -t ramfs non /var/lib/oprofile/ >> Eclipse # rm /root/.oprofile/daemonrc >> Eclipse # rm /var/log/messages >> Eclipse # insmod oprofile.ko >> Eclipse # insmod helloworld.ko >> Eclipse # /usr/bin/opcontrol --setup --kernel- >> range=0xC0000000,0xC9500000 --vml >> inux=/root/vmlinux.PRO_MOD >> Eclipse # /usr/bin/opcontrol --start >> Using 2.6+ OProfile kernel interface. >> Reading module info. >> Using log file /var/lib/oprofile/samples/oprofiled.log >> Daemon started. >> Profiler running. >> Eclipse # /usr/bin/opcontrol --shutdown >> Stopping profiling. >> Killing daemon. >> Eclipse # /usr/bin/opreport --image-path=/root >> CPU: CPU with timer interrupt, speed 0 MHz (estimated) >> Profiling through timer interrupt >> TIMER:0| >> samples| %| >> ------------------ >> 9373 93.0600 vmlinux.PRO_MOD >> 587 5.8280 libc-2.6.so >> 39 0.3872 oprofiled >> 27 0.2681EclipseMSW.elf.NOV8 >> 23 0.2284 busybox-1.15.2.mtab >> 19 0.1886 ld-2.6.so >> 3 0.0298 snmpd >> 1 0.0099 gateway >> >> >> >> Using printf's, I can see in get_file that for the first sample (and >> all subsequent samples) with a trans->pc value that corresponds to >> helloworld (e.g., 0xC907C0DC, helloworld start=0xC907C000 >> end=0xC907C5a0), odb_open_count(file) returns 1. Since >> odb_open_count > > hmmm . . . from the addresses you state above for where your kernel > module resides, it seems you are incorrectly specifying the --kernel- > range value. That value should *only* be for the base kernel. On > most platforms, you don't need to specify this value at all -- > opcontrol will automagically figure it out. > > -Maynard You are correct. The end of the .text section should be 0xC02633B0. I now see my sample module in the report. Thank you. > >> (file) returns 1, no new sample file is created for helloworld.ko. >> The value of odb->data->filename in odb_open_count is /var/lib/ >> oprofile/samples//current/{root}//root/vmlinux.PRO_MOD/{dep}/{root}// >> root/vmlinux.PRO_MOD/TIMER.0.0.all.all.all. Thus, the samples for >> helloworld.ko are put into the sample file for vmlinux.PRO_MOD. >> >> Should odb_open_count(file) return 1 when odb_open_count(file) is >> called for the first time for a sample from helloworld.ko? Shouldn't >> odb->data be NULL the first time a sample is processed for >> helloworld.ko so that a sample file for helloworld.ko is created? >> >> >>>>> On Nov 12, 2009, at 3:42 PM, job...@ao... wrote: >>>>> >>>>>> Could the fact that I am following the instructions below be an >>>>>> issue as far as sampling inserted kernel modules? Of course, >>>>>> samples for other than the kernel modules seem to be stored just >>>>>> fine. >>>>>> If running from an image in the internal jffs2 file system, you >>>>>> will need to mount another file system to store the samples. >>>>>> Below >>>>>> are examples of the commands to set that up. You will need to >>>>>> modify for local conditions. >>>>>> mkdir /var/lib/oprofile >>>>>> mount -t ramfs none /var/lib/oprofile >>>>>> >>>>>> = >>>>> = >> > |