aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/browsers/annotate.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-11-09perf annotate: Don't try to follow jump target on PLT symbolsNamhyung Kim1-0/+12
The perf annotate browser on TUI can identify a jump target for a selected instruction. It assumes that the jump target is within the function but it's not the case of PLT symbols which have offset out of the function as a target. Since it caused a segmentation fault, do not try to follow jump target on the PLT symbols. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Andi Kleen <ak@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1352482044-3443-5-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-11-05perf tools: Introduce struct hist_browser_timerNamhyung Kim1-15/+12
Currently various hist browser functions receive 3 arguments for refreshing histogram but only used from a few places. Also it's only for perf top command so that it can be NULL for other (and probably most) cases. Pack them into a struct in order to reduce number of those unused arguments. This is a mechanical change and does not intend a functional change. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Tested-by: David Ahern <dsahern@gmail.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Irina Tirdea <irina.tirdea@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1351835406-15208-2-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-10-29perf annotate browser: Integrate script browser into annotation browserFeng Tang1-0/+6
Integrate the script browser into annotation, users can press function key 'r' to list all perf scripts and select one of them to run that script, the output will be shown in a separate browser. Signed-off-by: Feng Tang <feng.tang@intel.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1351569369-26732-5-git-send-email-feng.tang@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-09-11perf tools: Use __maybe_used for unused variablesIrina Tirdea1-2/+4
perf defines both __used and __unused variables to use for marking unused variables. The variable __used is defined to __attribute__((__unused__)), which contradicts the kernel definition to __attribute__((__used__)) for new gcc versions. On Android, __used is also defined in system headers and this leads to warnings like: warning: '__used__' attribute ignored __unused is not defined in the kernel and is not a standard definition. If __unused is included everywhere instead of __used, this leads to conflicts with glibc headers, since glibc has a variables with this name in its headers. The best approach is to use __maybe_unused, the definition used in the kernel for __attribute__((unused)). In this way there is only one definition in perf sources (instead of 2 definitions that point to the same thing: __used and __unused) and it works on both Linux and Android. This patch simply replaces all instances of __used and __unused with __maybe_unused. Signed-off-by: Irina Tirdea <irina.tirdea@intel.com> Acked-by: Pekka Enberg <penberg@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Steven Rostedt <rostedt@goodmis.org> Link: http://lkml.kernel.org/r/1347315303-29906-7-git-send-email-irina.tirdea@intel.com [ committer note: fixed up conflict with a116e05 in builtin-sched.c ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-06-19perf annotate: Check null of sym pointer before using itSamuel Liao1-1/+3
Sym may be NULL, and that will cause perf to crash. Signed-off-by: Shan Wei <davidshan@tencent.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/4FCD95D3.90209@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-30perf annotate browser: Fix help window entry for navigating to hottest lineArnaldo Carvalho de Melo1-1/+1
Its 'H', not 'h'. The later is for getting to the help window. Reported-by: Ingo Molnar <mingo@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-7zvwphhm815y2zczoxgstzuf@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-29perf ui browser: Stop using 'self'Arnaldo Carvalho de Melo1-61/+61
Stop using this python/OOP convention, doesn't really helps. Will do more from time to time till we get it cleaned up in all of /perf. Suggested-by: Thomas Gleixner <tglx@linutronix.de> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-5dyxyb8o0gf4yndk27kafbd1@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-29perf annotate browser: Read perf config file for settingsArnaldo Carvalho de Melo1-0/+49
The defaults are: [annotate] hide_src_code = false use_offset = true jump_arrows = true show_nr_jumps = false Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-q4egci70rjgxh7bogbbfpcyf@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-29perf annotate browser: Make feature toggles globalArnaldo Carvalho de Melo1-35/+66
So that when navigating to another function from a call site or when going to another annotation browser thru the main report/top browser the options (hide source code, jump arrows, jumpy lines, etc) remains the last ones selected. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-0h0tah1zj59p01581snjufne@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-29perf annotate browser: The idx_asm field should be used in asm only viewArnaldo Carvalho de Melo1-1/+5
When hide_src_view is true we can't use browser_disasm_line->idx, that takes into account also non asm lines, we must use browser_disasm_line->idx_asm instead, otherwise we may end up with an index after the number of entries, oops, fix it. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-o1szpyjh3z87yi0n6x0cr8uu@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-12perf annotate browser: Add key bindings help windowArnaldo Carvalho de Melo1-7/+18
Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-1txmtzf71eqie5xcukbfxors@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-12perf annotate browser: Show 'jumpy' functionsArnaldo Carvalho de Melo1-5/+60
Just press 'J' and see how many places jump to jump targets. The hottest jump target appears in red, targets with more than one source have a different color than single source jump targets. Suggested-by: Arjan van de Ven <arjan@infradead.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-7452y0dmc02a20ooins7rn79@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-12perf annotate browser: Count the numbers of jump sources to a targetArnaldo Carvalho de Melo1-3/+3
Instead of simply marking an offset as a jump target. So that we can implement a new feature: showing "jumpy" targets, I.e. addresses that lots of places jump to. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-vc7b0u5yxgrubig0q61ayhxf@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-11Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/coreIngo Molnar1-3/+3
Fixes and improvements for perf/core: - perf_target: abstraction for --uid, --pid, --tid, --cpu, --all-cpus handling, eliminating code duplicated in the tools, having constraints that apply to all of them, from Namhyung Kim - Fixes for handling fallback to cpu-clock on PPC, from David Ahern - Fix for processing events with unknown size, from Jiri Olsa - Compilation fix on 32-bit, from Jiri Olsa Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
2012-05-09perf annotate: shorten helpline so it fits in visible spaceDavid Ahern1-3/+3
Additional toggles have pushed the help line out of view on a modestly sized terminal (120 columns wide). Shorten it to just reminders. Signed-off-by: David Ahern <dsahern@gmail.com> Link: http://lkml.kernel.org/r/1336510879-64610-1-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-07perf annotate browser: Do raw printing in 'o'ffset in a single placeArnaldo Carvalho de Melo1-5/+1
Instead of doing the same in all ins scnprintf methods. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-8mfairi2n1nentoa852alazv@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-03perf annotate browser: Don't change the asm line color when toggling sourceArnaldo Carvalho de Melo1-3/+0
Gets confusing. Remains to be chosen an appropriate different color for source code. This effectively reverts 58e817d997d1 ("perf annotate: Print asm code as blue when source code is displayed") Requested-by: Peter Zijlstra <peterz@infradead.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-qy9iq32nj3uqe5dbiuq9e3j9@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-05-03perf annotate browser: More clearly separate columnsArnaldo Carvalho de Melo1-20/+28
The first column (columns in the near future) are for the per line event overhead(s), that only appear when they are not zero. To clearly separate it, add back a solid vertical line, with just one colour, not influenced by the per line overheads. Then have the addr/offset column, then optionally the dynamic (static in the future) jump->target arrows, if 'j' enables it. Then the instructions. Requested-by: Peter Zijlstra <peterz@infradead.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-r415t4sps0oyr9y8kd9j7clz@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-27perf annotate browser: Don't display 0.00 percentagesArnaldo Carvalho de Melo1-7/+7
Cleaning up more the output. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-81pimnsnaa9y2j0a9plstu1c@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-27perf annotate browser: Remove the vertical line after the percentagesArnaldo Carvalho de Melo1-5/+4
It is confusing when used with jump -> target lines. Requested-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-xeiyfsxptwtmlvowledg6wpy@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-27perf annotate browser: Show current jump, back or forwardArnaldo Carvalho de Melo1-27/+23
Instead of trying to show the current loop by naively looking for the next backward jump, just use 'j' to toggle showing arrows connecting jump with its target. And do it for forward jumps as well. Loop detection requires more code to follow the flow control, etc. Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-soahcn1lz2u4wxj31ch0594j@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-27perf annotate browser: Add a right arrow before call instructionsArnaldo Carvalho de Melo1-0/+3
The counterpart of 'ret' instructions. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-jlz2ldaquaow0rqi2vr4b91l@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-25perf annotate browser: Don't draw jump connectors for out of function jumpsArnaldo Carvalho de Melo1-2/+4
As described in the previous patch. Next step is to properly label those jumps by using a -> arrow, i.e. not backwards/forwards, and allow the user to navigate to this other function when enter or -> is pressed. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-ax2sss463eu88wgl9ee8a6b6@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-25perf annotate: Disambiguage offsets and addresses in operandsArnaldo Carvalho de Melo1-7/+7
We were using ins_ops->target for callq addresses and jump offsets, disambiguate by having ins_ops->target.addr and ins_ops->target.offset. For jumps we'll need both to fixup lines that don't have an offset on the <> part. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-3nlcmstua75u07ao7wja1rwx@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-25perf annotate browser: Handle NULL jump targetsArnaldo Carvalho de Melo1-0/+7
In annotate_browser__mark_jump_targets 702 dlt = browser->offsets[dl->ops.target]; 703 bdlt = disasm_line__browser(dlt); 704 bdlt->jump_target = true; 705 } 706 707 } (gdb) p size $5 = 2415 (gdb) p offset $6 = 140 (gdb) p dl->ops.target $7 = 143 (gdb) p browser->offsets[143] $8 = (struct disasm_line *) 0x0 (gdb) p dl->name $9 = 0x2363bd0 "je" (gdb) Really strange, the code assumed that at the jump target we would have an assembly line, but only in the previous instruction offset we have a 'lock': (gdb) p browser->offsets[144] $10 = (struct disasm_line *) 0x0 (gdb) p browser->offsets[142] $11 = (struct disasm_line *) 0x27bd620 (gdb) p browser->offsets[142]->name $12 = 0x237a8a0 "lock" (gdb) I'll study this more, but for now I'll just check if there is a disasm_line at dl->ops.target, i.e. a valid jump target. Reported-by: Hagen Paul Pfeifer <hagen@jauu.net> Reported-by: Ingo Molnar <mingo@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-inzjrzyqhkzyv78met2vula6@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-24perf annotate browser: Initial loop detectionArnaldo Carvalho de Melo1-4/+57
Simple algorithm, just look for the next backward jump that points to before the cursor. Then draw an arrow connecting the jump to its target. Do this as you move the cursor, entering/exiting possible loops. Ex (graph chars replaced to avoid mail encoding woes): avc_has_perm_flags 0.00 | nopl 0x0(%rax) 5.36 |+-> 68: mov (%rax),%rax 5.15 || test %rax,%rax 0.00 || v je 130 2.96 || 74: cmp -0x20(%rax),%ebx 47.38 || lea -0x20(%rax),%rcx 0.28 || ^ jne 68 3.16 || cmp -0x18(%rax),%dx 0.00 |+------^ jne 68 4.92 | cmp 0x4(%rcx),%r13d 0.00 | v jne 68 1.15 | test %rcx,%rcx 0.00 | v je 130 Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-5gairf6or7dazlx3ocxwvftm@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-20ui browser: Add method to write graphical charactersArnaldo Carvalho de Melo1-10/+4
To save typing on the switch char set slang stuff. It also helps in removing more slang direct calls, wrapping them at the ui_browser level, where at some point I'll try to implement those in terms of GTK+. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-63yhb2htv9g3g1olmojzptkd@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-20perf annotate browser: Handle retq instructionsArnaldo Carvalho de Melo1-4/+9
By just returning to the previous function being annotated or to the top main screen when popping out the base of the annotation stack. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-x1dlc4d5aukj72g45o15s75k@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-20perf annotate browser: Add visual cue for retq instructionArnaldo Carvalho de Melo1-4/+13
Just use a left arrow prefixing retqs. Requested-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-tnpfijuomrntbnl5vr6ibdwa@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-20perf annotate browser: Add visual cues on jump linesArnaldo Carvalho de Melo1-1/+12
Using up/down arrows just before the instruction, replacing the actual chars with approximations to avoid mail encoding snafus: avtab_search_node 0.00 | push %rbp 0.00 | mov %rsp,%rbp 0.00 | callq mcount 0.00 | movzwl 0x6(%rsi),%edx 0.00 | and $0x7fff,%dx 0.00 | test %rdi,%rdi 0.00 | v jne 20 0.00 | 17: xor %eax,%eax 0.00 | 19: leaveq 0.00 | retq 0.00 | nopl 0x0(%rax,%rax,1) 0.00 | 20: mov (%rdi),%rax 0.00 | test %rax,%rax 0.00 | ^ je 17 0.00 | movzwl (%rsi),%ecx 0.00 | movzwl 0x2(%rsi),%r9d 0.00 | movzwl 0x4(%rsi),%r8d 0.00 | movzwl %cx,%esi 0.00 | movzwl %r9w,%r10d 0.00 | shl $0x9,%esi 0.00 | lea (%rsi,%r10,4),%esi 0.00 | lea (%r8,%rsi,1),%esi 0.00 | and 0x10(%rdi),%si 0.00 | movzwl %si,%esi 0.00 | mov (%rax,%rsi,8),%rax 0.00 | test %rax,%rax 0.00 | ^ je 19 0.00 | nopw 0x0(%rax,%rax,1) 0.00 | 60: cmp %cx,(%rax) 0.00 | v jne 7e 0.00 | cmp %r9w,0x2(%rax) 0.00 | v jne 7e 0.00 | cmp %r8w,0x4(%rax) 0.00 | v jne 79 0.00 | test %dx,0x6(%rax) 0.00 | ^ jne 19 0.00 | 79: cmp %r8w,0x4(%rax) 93.04 | 7e:^ ja 17 2.53 | mov 0x10(%rax),%rax 4.43 | test %rax,%rax 0.00 | ^ jne 60 0.00 | leaveq 0.00 | retq Next low hanging fruit is to use left arrow for retqs, then work on clearling marking loops. Requested-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-hkx848wdbs6n7bcp3ymr9yus@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-20perf annotate browser: Bandaid offsets/jump label objdump ambiguityArnaldo Carvalho de Melo1-1/+9
We need to cope with things like: $ objdump -d --no-show-raw -S -C /lib/modules/3.4.0-rc2+/build/vmlinux <SNIP> ffffffff8125ec60 <copy_user_generic_unrolled>: * Output: * eax uncopied bytes or 0 if successful. */ ENTRY(copy_user_generic_unrolled) CFI_STARTPROC cmpl $8,%edx ffffffff8125ec60: cmp $0x8,%edx jb 20f /* less then 8 bytes, go to byte copy loop */ ffffffff8125ec63: jb ffffffff8125ecf5 <copy_user_generic_unrolled+0x95> ALIGN_DESTINATION <SNIP> ffffffff8125ec8d: je ffffffff8125ecd9 <copy_user_generic_unrolled+0x79> 1: movq (%rsi),%r8 ffffffff8125ec8f: mov (%rsi),%r8 2: movq 1*8(%rsi),%r9 ffffffff8125ec92: mov 0x8(%rsi),%r9 3: movq 2*8(%rsi),%r10 ffffffff8125ec96: mov 0x10(%rsi),%r10 4: movq 3*8(%rsi),%r11 <SNIP> Probably expect that the length of the addr field be the same... Lazy move for now, back to supporting suppressing the address on callq lines... Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-7hp85vnvowpqj8799f8rxbu1@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-20perf annotate: Group operands membersArnaldo Carvalho de Melo1-9/+8
So that the ins_ops can handle them in a single place, instead of adding more and more functions or ins_ops parameters. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-pk4dqaum6ftiz104dvimwgtb@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-19perf annotate browser: Use a vertical line as percentage separatorArnaldo Carvalho de Melo1-2/+4
Where we had ':'. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-l8gbejzpglnwiwk43450h31g@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-19perf annotate browser: Make lines more compactArnaldo Carvalho de Melo1-8/+9
But now we have a lot of space on the right... Perhaps we should add a "Trending on G+" gizmo... ;-) Requested-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-igoynvtg2wc6mdfinc69prp6@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-19perf annotate browser: Align jump labelsArnaldo Carvalho de Melo1-4/+13
Find out at browser startup the max width and use it when rendering jump labels on the screen. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-7dxjiwqb77wz6f5lc05e0i0x@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-19perf annotate browser: Hide non jump target addresses in offset modeArnaldo Carvalho de Melo1-13/+58
This: 0.00 : ffffffff8116bd00: lock btsl $0x0,(%r12) 100.00 : ffffffff8116bd07: sbb %eax,%eax 0.00 : ffffffff8116bd09: test %eax,%eax 0.00 : ffffffff8116bd0b: jne ffffffff8116bf5f <__mem_cgroup_commit_charge+0x28f> 0.00 : ffffffff8116bd11: mov (%r12),%rax 0.00 : ffffffff8116bd15: test $0x2,%al 0.00 : ffffffff8116bd17: jne ffffffff8116bf6e <__mem_cgroup_commit_charge+0x29e> 0.00 : ffffffff8116bd1d: test %r9b,%r9b 0.00 : ffffffff8116bd20: jne ffffffff8116be30 <__mem_cgroup_commit_charge+0x160> 0.00 : ffffffff8116bd26: xor %eax,%eax 0.00 : ffffffff8116bd28: mov %r13,0x8(%r12) 0.00 : ffffffff8116bd2d: lock orb $0x2,(%r12) 0.00 : ffffffff8116bd33: test %r9b,%r9b 0.00 : ffffffff8116bd36: je ffffffff8116bdf3 <__mem_cgroup_commit_charge+0x123> Becomes: 0.00 : 30: lock btsl $0x0,(%r12) 100.00 : sbb %eax,%eax 0.00 : test %eax,%eax 0.00 : jne 28f 0.00 : mov (%r12),%rax 0.00 : test $0x2,%al 0.00 : jne 29e 0.00 : test %r9b,%r9b 0.00 : jne 160 0.00 : 56: xor %eax,%eax 0.00 : 58: mov %r13,0x8(%r12) 0.00 : lock orb $0x2,(%r12) 0.00 : test %r9b,%r9b 0.00 : je 123 I.e. We trow away all those useless addresses and keep just jump labels. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-r2vmbtgz0l8coluj8flztgrn@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-19perf annotate browser: Rename disasm_line_rb_nodeArnaldo Carvalho de Melo1-38/+38
Its not just an rb_node, it carries extra state that is private to the browser. And will carry some more in the next patches. Better name it browser_disasm_line, i.e. something derived from disasm_line, that specializes it. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-nev4b97vdvv35we1qmooym52@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-19perf annotate: Introduce scnprintf ins_ops methodArnaldo Carvalho de Melo1-2/+11
And implement the jump one, where if the operands string is not passed, a compact form that uses just the target address is used. Right now this is toggled via the 'o' option in the annotate browser, switching from: 0.00 : ffffffff811661e8: je ffffffff81166204 <mem_cgroup_count_vm_event+0x44> 0.00 : ffffffff811661ea: cmp $0xb,%esi 0.00 : ffffffff811661ed: je ffffffff811661f8 <mem_cgroup_count_vm_event+0x38> To: 0.00 : 28: je 44 0.00 : 2a: cmp $0xb,%esi 0.00 : 2d: je 38 Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-o88q46yh4kxgpd1chk5gvjl5@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-18perf annotate: Parse call targets earlierArnaldo Carvalho de Melo1-5/+5
No need to do it everytime the user presses enter/-> on a call instruction. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-ybgss44m5ycry8mk7b1qdbre@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-18perf annotate: Disassembler instruction parsingArnaldo Carvalho de Melo1-16/+3
So that at disassembly time we parse targets, etc. Supporting jump instructions initially, call functions are next. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-7vzlh66n5or46n27ji658cnl@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-16perf annotate browser: Use the disasm_line instruction name and operand fieldsArnaldo Carvalho de Melo1-19/+10
No need to reparse it everytime. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-90ncot487p4h5rzkn8h2whou@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-16perf annotate: Rename objdump_line to disasm_lineArnaldo Carvalho de Melo1-91/+88
We want to move away from using 'objdump -dS' as the only disassembler supported. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-lsn9pjuxxm5ezsubyhkmprw7@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-04-11perf tools: Move UI bits to tools/perf/ui directoryNamhyung Kim1-0/+673
Move those files to new directory in order to be prepared to further UI work. Makefile and header file pathes are adjusted accordingly. Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Suggested-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Acked-by: Pekka Enberg <penberg@kernel.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung.kim@lge.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Pekka Enberg <penberg@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl Link: http://lkml.kernel.org/r/1333523666-12057-1-git-send-email-namhyung.kim@lge.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>