linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* =?y?q?=5BGIT=20PULL=2000/13=5D=20Annotation=20improvements=20=28G+=20edition=29?=
@ 2012-04-19 20:33 Arnaldo Carvalho de Melo
  2012-04-19 20:33 ` [PATCH 01/13] perf annotate: Rename objdump_line to disasm_line Arnaldo Carvalho de Melo
                   ` (11 more replies)
  0 siblings, 12 replies; 22+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-04-19 20:33 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern,
	Frederic Weisbecker, Linus Torvalds, Mike Galbraith,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian,
	arnaldo.melo, Arnaldo Carvalho de Melo

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 3525 bytes --]

Hi Ingo,

	Please consider pulling,

- Arnaldo

The following changes since commit a385ec4f11bdcf81af094c03e2444ee9b7fad2e5:

  Merge tag 'v3.4-rc2' into perf/core (2012-04-13 09:57:10 +0200)

are available in the git repository at:


  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux perf/annotate

for you to fetch changes up to 3f862fd076275c442dfe295eddb5650a6e0aecd4:

  perf annotate: Add missing jump variants (2012-04-19 17:10:12 -0300)

----------------------------------------------------------------
Annotate improvements

Now the default annotate browser uses a much more compact format, implementing
suggestions made made by several people, notably Linus.

Here is part of the new __list_del_entry annotation:

__list_del_entry
    8.47 │      push   %rbp
    8.47 │      mov    (%rdi),%rdx
   20.34 │      mov    $0xdead000000100100,%rcx
    3.39 │      mov    0x8(%rdi),%rax
    0.00 │      mov    %rsp,%rbp
    1.69 │      cmp    %rcx,%rdx
    0.00 │      je     43
    1.69 │      mov    $0xdead000000200200,%rcx
    3.39 │      cmp    %rcx,%rax
    0.00 │      je     a3
    5.08 │      mov    (%rax),%r8
   18.64 │      cmp    %r8,%rdi
    0.00 │      jne    84
    1.69 │      mov    0x8(%rdx),%r8
   25.42 │      cmp    %r8,%rdi
    0.00 │      jne    65
    1.69 │      mov    %rax,0x8(%rdx)
    0.00 │      mov    %rdx,(%rax)
    0.00 │      leaveq
    0.00 │      retq
    0.00 │ 43:  mov    %rdx,%r8
    0.00 │      mov    %rdi,%rcx
    0.00 │      mov    $0xffffffff817cd6a8,%rdx
    0.00 │      mov    $0x31,%esi
    0.00 │      mov    $0xffffffff817cd6e0,%rdi
    0.00 │      xor    %eax,%eax
    0.00 │      callq  ffffffff8104eab0 <warn_slowpath_fmt>
    0.00 │      leaveq
    0.00 │      retq
    0.00 │ 65:  mov    %rdi,%rcx
    0.00 │      mov    $0xffffffff817cd780,%rdx
    0.00 │      mov    $0x3a,%esi
    0.00 │      mov    $0xffffffff817cd6e0,%rdi
    0.00 │      xor    %eax,%eax
    0.00 │      callq  ffffffff8104eab0 <warn_slowpath_fmt>
    0.00 │      leaveq
    0.00 │      retq

The infrastructure is there to provide formatters for any instruction,
like the one I'll do for call functions to elide the address.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

----------------------------------------------------------------
Arnaldo Carvalho de Melo (13):
      perf annotate: Rename objdump_line to disasm_line
      perf annotate: Parse instruction
      perf annotate browser: Use the disasm_line instruction name and operand fields
      perf annotate: Disassembler instruction parsing
      perf annotate: Parse call targets earlier
      perf annotate: Introduce scnprintf ins_ops method
      perf annotate browser: Rename disasm_line_rb_node
      perf symbols: Introduce symbol__size method
      perf annotate browser: Hide non jump target addresses in offset mode
      perf annotate browser: Align jump labels
      perf annotate browser: Make lines more compact
      perf annotate browser: Use a vertical line as percentage separator
      perf annotate: Add missing jump variants

 tools/perf/ui/browsers/annotate.c |  323 +++++++++++++++++++++----------------
 tools/perf/util/annotate.c        |  263 +++++++++++++++++++++++++-----
 tools/perf/util/annotate.h        |   32 +++-
 tools/perf/util/symbol.h          |    5 +
 tools/perf/util/util.c            |   10 ++
 tools/perf/util/util.h            |    2 +
 6 files changed, 446 insertions(+), 189 deletions(-)

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [GIT PULL 00/13] Annotation improvements (G+ edition)
@ 2012-04-23  1:17 George Spelvin
  0 siblings, 0 replies; 22+ messages in thread
