<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/perf/builtin-annotate.c, branch linux-2.6.34.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.34.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.34.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2010-07-05T18:21:54Z</updated>
<entry>
<title>perf: Fix endianness argument compatibility with OPT_BOOLEAN() and introduce OPT_INCR()</title>
<updated>2010-07-05T18:21:54Z</updated>
<author>
<name>Ian Munsie</name>
</author>
<published>2010-04-13T08:37:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=08959bab0e65a42ff0d10fde4982939b472a7a96'/>
<id>urn:sha1:08959bab0e65a42ff0d10fde4982939b472a7a96</id>
<content type='text'>
commit c05556421742eb47f80301767653a4bcb19de9de upstream.

Parsing an option from the command line with OPT_BOOLEAN on a
bool data type would not work on a big-endian machine due to the
manner in which the boolean was being cast into an int and
incremented. For example, running 'perf probe --list' on a
PowerPC machine would fail to properly set the list_events bool
and would therefore print out the usage information and
terminate.

This patch makes OPT_BOOLEAN work as expected with a bool
datatype. For cases where the original OPT_BOOLEAN was
intentionally being used to increment an int each time it was
passed in on the command line, this patch introduces OPT_INCR
with the old behaviour of OPT_BOOLEAN (the verbose variable is
currently the only such example of this).

I have reviewed every use of OPT_BOOLEAN to verify that a true
C99 bool was passed. Where integers were used, I verified that
they were only being used for boolean logic and changed them to
bools to ensure that they would not be mistakenly used as ints.
The major exception was the verbose variable which now uses
OPT_INCR instead of OPT_BOOLEAN.

Signed-off-by: Ian Munsie &lt;imunsie@au.ibm.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Cc: &lt;stable@kernel.org&gt;
Cc: Git development list &lt;git@vger.kernel.org&gt;
Cc: Ian Munsie &lt;imunsie@au1.ibm.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Cc: Hitoshi Mitake &lt;mitake@dcl.info.waseda.ac.jp&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Eric B Munson &lt;ebmunson@us.ibm.com&gt;
Cc: Valdis.Kletnieks@vt.edu
Cc: WANG Cong &lt;amwang@redhat.com&gt;
Cc: Thiago Farina &lt;tfransosi@gmail.com&gt;
Cc: Masami Hiramatsu &lt;mhiramat@redhat.com&gt;
Cc: Xiao Guangrong &lt;xiaoguangrong@cn.fujitsu.com&gt;
Cc: Jaswinder Singh Rajput &lt;jaswinderrajput@gmail.com&gt;
Cc: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Cc: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Tom Zanussi &lt;tzanussi@gmail.com&gt;
Cc: Anton Blanchard &lt;anton@samba.org&gt;
Cc: John Kacur &lt;jkacur@redhat.com&gt;
Cc: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
LKML-Reference: &lt;1271147857-11604-1-git-send-email-imunsie@au.ibm.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>perf session: Change perf_session post processing functions to take histogram tree</title>
<updated>2010-03-10T12:53:49Z</updated>
<author>
<name>Eric B Munson</name>
</author>
<published>2010-03-05T15:51:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eefc465cdd49cb89a742083fac2807c718ddad31'/>
<id>urn:sha1:eefc465cdd49cb89a742083fac2807c718ddad31</id>
<content type='text'>
Now that report can store historgrams for multiple events we
need to be able to do the post processing work for each
histogram. This patch changes the post processing functions so
that they can be called individually for each event's histogram.

Signed-off-by: Eric B Munson &lt;ebmunson@us.ibm.com&gt;
[ Guarantee bisectabilty by fixing up builtin-report.c ]
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
LKML-Reference: &lt;1267804269-22660-5-git-send-email-acme@infradead.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>perf session: Change add_hist_entry to take the tree root instead of session</title>
<updated>2010-03-10T12:53:47Z</updated>
<author>
<name>Eric B Munson</name>
</author>
<published>2010-03-05T15:51:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d403d0acc9c5afa679a3f61e71489530d7fa0606'/>
<id>urn:sha1:d403d0acc9c5afa679a3f61e71489530d7fa0606</id>
<content type='text'>
In order to minimize the impact of storing multiple events in a
report this function will now take the root of the histogram
tree so that the logic for selecting the proper tree can be
inserted before the call.

