<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/perf/util/annotate.c, branch v3.4.33</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/tools/perf/util/annotate.c?h=v3.4.33</id>
<link rel='self' href='https://git.amat.us/linux/atom/tools/perf/util/annotate.c?h=v3.4.33'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-04-05T22:51:14Z</updated>
<entry>
<title>perf annotate: Validate addr in symbol__inc_addr_samples</title>
<updated>2012-04-05T22:51:14Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@redhat.com</email>
</author>
<published>2012-03-27T15:55:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=31d68e7b66f168e623902e194af1e52b8cf75d71'/>
<id>urn:sha1:31d68e7b66f168e623902e194af1e52b8cf75d71</id>
<content type='text'>
This routine was checking only if the provided address was after
sym-&gt;end, not if it was before sym-&gt;start.

Fix that by checking for both and return in both cases -ERANGE, so that
tools can communicate this to the user properly, or if they chose so, to
abort.

This problem was reported previously but the fixes involved either doing
what was being done for the &gt; end case, i.e. silently drop the sample,
returning 0, or aborting at this function, which is in a lib (or better,
is slated to be at some point) and shouldn't abort.

The 'report' tool already checks this value and uses pr_debug to warn
the user.

This patch makes the 'top' tool check it too and warn once per map where
such range problem takes place.

Reported-by: David Miller &lt;davem@davemloft.net&gt;
Reported-by: Sorin Dumitru &lt;dumitru.sorin87@gmail.com&gt;
Reported-by: Stephane Eranian &lt;eranian@google.com&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/n/tip-lw8gs7p9i9nhldilo82tzpne@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf annotate: Fix hist decay</title>
<updated>2012-04-05T21:49:18Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@redhat.com</email>
</author>
<published>2012-04-05T19:15:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8b84a568117fde9b77575f2060274eddab424c32'/>
<id>urn:sha1:8b84a568117fde9b77575f2060274eddab424c32</id>
<content type='text'>
We were only decaying the entries for the offsets that were associated
with an objdump line.

That way, when we accrued the whole instruction addr range, more than
100% was appearing in some cases in the live annotation TUI.

Fix it by not traversing the source code line at all, just iterate thru
the complete addr range decaying each one.

Reported-by: Mike Galbraith &lt;mgalbraith@suse.de&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Namhyung Kim &lt;namhyung@gmail.com&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Link: http://lkml.kernel.org/n/tip-hcae5oxa22syjrnalsxz7s6n@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf annotate: Fix off by one symbol hist size allocation and hit accounting</title>
<updated>2012-03-29T20:13:45Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@redhat.com</email>
</author>
<published>2012-03-28T15:49:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=64c17be4ffb8d6971051aec77ca1de4cfadb166d'/>
<id>urn:sha1:64c17be4ffb8d6971051aec77ca1de4cfadb166d</id>
<content type='text'>
We were not noticing it because symbol__inc_addr_samples was erroneously
dropping samples that hit the last byte in a function.

Working on a fix for a problem reported by David Miller, Stephane
Eranian and Sorin Dumitru, where addresses &lt; sym-&gt;start were causing
problems, I noticed this other problem.

Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Sorin Dumitru &lt;dumitru.sorin87@gmail.com&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Link: http://lkml.kernel.org/n/tip-pqjaq4cr1xs2xen73pjhbav4@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf annotate: addr2line wants addresses in same format as objdump</title>
<updated>2012-03-28T15:06:24Z</updated>
<author>
<name>David Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2012-03-25T20:28:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f40a06339fe6f4809b5851a74aae2c0dc4386e1b'/>
<id>urn:sha1:f40a06339fe6f4809b5851a74aae2c0dc4386e1b</id>
<content type='text'>
Therefore, in symbol__get_source_line(), use map__rip_2objdump
instead of calling map-&gt;unmap_ip() unconditionally.

Link: http://lkml.kernel.org/r/20120325.162812.59519424882536855.davem@davemloft.net
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf annotate: Add missing newline on error message</title>
<updated>2012-03-05T13:15:50Z</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung.kim@lge.com</email>
</author>
<published>2012-02-23T08:46:24Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ff2a6617c2acd6a8dc468c90ab8708a6ad112bb0'/>
<id>urn:sha1:ff2a6617c2acd6a8dc468c90ab8708a6ad112bb0</id>
<content type='text'>
If perf.data couldn't find vmlinux image for the given build-id,
it would print error message. However it lacked a newline at the
end, so the output looked like below:

 $ perf annotate --stdio
 No vmlinux file with build id 63b554b2e90f14a4bced200008865e757d3e8b36
 was found in the path.

 Please use:

   perf buildid-cache -av vmlinux

 or:

   --vmlinux vmlinux Percent |   Source code &amp; Disassembly of a.out
 ------------------------------------------------
          :
          :
          :
          :      Disassembly of section .text:
          :
          :      00000000004004f4 &lt;foo&gt;:
     0.00 :        4004f4:       push   %rbp
     0.00 :        4004f5:       mov    %rsp,%rbp
     0.00 :        4004f8:       movl   $0x0,-0x4(%rbp)
     0.00 :        4004ff:       jmp    400517 &lt;foo+0x23&gt;
    14.70 :        400501:       mov    0x200b28(%rip),%rax        # 601030 &lt;count&gt;
     0.02 :        400508:       add    $0x1,%rax
     0.01 :        40050c:       mov    %rax,0x200b1d(%rip)        # 601030 &lt;count&gt;
     0.01 :        400513:       addl   $0x1,-0x4(%rbp)
    13.92 :        400517:       cmpl   $0x98967f,-0x4(%rbp)
    71.33 :        40051e:       jle    400501 &lt;foo+0xd&gt;
     0.00 :        400520:       leaveq
     0.00 :        400521:       retq

