aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-08-19perf ui browser: Add routines to compactly specify exit keysArnaldo Carvalho de Melo6-35/+34
This makes the usual idiom for specifying a series of key codes to exit ui_browser__run() for specialized processing (search, annotate, etc) or plain exiting the browser more compact. It also abstracts away some more libnewt operations. At some point we'll also replace NEWT_KEY_foo with something that can be mapped to NEWT or, say, gtk. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-19perf ui browser: Return the exit key in all browsersArnaldo Carvalho de Melo6-116/+85
Make all browsers return the exit key uniformly and remove the newtExitStruct parameter, removing one more newt specific thing from the ui API. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-19perf ui browser: Abstract some more slang operationsArnaldo Carvalho de Melo5-37/+38
Browsers don't have to deal with absolute coordinates, just using (row, column) and leaving the rest to ui_browser is better and removes one more UI backend detail from the browsers. Also shorten the percent_color setting idiom, removing some more direct libslang calls. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-16perf annotate tui: Fix exit and RIGHT keys handlingArnaldo Carvalho de Melo1-1/+2
As part of ongoing effort to reduce the coupling with libnewt, browsers are being changed to return the exit key. The annotate browser is not returning it as expected by builtin-annotate when annotating multiple symbols (when 'perf annotate' is called without specifying a symbol name). Fix it by returning the exit key and also adding the RIGHT key as a exit key so that going to the next symbol in the TUI can work again. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-12perf: Add back list_head data typesIngo Molnar1-0/+12
This commit: de5d9bf: Move list types from <linux/list.h> to <linux/types.h>. Moved the list head data types out of list.h, breaking the build. Add them to the perf types.h as well. Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Steven Rostedt <rostedt@goodmis.org> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-08-10perf ui hist browser: Fixup key bindingsArnaldo Carvalho de Melo1-8/+7
To match what is shown when '?' or 'H' is pressed, i.e. the keybind help window. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-10perf ui browser: Add ui_browser__show counterpart: __hideArnaldo Carvalho de Melo7-15/+33
So that the common tasks of providing a helpline at __run entry and destroying the window and releasing resourses at exit can be abstracted away, reducing a bit more the coupling with libnewt. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-10perf annotate: Cycle thru sorted lines with samplesArnaldo Carvalho de Melo1-25/+77
The annotate TUI now starts centered on the line with most samples, i.e. the hottest line in the annotated function. Pressing TAB will center on the second hottest function and so on. Shift+TAB goes in the other direction. This way one can more easily sift thru the function hotspots. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-10perf ui: Make SPACE work as PGDN in all browsersArnaldo Carvalho de Melo2-1/+1
Not just on the annotate one. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-10perf annotate: Sort by hottest lines in the TUIArnaldo Carvalho de Melo3-45/+124
Right now it will just sort and position at the hottest line, i.e. the one where more samples were taken. It will be at the center of the screen and later TAB/shift-TAB will cycle thru the hottest lines. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-10perf ui: Complete the breakdown of util/newt.cArnaldo Carvalho de Melo9-74/+93
LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-10perf ui: Move hists browser to util/ui/browsers/Arnaldo Carvalho de Melo3-954/+963
LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-10perf symbols: Ignore mapping symbols on ARMDave Martin1-0/+10
ARM ELF files use symbols with special names $a, $t, $d to identify regions of ARM code, Thumb code and data within code sections. This can cause confusing output from the perf tools, especially for partially stripped binaries, or binaries containing user-added zero-sized symbols (which may occur in hand-written assembler which hasn't been fully annotated with .size directives). This patch filters out these symbols at load time. LKML-Reference: <1281352878-8735-2-git-send-email-dave.martin@linaro.org> Signed-off-by: Dave Martin <dave.martin@linaro.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-10perf ui: Move map browser to util/ui/browsers/Arnaldo Carvalho de Melo3-155/+170
LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-10perf ui: Move annotate browser to util/ui/browsers/Arnaldo Carvalho de Melo5-130/+145
LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-10perf ui: Move ui_progress routines to separate file in util/ui/Arnaldo Carvalho de Melo4-59/+72
LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-10perf ui: Move ui_helpline routines to separate file in util/ui/Arnaldo Carvalho de Melo3-37/+53
LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-10perf ui: Shorten ui_browser member namesArnaldo Carvalho de Melo3-50/+49
LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-06perf ui: Start breaking down newt.c into multiple filesArnaldo Carvalho de Melo3-301/+361
As new TUI features get added the newt.c file is growing a lot and its name is growing misleading as an effort is being made to reduce the coupling with libnewt. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-06perf tui: Introduce list_head based generic ui_browser refresh routineArnaldo Carvalho de Melo2-25/+32
So that building other browser based on structures linked via a linked list can be as easy as it is already for the ones linked via an rb_tree. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-06perf probe: Fix memory leaks in add_perf_probe_eventsMasami Hiramatsu1-3/+8
Fix several memory leaks of pkgs and tevs in add_perf_probe_events(). Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: linux-kernel@vger.kernel.org LKML-Reference: <4C577ADC.1000309@hitachi.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-06perf probe: Fix to copy the type for raw parametersMasami Hiramatsu1-2/+6
Copy type field if it is for raw parameters. Without this fix, perf probe drops the type if user passes it for raw parameters (e.g. %ax:u32 will be converted to %ax). Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> LKML-Reference: <4C577AD8.50808@hitachi.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-05perf probe: Remove duplicated #includeAndrea Gelmini1-1/+0
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Masami Hiramatsu <mhiramat@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <1281016299-23958-15-git-send-email-andrea.gelmini@gelma.net> Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-05perf ui: Add search by name/addr to the map__browserArnaldo Carvalho de Melo1-9/+100
Only in verbose mode so as not to bloat struct symbol too much. The key used is '/', just like in vi, less, etc. More work is needed to allocate space on the symbol in a more clear way. This experiment shows how to do it for the hist_browser, in the main window. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-05perf hists: Fixup addr snprintf width on 32 bit archesArnaldo Carvalho de Melo1-2/+4
By using BITS_PER_LONG/4 as the width specifier. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-05perf hists: Handle verbose in hists__sort_list_widthArnaldo Carvalho de Melo1-0/+3
Otherwise entries will get chopped up on the window. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-05perf ui: Shorten ui_browser->refresh_entries to refreshArnaldo Carvalho de Melo1-12/+12
LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-05perf ui: Add a map browserArnaldo Carvalho de Melo1-2/+127
Press -> and then "Browse map details" to see the DSO long name as the title and the list of symbols in the DSO used by the map where the current symbol is. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-05perf symbols: Store the symbol bindingArnaldo Carvalho de Melo2-8/+23
So that tools that wan't to act only on a subset of (weak, global, local) symbols can do so, such as the upcoming uprobes support in 'perf probe'. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-04perf: expose event__process functionSrikar Dronamraju2-0/+21
The event__process function is useful in processing /proc/<pid>/maps. All of the functions that are called from event__process are defined in util/event.c. Though its defined in builtin-top.c, it could be reused for perf probe for uprobes. Hence moving it to util/event.c and exporting the function. LKML-Reference: <20100802123851.GD22812@linux.vnet.ibm.com> Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-04perf events: Fix mmap offset determinationDave Martin1-7/+1
Fix buggy-looking code which unnecessarily adjusts the file offset fields read from /proc/*/maps. This may have gone unnoticed since the offset is usually 0 (and the logic in util/symbol.c may work incorrectly for other offset values). Commiter note: This fixes a bug introduced in 4af8b35, there is no need to shift pgoff twice, the show_map_vma routine in fs/proc/task_mmu.c already converts it from the number of pages to the size in bytes, and that is what appears in /proc/PID/map. Cc: Nicolas Pitre <nicolas.pitre@linaro.org> Cc: Will Deacon <Will.Deacon@arm.com> LKML-Reference: <1280836116-6654-2-git-send-email-dave.martin@linaro.org> Signed-off-by: Dave Martin <dave.martin@linaro.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-02perf tools: Don't keep unreferenced maps when unmaps are detectedArnaldo Carvalho de Melo3-11/+25
For a file with: [root@emilia linux-2.6-tip]# perf report -D -fi allmodconfig-j32.perf.data | grep events: TOTAL events: 36933 MMAP events: 9056 LOST events: 0 COMM events: 1702 EXIT events: 1887 THROTTLE events: 8 UNTHROTTLE events: 8 FORK events: 1894 READ events: 0 SAMPLE events: 22378 ATTR events: 0 EVENT_TYPE events: 0 TRACING_DATA events: 0 BUILD_ID events: 0 [root@emilia linux-2.6-tip]# Testing with valgrind and making perf_session__delete() a nop, so that we can notice how many maps were actually deleted due to not having any samples on it: ==== HEAP SUMMARY: Before: ==10339== in use at exit: 8,909,997 bytes in 68,690 blocks ==10339== total heap usage: 78,696 allocs, 10,007 frees, 11,925,853 bytes allocated After: ==10506== in use at exit: 8,902,605 bytes in 68,606 blocks ==10506== total heap usage: 78,696 allocs, 10,091 frees, 11,925,853 bytes allocated I.e. just 84 detected unmaps with no hits out of 9056 for this workload, not much, but in some other long running workload this may save more bytes. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-02perf session: Invalidate last_match when removing threads from rb_treeArnaldo Carvalho de Melo1-0/+1
If we receive two PERF_RECORD_EXIT for the same thread, we can end up reusing session->last_match and trying to remove the thread twice from the rb_tree, causing a segfault, so invalidade last_match in perf_session__remove_thread. Receiving two PERF_RECORD_EXIT for the same thread is a bug, but its a harmless one if we make the tool more robust, like this patch does. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-02perf session: Free the ref_reloc_sym memory at the right placeArnaldo Carvalho de Melo5-7/+70
Which is at perf_session__destroy_kernel_maps, counterpart to the perf_session__create_kernel_maps where the kmap structure is located, just after the vmlinux_maps. Make it also check if the kernel maps were actually created, which may not be the case if, for instance, perf_session__new can't complete due to permission problems in, for instance, a 'perf report' case, when a segfault will take place, that is how this was noticed. The problem was introduced in d65a458, thus post .35. This also adds code to release guest machines as them are also created in perf_session__create_kernel_maps, so should be deleted on this newly introduced counterpart, perf_session__destroy_kernel_maps. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-08-02Merge commit 'v2.6.35' into perf/coreIngo Molnar2-9/+16
Conflicts: tools/perf/Makefile tools/perf/util/hist.c Merge reason: Resolve the conflicts and update to latest upstream. Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-07-30perf tools: Release session and symbol resources on exitArnaldo Carvalho de Melo6-2/+66
So that we reduce the noise when looking for leaks using tools such as valgrind. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-07-30perf tools: Release thread resources on PERF_RECORD_EXITArnaldo Carvalho de Melo5-0/+61
For long running sessions with many threads with short lifetimes the amount of memory that the buildid process takes is too much. Since we don't have hist_entries that may be pointing to them, we can just release the resources associated with each thread when the exit (PERF_RECORD_EXIT) event is received. For normal processing we need to annotate maps with hits, and thus hist_entries pointing to it and drop the ones that had none. Will be done in a followup patch. Cc: David S. Miller <davem@davemloft.net> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-07-30perf probe: Rename common fields/functions from kprobe to probe.Srikar Dronamraju4-105/+101
As a precursor for perf to support uprobes, rename fields/functions that had kprobe in their name but can be shared across perf-kprobes and perf-uprobes to probe. Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Christoph Hellwig <hch@infradead.org> Cc: "Frank Ch. Eigler" <fche@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mark Wielaard <mjw@redhat.com> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Naren A Devaiah <naren.devaiah@in.ibm.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Randy Dunlap <rdunlap@xenotime.net> Cc: Steven Rostedt <rostedt@goodmis.org> LKML-Reference: <20100729141351.GG21723@linux.vnet.ibm.com> Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-07-30perf tui: Make CTRL+Z suspend perfArnaldo Carvalho de Melo1-0/+9
Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-07-30perf symbols: Improve debug image search when loading symbolsDave Martin1-35/+61
Changes: * Simplification of the main search loop on dso__load() * Replace the search with a 2-pass search: * First, try to find an image with a proper symtab. * Second, repeat the search, accepting dynsym. A second scan should only ever happen when needed debug images are missing from the buildid cache or stale, i.e., when the cache is out of sync. Currently, the second scan also happens when using separated debug images, since the caching logic doesn't currently know how to cache those. Improvements to the cache behaviour ought to solve that. Signed-off-by: Dave Martin <dave.martin@linaro.org> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-07-30perf tools: remove extra build-id check factored into dso__loadDave Martin1-26/+2
Signed-off-by: Dave Martin <dave.martin@linaro.org> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-07-30perf tools: Factor out buildid reading and make it implicit in dso__loadDave Martin1-33/+47
If we have a buildid, then we never want to load an image which has no buildid, or which has a different buildid, so it makes sense for the check to be built into dso__load and not done separately. This is fine for old distros which don't use buildid at all since we do no check in that case. This refactoring also alleviates some subtle race condition issues by not opening ELF images twice to check the buildid and then load the symbols, which could lead to weirdness if an image is replaced under our feet. Signed-off-by: Dave Martin <dave.martin@linaro.org> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-07-29perf symbols: Precisely specify if dso->{long,short}_name should be freedArnaldo Carvalho de Melo3-2/+8
Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-07-27perf tools: Remove unneeded code for tracking the cwd in perf sessionsDave Martin2-22/+1
Tidy-up patch to remove some code and struct perf_session data members which are no longer needed due to the previous patch: "perf tools: Don't abbreviate file paths relative to the cwd". LKML-Reference: <new-submission> Signed-off-by: Dave Martin <dave.martin@linaro.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-07-27perf report: Don't abbreviate file paths relative to the cwdDave Martin3-23/+3
This avoids around some problems where the full path is executables and DSOs it needed for finding debug symbols on platforms with separated debug symbol files such as Ubuntu. This is simpler than tracking an extra name for each image. The only impact should be that paths in verbose output from the perf tools become absolute, instead of relative to . LKML-Reference: <new-submission> Signed-off-by: Dave Martin <dave.martin@linaro.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-07-27perf ui: New hists tree widgetArnaldo Carvalho de Melo4-311/+678
The stock newt checkbox tree widget we were using was not really suitable for hist entry + callchain browsing. The problems with it were manifold: - We needed to traverse the whole hist_entry rb_tree to add each entry + callchains beforehand. - No control over the colors used for each row So a new tree widget, based mostly on slang, was written. It extends the ui_browser class already used for annotate to allow the user to fold/unfold branches in the callchains tree, using extra fields in the symbol_map class that is embedded in hist_entry and callchain_node instances to store the folding state and when changing this state calculates the number of rows that are produced when showing a particular hist_entry instance. This greatly speeds up browsing as we don't have to upfront touch all the entries and only calculate callchain related operations when some callchain branch is actually unfolded. The memory footprint is also reduced as the data structure is not duplicated, just some extra fields for controling callchain state and to simplify the process of seeking thru entries (nr_rows, row_offset) were added. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-07-27perf ui: Show the scroll bar over the left window frameArnaldo Carvalho de Melo1-2/+2
So that we gain two columns and look more like classical (at least in TUIs) scroll bars bars. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-07-27perf ui: Consider the refreshed dimensions in ui_browser__showArnaldo Carvalho de Melo1-2/+4
When we call ui_browser__show we may have called ui_browser__refresh_dimensions to check if the maximum lenght for the contained entries changed, such as when zooming in and out DSOs or threads in the hist browser. For that to happen we must delete the old form, that will take care of deleting the vertical scrollbar, etc, and then recreate them, with the new dimensions. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-07-27perf hist: Introduce routine to measure lenght of formatted entryArnaldo Carvalho de Melo2-0/+30
Will be used to figure out the window width needed in the new tree widget. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-07-27perf ui: Restore SPACE as an alias to PGDN in annotateArnaldo Carvalho de Melo1-0/+1
Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>