https://perf.wiki.kernel.org/index.php?title=Jolsa_Docs_Annotations&feed=atom&action=historyJolsa Docs Annotations - Revision history2024-03-29T12:29:45ZRevision history for this page on the wikiMediaWiki 1.19.24https://perf.wiki.kernel.org/index.php?title=Jolsa_Docs_Annotations&diff=3238&oldid=prevJolsa at 18:55, 9 July 20132013-07-09T18:55:57Z<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 18:55, 9 July 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 14:</td>
<td colspan="2" class="diff-lineno">Line 14:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>see annotations in '''perf'''.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>see annotations in '''perf'''.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="background: #ffa; color:black; font-size: smaller;"><div>== WORKAROUND ==</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">=</ins>== WORKAROUND <ins class="diffchange diffchange-inline">=</ins>==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>There's a following workaround, that merges debuginfo back to the</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>There's a following workaround, that merges debuginfo back to the</div></td></tr>
</table>Jolsahttps://perf.wiki.kernel.org/index.php?title=Jolsa_Docs_Annotations&diff=3237&oldid=prevJolsa: Created page with "== ANNOTATIONS == TODO: description & examples The perf annotations is based on '''objdump''' tool from binutils package. == BINUTILS RESTRICTIONS == Annotations are based..."2013-07-09T18:55:18Z<p>Created page with "== ANNOTATIONS == TODO: description & examples The perf annotations is based on '''objdump''' tool from binutils package. == BINUTILS RESTRICTIONS == Annotations are based..."</p>
<p><b>New page</b></p><div>== ANNOTATIONS ==<br />
<br />
TODO: description & examples<br />
<br />
The perf annotations is based on '''objdump''' tool from binutils package.<br />
<br />
== BINUTILS RESTRICTIONS ==<br />
<br />
Annotations are based on debuginfo, which on most (Fedora) distributions<br />
come in separated *-debuginfo packages. Unfortunately '''objdump''' does not<br />
connect binaries with its debuginfo counterparts.<br />
<br />
The result is that for binaries with separated debuginfo you'll not<br />
see annotations in '''perf'''.<br />
<br />
== WORKAROUND ==<br />
<br />
There's a following workaround, that merges debuginfo back to the<br />
binary. Such binary will display proper annotations in perf.<br />
<br />
The binary we want to annotate properly is '''ls'''.<br />
* find out the debuginfo holder:<br />
<pre><br />
$ rpm -ql coreutils-debuginfo | grep ls.debug<br />
/usr/lib/debug/usr/bin/ls.debug<br />
</pre><br />
<br />
* '''OPTIONAL''' if your distribution uses prelink, you need to undo it:<br />
<pre><br />
$ cp /bin/ls .<br />
$ prelink -u ls<br />
</pre><br />
<br />
* create the '''ls-di''' binary with debuginfo merged:<br />
<pre><br />
$ eu-unstrip -o ls-di ./ls /usr/lib/debug/usr/bin/ls.debug<br />
$ file ls-di<br />
ls-di: ELF 64-bit LSB executable, x86-64, version 1 (SYSV) [SNIP] not stripped<br />
</pre><br />
<br />
* clean the build-id cache, since the '''ls''' share same build-id with '''ls-di''':<br />
<pre><br />
$ perf buildid-cache -r ls<br />
# or more efectively:<br />
$ rm -rf ~/.debug/<br />
</pre><br />
<br />
* enjoy your annotations via:<br />
<pre><br />
$ perf record ./ls-di [SNIP]<br />
$ perf annotate [FUNC]<br />
$ perf report<br />
</pre></div>Jolsa