From: George Spelvin @ 2012-04-23  1:17 UTC (permalink / raw)
  To: acme; +Cc: linux, linux-kernel, torvalds

A simpler way might just be to use the gas syntax of appending a "b" or
"f" to the branch number, indicating whether the target is in front
or behind.

Gas permits integer branch labels to be re-used, so it's necessary to
specify a direction.

Another thing that might help a reader is a comment indicating the number
of branches to a target, divided by direction.  Targets of backward
branches are obviously more interesting from a performance standpoint,
as they're likely to be the start of loops.


If you *want* to re-use branch target labels, there's a simple algorithm
for assigning them, given a list of all branch origins for each target:

First, collapse the list of all branch origins into a range, listing
the first and last reference to the target.  (The target itself counts
as a reference.)

Then repeat the following for n=0, 1, 2, ... until there are
no more targets left:

In some arbitrary order (I suggest increasing order of range size),
consider each of the remaining targets.  If there are no other targets
within its range, it may be assigned the label n.  If there are other
targets within its range, postpone this target for a later pass, and
remove it from the list of remaining targets.

Once the decision has been made to postpone a target to a later pass, it
no longer counts as "in the range" for other targets considered this pass.
This resolves the intersecting branches case:

	je 1f
0:
	foo
1:
	jbe 0b

Here, the 1: target was considered first, and had to be postponed
because the 0: target was in its range.  Then the 0: target saw nothing
conflicting it its range, and so was assigned.

Because it's not possible to postpone every target (if this were about
to happen, there will be no remaining targets within the range of the
last target considered, so it will be assigned and not postponed),
each iteration will assign at least one target.

After considering all remaining targets, forget about the assigned ones,
incrmeent n, and go back and re-consider the postponed ones.

While the algorithm is potentially inefficient in contrived cases,
I don't think it'll be a huge problem in practice.

Even if you don't want to assign labels this way, a similar algorithm
can assign columns to branching arrows so they do not overlap.

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2012-04-25 10:47 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-19 20:33 =?y?q?=5BGIT=20PULL=2000/13=5D=20Annotation=20improvements=20=28G+=20edition=29?= Arnaldo Carvalho de Melo
2012-04-19 20:33 ` [PATCH 01/13] perf annotate: Rename objdump_line to disasm_line Arnaldo Carvalho de Melo
2012-04-19 20:33 ` [PATCH 02/13] perf annotate: Parse instruction Arnaldo Carvalho de Melo
2012-04-19 23:55   ` David Ahern
2012-04-20 10:53     ` Arnaldo Carvalho de Melo
2012-04-23  6:30   ` Namhyung Kim
2012-04-19 20:33 ` [PATCH 03/13] perf annotate browser: Use the disasm_line instruction name and operand fields Arnaldo Carvalho de Melo
2012-04-19 20:33 ` [PATCH 04/13] perf annotate: Disassembler instruction parsing Arnaldo Carvalho de Melo
2012-04-19 20:34 ` [PATCH 05/13] perf annotate: Parse call targets earlier Arnaldo Carvalho de Melo
2012-04-19 20:34 ` [PATCH 06/13] perf annotate: Introduce scnprintf ins_ops method Arnaldo Carvalho de Melo
2012-04-19 20:34 ` [PATCH 07/13] perf annotate browser: Rename disasm_line_rb_node Arnaldo Carvalho de Melo
2012-04-19 20:34 ` [PATCH 08/13] perf symbols: Introduce symbol__size method Arnaldo Carvalho de Melo
2012-04-19 20:34 ` [PATCH 09/13] perf annotate browser: Hide non jump target addresses in offset mode Arnaldo Carvalho de Melo
2012-04-20  0:01 ` [GIT PULL 00/13] Annotation improvements (G+ edition) David Ahern
2012-04-20 10:51   ` Arnaldo Carvalho de Melo
2012-04-20  0:31 ` Linus Torvalds
2012-04-20  0:40   ` Linus Torvalds
2012-04-20 10:59   ` Arnaldo Carvalho de Melo
2012-04-25  7:05 ` Ingo Molnar
2012-04-25 10:31   ` Arnaldo Carvalho de Melo
2012-04-25 10:48     ` Arnaldo Carvalho de Melo
2012-04-23  1:17 George Spelvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).