Howdy,

You can annotate from within the perf report itself. What you have to do is
to take the perf record output. That will create a perf.data file. Now, run
perf archive. This will create a tarball.

Next, on the analyzing system (considering the output taken previously
needs to be examined on another system), copy over both the files. And then
as non-root run,

tar -zxvf filename.tar.bz2 ~/.debug

What this will do is that the unique build-ids corresponding to each ELF
image in the first system will be copied over to the new system (not
replacing but just plain copying for the purpose of analysis).

Now you run perf report on it and from inside of it, run annotate. It does
not need to be on the same kernel version or rather even, same hardware
architecture. It will run on whatever is there, x86_64, ARM, s390 etc.

Soham


On Sat, Dec 7, 2013 at 10:48 AM, Abu Rasheda <rcpilot2...@gmail.com> wrote:

> I figure out, it quite simple. Writing steps here, so it may be useful
> for someone in future.
>
> perf record -a
> ctrl-C when done collecting data
> copy kernel_module.ko to
> /lib/modules/2.6.32-71.el6.x86_64/kernel/net/ipv4/kernel_module.ko
> perf annotate function_name_in_kernel_module
>
> Since you compiled kernel module on this machine, perf can get path
> from the binary and locate the source. enjoy.
>
> On Fri, Dec 6, 2013 at 7:14 PM, Abu Rasheda <rcpilot2...@gmail.com> wrote:
> > Guys,
> >
> > I want to annotate Linux kernel module with c-source using perf tool.
> > Is it possible ? can someone points me to the instructions how to do
> > this ?
> >
> > Thanks
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to