Hi Maynard,

Thanks again for your help. A few items:

1. Separate -- You're right, i had --separate=all. I've modified it to what you recommend (--separate=lib,kernel). Now i no longer need the --merge tgid

2. Image Path -- I tried using --image-path=/lib/modules/`uname -r` and then did "lsmod" to see which modules were running. Running the opreport command searching for one of the modules (say, "ipv6") seem to return nothing. When i tried --image-path=/lib/modules/`uname -r`/kernel, then it would return something like:

samples  %        image name               symbol name
1        100.000  ipv6.ko                  fib6_walk

Does this mean i should use the /kernel ? Might be because i'm on Centos 6.3?

3. VMLinux -- When i ran the opcontrol command, i used the --vmlinux= command to specify a vmlinux file. This file was generated before i compiled and installed the custom kernel module (i did not build the module inside the 3.2 kernel source tree.. nor did i "add" it to the kernel .config or build system). I'm wondering if this is perhaps the cause of not being able to "see" my kernel module (i.e., the "old" vmlinux doesn't have the correct symbols to process this?). In this case, would running it with --no-vmlinux, and then running the "opsymbols.rb" ruby script (which i think looks at /proc/kallsyms for symbols) find my custom kernel module? When i "cat /proc/kallsyms", my custom kernel module is listed with all the symbols.

If its better just to recompile vmlinux, do you happen to know any good links/tutorials on how to "add" new custom modules to the kernel build system? 



On Sat, Apr 6, 2013 at 12:08 PM, Maynard Johnson <maynardj@us.ibm.com> wrote:
On 04/05/2013 08:36 PM, Bow-Nan Cheng wrote:
> Hello,
> I'm attempting to use opcontrol to profile a custom kernel module (let's call it "mymodule"). When i do "lsmod | grep mymodule", it shows up in the list.
> However, when i dump the oprofile stats and try to look for it under opreport, i can't seem to find it even if i'm exercising the module pretty extensively.
> opcontrol --dump
> opreport --symbols mymodule --image-path=/lib/modules/3.2.32/kernel/ --merge tgid --demangle=smart

Your --image-path specification isn't correct.  Just use '--image-path=/lib/modules/`uname -r`.

When you did the opcontrol setup steps, what did you specify for the "--separate" option?  For "normal" use, I recommend --separate=lib,kernel.  I see in your opreport command you're using '--merge tgid', so I presume you're either using '--separate=all' or explicitly specifying 'thread'.  Typically, it's not necessary to collect thread-level profile data unless you have multiple processes or threads running the same application and you wish to separate out the samples for each thread.

> Using /var/lib/oprofile/samples/ for samples directory.
> error: no sample files found: profile specification too strict ?
> Is there something special i need to do to enable profiling custom kernel modules? Perhaps i'm missing a step when i actually "install" the module.
> i just do "make" and "make install" and verify that its been copied over to my /lib/modules/3.2.32/kernel folder. I then do a "depmod -a".
> When i load the module, i use modprobe mymodule
> Any help would be greatly appreciated. Thanks!!
> -Bow-Nan
> ------------------------------------------------------------------------------
> Minimize network downtime and maximize team effectiveness.
> Reduce network management and security costs.Learn how to hire
> the most talented Cisco Certified professionals. Visit the
> Employer Resources Portal
> http://www.cisco.com/web/learning/employer_resources/index.html
> _______________________________________________
> oprofile-list mailing list
> oprofile-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oprofile-list