Hi all.<br><br>I'm running oprofile on a ppc 603 (in timer mode) and believe I'm getting reports on samples for the wrong symbol/function. <br><br>When running opreport for a specific network module (MyEth), I get a number of samples reported in a function (below: MyCos_Init) used when loading the module. This occurs for every test (iperf), although I reset the profiling data in between I do not reload the module for each run, so there should be no reason for the opreport to report samples for this function. I've also instrumented the module, to verify that i do not call the MyCos_Init repeatedly (in fact it is not called at all after I've loaded it)<br>
<br>The report looks like this..<br>
<br>>~# opreport -l -p /lib/modules/ MyEth<br>Overflow stats not available<br>CPU: CPU with timer interrupt, speed 0 MHz (estimated)<br>Profiling through timer interrupt<br>warning: could not check that the binary file /lib/modules/MyEth has not been modified since the profile was taken. Results may be inaccurate.<br>
samples % symbol name<br>228 39.3782 MyEth_TxThread<br>219 37.8238 MyEth_TxDone<br>83 14.3351 MyCos_Init<br>49 8.4629 MyEth_start_xmit<br><br><br>Looking at a more detailed report (with "-d" option in opreport), I see where the samples for the function MyCos_Init are taken (from address 230c to 238c). MyCos_Init is located at 1e3c.<br>
<br>00001e3c 83 14.3351 MyCos_Init<br> 0000230c 9 10.8434<br> 00002318 5 6.0241<br> 0000231c 1 1.2048<br> 00002324 9 10.8434<br> 00002338 21 25.3012<br> 0000233c 2 2.4096<br>
00002344 10 12.0482<br> 0000237c 14 16.8675<br> 00002384 10 12.0482<br> 0000238c 2 2.4096<br><br>Running "nm -n /lib/modules/MyEth" to list symbols (sorted), I find the MyCos_Init at the bottom of the list (Last function / higest address). Is Oprofile just <br>
reporting defaulting to the last symbol if it can find any reasonable symbol/function?<br><br>If I then look in "/proc/kallsyms" I find where the function is located, and see there are functions below it belonging to my module. The <br>
list shows me that the function MyCos_Init takes 3E8 address..<br><br>c9088e3c t MyCos_Init [MyEth]<br>c9089224 t MyEth_p_cleanup [MyEth]<br>c90892a4 t MyEth_exit [MyEth]<br>c90892a4 t cleanup_module [MyEth]<br>
c9089e58 r __func__.0 [MyEth]<br>c9089e60 r __func__.1 [MyEth]<br><br>Then finally. Adding 3E8 (size allocated for function in kernel) to the address found from "opreport" /"nm" for the MyCos_Init function ( 0x00001e3c) I get 0x00002224. <br>
So the reported samples from opreport is after the addresses for this function. So is oprofile reporting samples for a wrong function or what? Or I'm I doing something wrong?<br><br>Thanks for any assistance.<br><br>Best Regards<br>
<br>Preben<br>
<br><br>