<div dir="ltr"><div><div><div><div><div><div>Howdy,<br><br></div>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. <br>
<br></div>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,<br><br></div>tar -zxvf filename.tar.bz2 ~/.debug<br>
<br></div>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). <br><br>
</div>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.<br>
<br></div>Soham<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Dec 7, 2013 at 10:48 AM, Abu Rasheda <span dir="ltr">&lt;<a href="mailto:rcpilot2010@gmail.com" target="_blank">rcpilot2010@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I figure out, it quite simple. Writing steps here, so it may be useful<br>
for someone in future.<br>
<br>
perf record -a<br>
ctrl-C when done collecting data<br>
copy kernel_module.ko to<br>
/lib/modules/2.6.32-71.el6.x86_64/kernel/net/ipv4/kernel_module.ko<br>
perf annotate function_name_in_kernel_module<br>
<br>
Since you compiled kernel module on this machine, perf can get path<br>
from the binary and locate the source. enjoy.<br>
<div class="HOEnZb"><div class="h5"><br>
On Fri, Dec 6, 2013 at 7:14 PM, Abu Rasheda &lt;<a href="mailto:rcpilot2010@gmail.com">rcpilot2010@gmail.com</a>&gt; wrote:<br>
&gt; Guys,<br>
&gt;<br>
&gt; I want to annotate Linux kernel module with c-source using perf tool.<br>
&gt; Is it possible ? can someone points me to the instructions how to do<br>
&gt; this ?<br>
&gt;<br>
&gt; Thanks<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</div></div></blockquote></div><br></div></div>