Signed-off-by: Eric B Munson &lt;ebmunson@us.ibm.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
LKML-Reference: &lt;1267804269-22660-3-git-send-email-acme@infradead.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>perf annotate: Handle samples not at objdump output addr boundaries</title>
<updated>2010-02-26T14:42:49Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2010-02-26T14:23:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=48fb4fdd6b667ebeccbc6cde0a8a5a148d5c6b68'/>
<id>urn:sha1:48fb4fdd6b667ebeccbc6cde0a8a5a148d5c6b68</id>
<content type='text'>
Without this patch we get this for need_resched:

[root@mica ~]# perf annotate need_resched

------------------------------------------------
 Percent |      Source code &amp; Disassembly of vmlinux
------------------------------------------------
         :
         :
         :      Disassembly of section .text:
         :
         :      ffffffff810095ed &lt;need_resched&gt;:
         :              return (state &amp; TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
         :      }
         :
         :      static inline int need_resched(void)
         :      {
    0.00 :      ffffffff810095ed:       55                      push   %rbp
         :              return unlikely(test_thread_flag(TIF_NEED_RESCHED));
    0.00 :      ffffffff810095ee:       be 03 00 00 00          mov    $0x3,%esi
         :
         :      static inline struct thread_info *current_thread_info(void)
         :      {
         :              struct thread_info *ti;
         :              ti = (void *)(percpu_read_stable(kernel_stack) +
    0.00 :      ffffffff810095f3:       65 48 8b 3c 25 48 b5    mov    %gs:0xb548,%rdi
    0.00 :      ffffffff810095fa:       00 00
         :              return (state &amp; TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
         :      }
         :
         :      static inline int need_resched(void)
         :      {
    0.00 :      ffffffff810095fc:       48 89 e5                mov    %rsp,%rbp
         :              return unlikely(test_thread_flag(TIF_NEED_RESCHED));
    0.00 :      ffffffff810095ff:       48 81 ef d8 1f 00 00    sub    $0x1fd8,%rdi
    0.00 :      ffffffff81009606:       e8 9d ff ff ff          callq  ffffffff810095a8 &lt;test_ti_thread_flag&gt;
         :      }
    0.00 :      ffffffff8100960b:       c9                      leaveq
    0.00 :      ffffffff8100960c:       85 c0                   test   %eax,%eax
    0.00 :      ffffffff8100960e:       0f 95 c0                setne  %al
    0.00 :      ffffffff81009611:       0f b6 c0                movzbl %al,%eax
         :      Disassembly of section .vsyscall_0:
         :      Disassembly of section .vsyscall_fn:
         :      Disassembly of section .vsyscall_1:
         :      Disassembly of section .vsyscall_2:
         :      Disassembly of section .init.text:
         :      Disassembly of section .altinstr_replacement:
         :      Disassembly of section .exit.text:
[root@mica ~]#

But from the 'perf report' result we know that there are hits
for need_resched on a 4 way machine mostly doing nothing, so
after adding code to show what is in each hist offset and
collapsing IP hits for what happens between objdump lines we
get, for the same perf.data file:

[root@mica ~]# perf annotate -v need_resched

------------------------------------------------
 Percent |      Source code &amp; Disassembly of vmlinux
------------------------------------------------
         :
         :
         :      Disassembly of section .text:
         :
         :      ffffffff810095ed &lt;need_resched&gt;:
         :              return (state &amp; TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
         :      }
         :
         :      static inline int need_resched(void)
         :      {
    0.00 :      ffffffff810095ed:       55                      push   %rbp
         :              return unlikely(test_thread_flag(TIF_NEED_RESCHED));
   52.78 :      ffffffff810095ee:       be 03 00 00 00          mov    $0x3,%esi
         :
         :      static inline struct thread_info *current_thread_info(void)
         :      {
         :              struct thread_info *ti;
         :              ti = (void *)(percpu_read_stable(kernel_stack) +
    0.00 :      ffffffff810095f3:       65 48 8b 3c 25 48 b5    mov    %gs:0xb548,%rdi
    0.00 :      ffffffff810095fa:       00 00
         :              return (state &amp; TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
         :      }
         :
         :      static inline int need_resched(void)
         :      {
    0.00 :      ffffffff810095fc:       48 89 e5                mov    %rsp,%rbp
         :              return unlikely(test_thread_flag(TIF_NEED_RESCHED));
    9.72 :      ffffffff810095ff:       48 81 ef d8 1f 00 00    sub    $0x1fd8,%rdi
    0.00 :      ffffffff81009606:       e8 9d ff ff ff          callq  ffffffff810095a8 &lt;test_ti_thread_flag&gt;
         :      }
    0.00 :      ffffffff8100960b:       c9                      leaveq
    0.00 :      ffffffff8100960c:       85 c0                   test   %eax,%eax
   37.50 :      ffffffff8100960e:       0f 95 c0                setne  %al
    0.00 :      ffffffff81009611:       0f b6 c0                movzbl %al,%eax
         :      Disassembly of section .vsyscall_0:
         :      Disassembly of section .vsyscall_fn:
         :      Disassembly of section .vsyscall_1:
         :      Disassembly of section .vsyscall_2:
         :      Disassembly of section .init.text:
         :      Disassembly of section .altinstr_replacement:
         :      Disassembly of section .exit.text:
[root@mica ~]#

And now 'perf annotate -v', verbose mode, will show the hits per
precise IP, so that one can make sense of the attribution to
each objdumop line:

[root@mica ~]# perf annotate -v need_resched
Looking at the vmlinux_path (5 entries long)
Using /lib/modules/2.6.33-rc8-tip-00784-g3471df5-dirty/build/vmlinux
for symbols annotate_sym: filename=/lib/modules/2.6.33-rc8-tip-00784-g3471df5-dirty/build/vmlinux, sym=need_resched, start=0xffffffff810095ed, end=0xffffffff81009614

------------------------------------------------
 Percent |      Source code &amp; Disassembly of vmlinux
------------------------------------------------
                ffffffff810095f1: 152
                ffffffff81009603: 28
                ffffffff8100960f: 55
                ffffffff81009610: 53
                          h-&gt;sum: 288
&lt;SNIP same annotation&gt;

Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: Frédéric Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
LKML-Reference: &lt;1267194194-15670-1-git-send-email-acme@infradead.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>perf annotate: Defer allocating sym_priv-&gt;hist array</title>
<updated>2010-02-25T16:39:14Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2010-02-25T15:57:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=628ada0cb03666dd463f7c25947eaccdf440c309'/>
<id>urn:sha1:628ada0cb03666dd463f7c25947eaccdf440c309</id>
<content type='text'>
Because symbol-&gt;end is not fixed up at symbol_filter time, only
after all symbols for a DSO are loaded, and that, for asm
symbols, may be bogus, causing segfaults when hits happen in
these symbols.

Reported-by: David Miller &lt;davem@davemloft.net&gt;
Reported-by: Anton Blanchard &lt;anton@samba.org&gt;
Acked-by: David Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Frédéric Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: &lt;stable@kernel.org&gt; # for .33.x. Does not apply cleanly, needs backport.
LKML-Reference: &lt;20100225155740.GB8553@ghostprotocols.net&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>perf annotate: Fix it for non-prelinked *.so</title>
<updated>2010-02-04T08:33:27Z</updated>
<author>
<name>Kirill Smelkov</name>
</author>
<published>2010-02-03T18:52:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7a2b6209863626cf8362e5ff4653491558f91e67'/>
<id>urn:sha1:7a2b6209863626cf8362e5ff4653491558f91e67</id>
<content type='text'>
The problem was we were incorrectly calculating objdump
addresses for sym-&gt;start and sym-&gt;end, look:

For simple ET_DYN type DSO (*.so) with one function, objdump -dS
output is something like this:

    000004ac &lt;my_strlen&gt;:
    int my_strlen(const char *s)
     4ac:   55                      push   %ebp
     4ad:   89 e5                   mov    %esp,%ebp
     4af:   83 ec 10                sub    $0x10,%esp
    {

i.e. we have relative-to-dso-mapping IPs (=RIP) there.

For ET_EXEC type and probably for prelinked libs as well (sorry
can't test - I don't use prelink) objdump outputs absolute IPs,
e.g.

    08048604 &lt;zz_strlen&gt;:
    extern "C"
    int zz_strlen(const char *s)
     8048604:       55                      push   %ebp
     8048605:       89 e5                   mov    %esp,%ebp
     8048607:       83 ec 10                sub    $0x10,%esp
    {

So, if sym-&gt;start is always relative to dso mapping(*), we'll
have to unmap it for ET_EXEC like cases, and leave as is for
ET_DYN cases.

(*) and it is - we've explicitely made it relative. Look for
    adjust_symbols handling in dso__load_sym()

Previously we were always unmapping sym-&gt;start and for ET_DYN
dsos resulting addresses were wrong, and so objdump output was
empty.

The end result was that perf annotate output for symbols from
non-prelinked *.so had always 0.00% percents only, which is
wrong.

To fix it, let's introduce a helper for converting rip to
objdump address, and also let's document what map_ip() and
unmap_ip() do -- I had to study sources for several hours to
understand it.

Signed-off-by: Kirill Smelkov &lt;kirr@landau.phys.spbu.ru&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
LKML-Reference: &lt;1265223128-11786-8-git-send-email-acme@infradead.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>perf tools: Adjust some verbosity levels</title>
<updated>2010-02-04T08:33:27Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2010-02-03T18:52:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=29a9f66d703cb9464e24084e09edab5683e1b6b8'/>
<id>urn:sha1:29a9f66d703cb9464e24084e09edab5683e1b6b8</id>
<content type='text'>
Not to pollute too much 'perf annotate' debugging sessions.

Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Frédéric Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
LKML-Reference: &lt;1265223128-11786-7-git-send-email-acme@infradead.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>perf tools: Don't cast RIP to pointers</title>
<updated>2010-01-16T09:58:45Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2010-01-14T14:23:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0d755034dbd01e240eadf2d31f4f75d3088ccd21'/>
<id>urn:sha1:0d755034dbd01e240eadf2d31f4f75d3088ccd21</id>
<content type='text'>
Since they can come from another architecture with bigger
pointers, i.e. processing a 64-bit perf.data on a 32-bit arch.

Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Frédéric Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
LKML-Reference: &lt;1263478990-8200-1-git-send-email-acme@infradead.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>perf session: Remove redundant prefix &amp; suffix from perf_event_ops</title>
<updated>2009-12-28T08:03:35Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2009-12-27T23:37:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=55aa640f54280da25046acd2075842d464f451e6'/>
<id>urn:sha1:55aa640f54280da25046acd2075842d464f451e6</id>
<content type='text'>
Since now all that we have are perf event handlers, leave just
the name of the event.

Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Frédéric Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
LKML-Reference: &lt;1261957026-15580-9-git-send-email-acme@infradead.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>perf symbols: Move symbol filtering to event__preprocess_sample()</title>
<updated>2009-12-16T07:53:49Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2009-12-15T22:04:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c410a33887c17cac95ed8b0d860cdfb5c087a7d8'/>
<id>urn:sha1:c410a33887c17cac95ed8b0d860cdfb5c087a7d8</id>
<content type='text'>
So that --dsos, --comm, --symbols can bem used in more tools,
like in perf diff:

$ perf record -f find / &gt; /dev/null
$ perf record -f find / &gt; /dev/null
$ perf diff --dsos /lib64/libc-2.10.1.so | head -5
   1        +22392124     /lib64/libc-2.10.1.so   _IO_vfprintf_internal
   2         +6410655     /lib64/libc-2.10.1.so   __GI_memmove
   3    +1   +9192692     /lib64/libc-2.10.1.so   _int_malloc
   4    -1  -15158605     /lib64/libc-2.10.1.so   _int_free
   5           +45669     /lib64/libc-2.10.1.so   _IO_new_file_xsputn
$

Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Frédéric Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
LKML-Reference: &lt;1260914682-29652-3-git-send-email-acme@infradead.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