Fix it by adding a newline at the end of the message. It doesn't affect
the tui output AFAICS. New output will look like this:

 ...
 or:

   --vmlinux vmlinux
  Percent |   Source code &amp; Disassembly of a.out
 ------------------------------------------------
          :
          :
          :
          :      Disassembly of section .text:
 ...

Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Namhyung Kim &lt;namhyung@gmail.com&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/r/1329986784-4916-6-git-send-email-namhyung.kim@lge.com
Signed-off-by: Namhyung Kim &lt;namhyung.kim@lge.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf tools: Fix truncated annotation</title>
<updated>2011-12-23T18:39:19Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2011-12-23T13:08:04Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f41612f43be9575e1160460b08c3a760e6e27e1b'/>
<id>urn:sha1:f41612f43be9575e1160460b08c3a760e6e27e1b</id>
<content type='text'>
I get such truncated annotation results in 'perf top':

         :        Disassembly of section .text:                                                   ▒
         :                                                                                        ▒
         :        ffffffff810966a8 &lt;nr_iowait_cpu&gt;:                                               ▒
    4.94 :        ffffffff810966a8:       movslq %edi,%rdi                                        ▒
    3.70 :        ffffffff810966ab:       mov    $0x13700,%rax                                    ▒
    0.00 :        ffffffff810966b2:       add    -0x7e32cb00(,%rdi,8),%rax                        ▒
    8.64 :        ffffffff810966ba:       mov    0x7e0(%rax),%eax                                 ▒
   82.72 :        ffffffff810966c0:       cltq                                                    ▒

Note the missing 'retq' which is there in the original function:

ffffffff810966a8 &lt;nr_iowait_cpu&gt;:
ffffffff810966a8:       48 63 ff                movslq %edi,%rdi
ffffffff810966ab:       48 c7 c0 00 37 01 00    mov    $0x13700,%rax
ffffffff810966b2:       48 03 04 fd 00 35 cd    add    -0x7e32cb00(,%rdi,8),%rax
ffffffff810966b9:       81
ffffffff810966ba:       8b 80 e0 07 00 00       mov    0x7e0(%rax),%eax
ffffffff810966c0:       48 98                   cltq
ffffffff810966c2:       c3                      retq

ffffffff810966c3 &lt;this_cpu_load&gt;:

I'm using a fairly recent binutils:

  GNU objdump version 2.21.51.0.6-2.fc16 20110118

AFAICS the bug is simply that sym-&gt;end points to the last byte
of the symbol in question - while objdump's --stop-address
expects the last byte plus 1 to disassemble the full range.

Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/r/20111223130804.GA24305@elte.hu
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf symbols: Add nr_events to symbol_conf</title>
<updated>2011-11-28T12:37:11Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@redhat.com</email>
</author>
<published>2011-11-12T00:17:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d04b35f8085f0d4c5c874515b8f65e7664357148'/>
<id>urn:sha1:d04b35f8085f0d4c5c874515b8f65e7664357148</id>
<content type='text'>
Since symbol__alloc_hists need it, to avoid passing it around in many
functions have it in the symbol_conf struct.

Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Link: http://lkml.kernel.org/n/tip-cwv8ysvpywzjq4v3xtbd4zwv@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf ui: Reimplement the popup windows using libslang</title>
<updated>2011-10-26T15:06:36Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@redhat.com</email>
</author>
<published>2011-10-26T10:00:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ae55795ef2d9ba71d46e4111b87a4d0cde93abea'/>
<id>urn:sha1:ae55795ef2d9ba71d46e4111b87a4d0cde93abea</id>
<content type='text'>
Just another step in stopping the use of libnewt in perf.

Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Link: http://lkml.kernel.org/n/tip-vtxnmz1t1807ykprapnk9njl@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf: Support setting the disassembler style</title>
<updated>2011-09-29T20:10:00Z</updated>
<author>
<name>Andi Kleen</name>
<email>ak@linux.intel.com</email>
</author>
<published>2011-09-15T21:31:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f69b64f73e1d7f47a9205c1cd46e0e1c3c65e1cd'/>
<id>urn:sha1:f69b64f73e1d7f47a9205c1cd46e0e1c3c65e1cd</id>
<content type='text'>
Add -M option to report/annotate to pass directly to objdump.  This
allows to use -M intel for intel style disassembler syntax, which is
useful for people who are very used to the Intel syntax.

Link: http://lkml.kernel.org/r/1316122302-24306-2-git-send-email-andi@firstfloor.org
[committer note: Add missing Documentation bits, fixup conflicts with 3e6a2a7]
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf annotate: Make output more readable</title>
<updated>2011-08-18T10:38:21Z</updated>
<author>
<name>Stephane Eranian</name>
<email>eranian@google.com</email>
</author>
<published>2011-05-17T15:32:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3e6a2a7f3b9d0e521bb3284573b696d0cbe1952c'/>
<id>urn:sha1:3e6a2a7f3b9d0e521bb3284573b696d0cbe1952c</id>
<content type='text'>
This patch adds two new options to perf annotate:
	- --no-asm-raw : Do not display raw instruction encodings
	- --no-source  : Do not interleave source code with assembly code

We believe those options make the output of annotate more readable.

Systematically displaying source can make it hard to follow code and
especially optimized code.

Raw encodings are not useful in most cases.

Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/20110517153207.GA9834@quad
Signed-off-by: Stephane Eranian &lt;eranian@google.com&gt;
[committer note: Use the 'no-' option inverting logic]
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
</feed>
