4a62109fe9
perf ui/gtk: Reuse generic __hpp__fmt() code
...
The __hpp__color_fmt used in the gtk code can be replace by the generic
code with small change in print_fn callback.
This is a preparation to upcoming changes and no functional changes
intended.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Pekka Enberg <penberg@kernel.org >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.com >
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/1393809254-4480-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-03-14 18:08:38 -03:00
0050f7aa18
perf evlist: Introduce evlist__for_each() & friends
...
For the common evsel list traversal, so that it becomes more compact.
Use the opportunity to start ditching the 'perf_' from 'perf_evlist__',
as discussed, as the whole conversion touches a lot of places, lets do
it piecemeal when we have the chance due to other work, like in this
case.
Cc: Adrian Hunter <adrian.hunter@intel.com >
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@kernel.org >
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-qnkx7dzm2h6m6uptkfk03ni6@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-01-13 10:06:25 -03:00
d50bf78ff6
perf ui/gtk: Fix segmentation fault on perf_hpp__for_each_format loop
...
The commit 2b8bfa6bb8
("perf tools: Centralize default columns init in
perf_hpp__init") moves initialization of common overhead column to
perf_hpp__init() but forgot about the gtk code.
So the gtk code added the same column to the list twice causing infinite
loop when iterating it by perf_hpp__for_each_format loop. When I run
perf report --gtk, I can see following messages indefinitely.
(perf:11687): Gtk-CRITICAL **: IA__gtk_main_quit: assertion 'main_loops != NULL' failed
perf: Segmentation fault
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Reviewed-by: Pekka Enberg <penberg@kernel.org >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: Christoph Hellwig <hch@infradead.org >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.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/1375766056-19377-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-08-07 17:35:39 -03:00
2c5d4b4a08
perf tools: Add struct perf_hpp_fmt into hpp callbacks
...
Adding 'struct perf_hpp_fmt' into hpp callbacks, so commands can access
their private data.
It'll be handy for diff command in future to be able to access file
related data for each column.
Signed-off-by: Jiri Olsa <jolsa@redhat.com >
Reviewed-by: Namhyung Kim <namhyung@kernel.org >
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/n/tip-7vy2m18574b1bicoljn8e9lw@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-07-12 13:53:57 -03:00
9d58d2f66c
perf gtk/hists: Set rules hint for the hist browser
...
The 'rules' means that every second line of the tree view has a shaded
background, which makes it easier to see which cell belongs to which
row in the tree view. It can be useful for a tree view that has a lot
of rows.
Reviewed-by: Pekka Enberg <penberg@kernel.org >
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.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/1370337737-30812-7-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-07-12 13:52:45 -03:00
450f390ad2
perf gtk/hists: Add a double-click handler for callchains
...
If callchain is displayed, add "row-activated" signal handler for
handling double-click or pressing ENTER key action.
Reviewed-by: Pekka Enberg <penberg@kernel.org >
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.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/1370337737-30812-6-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-07-12 13:52:43 -03:00
1a309426b4
perf gtk/hists: Make column headers resizable
...
Sometimes it's annoying to see when some symbols have very wierd long
names. So it might be a good idea to make column size changable.
Reviewed-by: Pekka Enberg <penberg@kernel.org >
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.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/1370337737-30812-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-07-12 13:52:42 -03:00
cc60f24e22
perf gtk/hists: Display callchain overhead also
...
Display callchain percent value in the overhead column.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Reviewed-by: Pekka Enberg <penberg@kernel.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.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/1370337737-30812-4-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-07-12 13:52:40 -03:00
2bbc587425
perf gtk/hists: Add support for callchains
...
Display callchain information in the symbol column. It's only enabled
when recorded with -g and has symbol sort key.
Reviewed-by: Pekka Enberg <penberg@kernel.org >
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.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/1370337737-30812-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-07-12 13:52:38 -03:00
f1d9a53055
perf gtk/hists: Use GtkTreeStore instead of GtkListStore
...
The GtkTreeStore can save items in a tree-like way. This is a
preparation for supporting callgraphs in the hist browser.
Reviewed-by: Pekka Enberg <penberg@kernel.org >
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.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/1370337737-30812-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-07-12 13:52:36 -03:00
064f19815c
perf report: Add --percent-limit option
...
The --percent-limit option is for not showing small overhead entries in
the output. Maybe we want to set a certain default value like 0.1.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Pekka Enberg <penberg@kernel.org >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/r/1368497347-9628-7-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-05-28 16:24:01 +03:00
759ff497e0
perf evsel: Introduce perf_evsel__is_group_event() helper
...
The perf_evsel__is_group_event function is for checking whether given
evsel needs event group view support or not. Please note that it's
different to the existing perf_evsel__is_group_leader() which checks
only the given evsel is a leader or a standalone (i.e. non-group) event
regardless of event group feature.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.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/1362462812-30885-7-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-03-15 13:06:05 -03:00
717e263fc3
perf report: Show group description when event group is enabled
...
When using event group viewer, it's better to show the group description
rather than the leader information alone.
If a leader did not contain any member, it's a non-group event.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Jiri Olsa <jolsa@redhat.com >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/r/1358845787-1350-17-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-01-31 13:07:48 -03:00
fc24d7c25c
perf report: Bypass non-leader events when event group is enabled
...
Since we have all necessary information in the leader events and other
members don't, bypass members. Member events will be shown along with
the leaders if event group is enabled.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Jiri Olsa <jolsa@redhat.com >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/r/1358845787-1350-16-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-01-31 13:07:48 -03:00
34b9564373
perf gtk/browser: Trim column header string when event group enabled
...
When event group feature is enabled, each column header is expanded to
match with the whole group column width. But this is not needed for
GTK+ browser since ti usually use variable-width fonts. So trim it.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/r/1358845787-1350-15-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-01-31 13:07:48 -03:00
cb16008bcc
perf gtk/browser: Add support for event group view
...
Show group members's overhead also when showing leader's if event
group is enabled.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Stephane Eranian <eranina@google.com >
Link: http://lkml.kernel.org/r/1358845787-1350-13-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-01-31 13:07:47 -03:00
843985e953
perf gtk/browser: Convert hpp helpers to a function
...
The hpp helpers do same job for each field so it was implemented as
macro in order to access those fields easily. But it gets cumbersome to
maintain a large function in a macro as the function grows. Factor it
out to a function with a little helper macro to access field.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/r/1358845787-1350-9-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-01-31 13:07:46 -03:00
6bf1a295a8
perf ui/gtk: Setup browser window early
...
The ui__error/warning functions use gtk infobar or statusbar and pr_*
functions use statusbar too. But after perf gtk context created but
those infobar and/or statusbar not yet set up, calling one of those
functions will get a segment fault.
Although current code has no problem, move these setting as early as
possible so that it can prevent the segfault from future change.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Cc: Ingo Molnar <mingo@kernel.org >
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/1356078018-31905-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-01-24 16:40:16 -03:00
0da41ce954
perf ui/gtk: Factor out common browser routines
...
Separate out common codes for setting up a browser, and move report/hist
browser codes into hists.c. The common codes can be used for annotation
browser.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Cc: Ingo Molnar <mingo@kernel.org >
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/1356078018-31905-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-01-24 16:40:16 -03:00