9607ad3a63
perf tools: Add signal.h to places using its definitions
...
And remove it from util.h, disentangling it a bit more.
Link: http://lkml.kernel.org/n/tip-2zg9s5nx90yde64j3g4z2uhk@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2017-04-20 13:22:43 -03:00
a067558e2f
perf tools: Move extra string util functions to util/string2.h
...
Moving them from util.h, where they don't belong. Since libc already
have string.h, name it slightly differently, as string2.h.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/n/tip-eh3vz5sqxsrdd8lodoro4jrw@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2017-04-19 13:01:51 -03:00
29659ab4e7
perf hists: Add support for header span
...
Add span argument for header callback function.
The handling of this argument is completely in the hands of the
callback. The only thing the caller ensures is it's zeroed on the
beginning.
Omitting span skipping in hierarchy headers and gtk code.
The c2c code use this to span header lines based on the entries span
configuration.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1470583710-1649-6-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-08-23 15:37:33 -03:00
74bb43f29e
perf hists: Add line argument into perf_hpp_fmt's header callback
...
Adding line argument into perf_hpp_fmt's header callback to be able to
request specific header line.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1470583710-1649-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-08-23 15:37:33 -03:00
e5cadb93d0
perf evlist: Rename for_each() macros to for_each_entry()
...
To match the semantics for list.h in the kernel, that are used to
implement those macros.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Milian Wolff <milian.wolff@kdab.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Taeung Song <treeze.taeung@gmail.com >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/n/tip-qbcjlgj0ffxquxscahbpddi3@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-06-23 11:26:15 -03:00
0537217360
perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback
...
Replacing perf_evsel arg perf_hpp_fmt's header callback with hists
object.
None of the actual callbacks actually use evsel object, also this will
be helpful in future for non evsel related hist browsers.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1465928361-2442-10-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-06-15 10:49:18 -03:00
2e0453af4e
perf hists: Move sort__has_sym into struct perf_hpp_list
...
Now we have sort dimensions private for struct hists, we need to make
dimension booleans hists specific as well.
Moving sort__has_sym into struct perf_hpp_list.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1462276488-26683-4-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-05-05 21:03:59 -03:00
b8f8eb84f4
perf tools: Remove misplaced __maybe_unused
...
All over the tree.
Cc: David Ahern <dsahern@gmail.com >
cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com >
Link: http://lkml.kernel.org/n/tip-8nzhnokxyp8y4v7gf0j00oyb@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-03-23 12:03:04 -03:00
58ecd33be9
perf report: Use hierarchy hpp list on gtk
...
Now hpp formats are linked using perf_hpp_list_node when hierarchy is
enabled. Like in stdio, use this info to print entries with multiple
sort keys in a single hierarchy properly.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/r/1457361308-514-8-git-send-email-namhyung@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org >
2016-03-08 10:11:21 +01:00
1b2dbbf41a
perf hists: Use own hpp_list for hierarchy mode
...
Now each hists has its own hpp lists in hierarchy. So instead of having
a pointer to a single perf_hpp_fmt in a hist entry, make it point the
hpp_list for its level. This will be used to support multiple sort keys
in a single hierarchy level.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/r/1457361308-514-3-git-send-email-namhyung@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org >
2016-03-08 10:11:19 +01:00
2ddda79237
perf report: Show message for percent limit on gtk
...
Like the stdio, it should show messages about omitted hierarchy
entries. Please refer the previous commit for more details.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/r/1456488800-28124-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-02-26 11:20:36 -03:00
e311ec1e5d
perf ui/gtk: Implement hierarchy output mode
...
The hierarchy output mode is to group entries for each level so that
user can see higher level picture more easily.
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: Jiri Olsa <jolsa@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/r/1456326830-30456-16-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-02-24 20:21:14 -03:00
f0786af536
perf hists: Introduce hists__for_each_format macro
...
With the hist object having the perf_hpp_list we can now iterate output
format entries based in the hists object. Adding hists__for_each_format
macro to do that.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1453109064-1026-26-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-02-03 12:24:19 -03:00
cf094045d7
perf hists: Introduce perf_hpp_list__for_each_format macro
...
Introducing perf_hpp_list__for_each_format macro to iterate
perf_hpp_list object's output entries.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1453109064-1026-20-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-02-03 12:24:14 -03:00
361459f163
perf tools: Skip dynamic fields not defined for current event
...
When there are multiple events, each dynamic sort key is defined just
for one event. In this case other events will always show "N/A" for
those fields. But they are meaningless and consume precious screen
width.
Let's skip those undefined dynamic fields.
$ perf record -e kmem:kmalloc,kmem:kfree -a sleep 1
$ perf report -s 'comm,kmalloc.*' --stdio
# To display the perf.data header info, please use --header/--header-only options.
#
#
# Total Lost Samples: 0
#
# Samples: 20K of event 'kmem:kmalloc'
# Event count (approx.): 20533
#
# Overhead Command call_site ptr bytes_req bytes_alloc gfp_flags
# ........ ....... .................. .................. ......... ........... ...................
#
99.89% perf ffffffffa01d4396 0xffff8803ffb79720 96 96 GFP_NOFS|GFP_ZERO
0.06% sleep ffffffff8114e1cd 0xffff8803d228a000 4096 4096 GFP_KERNEL
0.03% perf ffffffff811d6ae6 0xffff8803f7678f00 240 256 GFP_KERNEL|GFP_ZERO
0.00% perf ffffffff812263c1 0xffff880406172380 128 128 GFP_KERNEL
0.00% perf ffffffff812264b9 0xffff8803ffac1600 504 512 GFP_KERNEL
0.00% perf ffffffff81226634 0xffff880401dc5280 28 32 GFP_KERNEL
0.00% sleep ffffffff81226da9 0xffff8803ffac3a00 392 512 GFP_KERNEL
# Samples: 20K of event 'kmem:kfree'
# Event count (approx.): 20597
#
# Overhead Command
# ........ ..............
#
99.63% perf
0.14% sleep
0.11% irq/36-iwlwifi
0.11% kworker/u16:0
0.01% Xorg
0.00% firefox
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/r/1450804030-29193-12-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-01-06 20:11:12 -03:00
2c6caff2b2
perf ui/gtk: Support folded callchains
...
The folded callchain mode is to print all chains in a single line.
Currently perf report --gtk doesn't support folded callchains. Like
flat callchains, only leaf nodes are added to the final rbtree so it
should show entries in parent nodes.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Tested-by: Brendan Gregg <brendan.d.gregg@gmail.com >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Kan Liang <kan.liang@intel.com >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1447047946-1691-11-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-11-19 13:19:26 -03:00
3cd99dfd1c
perf ui/gtk: Support flat callchains
...
The flat callchain mode is to print all chains in a simple flat
hierarchy so make it easy to see.
Currently perf report --gtk doesn't show flat callchains properly. With
flat callchains, only leaf nodes are added to the final rbtree so it
should show entries in parent nodes. To do that, add parent_val list to
struct callchain_node and show them along with the (normal) val list.
See the previous commit on TUI support for more information.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Tested-by: Brendan Gregg <brendan.d.gregg@gmail.com >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Kan Liang <kan.liang@intel.com >
Cc: Pekka Enberg <penberg@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1447047946-1691-10-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-11-19 13:19:25 -03:00
5ab250cafc
perf callchain: Abstract callchain print function
...
This is a preparation to support for printing other type of callchain
value like count or period.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Tested-by: Brendan Gregg <brendan.d.gregg@gmail.com >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Kan Liang <kan.liang@intel.com >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1447047946-1691-4-git-send-email-namhyung@kernel.org
[ renamed new _sprintf_ operation to _scnprintf_ ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-11-19 13:19:22 -03:00
2989ccaac4
perf callchain: Use a common function to resolve symbol or name
...
Refactor the duplicated code to resolve the symbol name or
the address of a symbol into a single function.
Used in next patch to add common functionality.
Signed-off-by: Andi Kleen <ak@linux.intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Link: http://lkml.kernel.org/r/1415844328-4884-6-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-11-19 12:33:47 -03:00
4ea062ed43
perf evsel: Add hists helper
...
Not all tools need a hists instance per perf_evsel, so lets pave the way
to remove evsel->hists while leaving a way to access the hists from a
specially allocated evsel, one that comes with space at the end where
lives the evsel.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jean Pihet <jean.pihet@linaro.org >
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-qlktkhe31w4mgtbd84035sr2@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-10-09 13:13:41 -03:00
1ecd44533a
perf tools: Add name field into perf_hpp_fmt
...
It makes the code a bit simpler and easier to debug IMHO.
I guess it can also remove similar code in perf diff, but let's keep
it for a future work. :)
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
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: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1406785662-5534-7-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-08-12 12:03:07 -03:00
5b59166960
perf report: Honor column width setting
...
Set column width and do not change it if user gives -w/--column-widths
option. It'll truncate longer symbols than the width if exists.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
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: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1406785662-5534-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-08-12 12:03:06 -03:00
d675107ce6
perf tools: Make __hpp__fmt() receive an additional len argument
...
So that it can properly handle alignment requirements later. To do
that, add percent_color_len_snprintf() fucntion to help coloring of
overhead columns.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
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: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1406785662-5534-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-08-12 12:03:05 -03:00
e4cf6f886f
perf ui/gtk: Fix callchain display
...
With current output field change, GTK browser cannot display callchain
information correctly since it couldn't determine where the symbol
column is. This is a problem - just for now I changed to use the last
column since it'll work for most cases.
Also it has a same problem of the percentage as stdio code.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Cc: Arun Sharma <asharma@fb.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Link: http://lkml.kernel.org/r/1401335910-16832-25-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-06-01 14:35:09 +02:00
14135663f1
perf tools: Apply percent-limit to cumulative percentage
...
If -g cumulative option is given, it needs to show entries which don't
have self overhead. So apply percent-limit to accumulated overhead
percentage in this case.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Tested-by: Arun Sharma <asharma@fb.com >
Tested-by: Rodrigo Campos <rodrigo@sdfg.com.ar >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Link: http://lkml.kernel.org/r/1401335910-16832-14-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-06-01 14:35:02 +02:00
b09955b2a3
perf ui/gtk: Add support to accumulated hist stat
...
Print accumulated stat of a hist entry if requested.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Tested-by: Arun Sharma <asharma@fb.com >
Tested-by: Rodrigo Campos <rodrigo@sdfg.com.ar >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Link: http://lkml.kernel.org/r/1401335910-16832-13-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-06-01 14:35:02 +02:00
e67d49a72d
perf tools: Skip elided sort entries
...
When it converted sort entries to hpp formats, it missed se->elide
handling, so add it for compatibility.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Link: http://lkml.kernel.org/r/1400480762-22852-16-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-21 11:45:36 +02:00
22af969e8c
perf tools: Call perf_hpp__init() before setting up GUI browsers
...
So that it can be set properly prior to set up output fields. That
makes easy to handle/warn errors during the setup since it doesn't
need to be bothered with the GUI.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Link: http://lkml.kernel.org/r/1400480762-22852-11-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-21 11:45:35 +02:00
fb821c9e71
perf ui: Get rid of callback from __hpp__fmt()
...
The callback was used by TUI for determining color of folded sign
using percent of first field/column. But it cannot be used anymore
since it now support dynamic reordering of output field.
So move the logic to the hist_browser__show_entry().
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Ingo Molnar <mingo@kernel.org >
Link: http://lkml.kernel.org/r/1400480762-22852-8-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-21 11:45:34 +02:00
26d8b33827
perf tools: Consolidate output field handling to hpp format routines
...
Until now the hpp and sort functions do similar jobs different ways.
Since the sort functions converted/wrapped to hpp formats it can do
the job in a uniform way.
The perf_hpp__sort_list has a list of hpp formats to sort entries and
the perf_hpp__list has a list of hpp formats to print output result.
To have a backward compatibility, it automatically adds 'overhead'
field in front of sort list. And then all of fields in sort list
added to the output list (if it's not already there).
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Ingo Molnar <mingo@kernel.org >
Link: http://lkml.kernel.org/n/tip-7g3h86woz2sckg3h1lj42ygj@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-05-21 11:45:34 +02:00
f214833054
perf report: Add --percentage option
...
The --percentage option is for controlling overhead percentage
displayed. It can only receive either of "relative" or "absolute".
"relative" means it's relative to filtered entries only so that the
sum of shown entries will be always 100%. "absolute" means it retains
the original value before and after the filter is applied.
$ perf report -s comm
# Overhead Command
# ........ ............
#
74.19% cc1
7.61% gcc
6.11% as
4.35% sh
4.14% make
1.13% fixdep
...
$ perf report -s comm -c cc1,gcc --percentage absolute
# Overhead Command
# ........ ............
#
74.19% cc1
7.61% gcc
$ perf report -s comm -c cc1,gcc --percentage relative
# Overhead Command
# ........ ............
#
90.69% cc1
9.31% gcc
Note that it has zero effect if no filter was applied.
Suggested-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net >
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Link: http://lkml.kernel.org/r/1397145720-8063-3-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@redhat.com >
2014-04-16 17:16:03 +02:00
94a0793ddf
perf ui hists: Pass evsel to hpp->header/width functions explicitly
...
Those functions need evsel to investigate event group and it's passed
via hpp->ptr. However as it can be missed easily so it's better to
pass it via an argument IMHO.
Signed-off-by: Namhyung Kim <namhyung@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: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1394437440-11609-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-03-14 18:08:40 -03:00
2f6d9009af
perf ui/tui: Reuse generic __hpp__fmt() code
...
The __hpp__color_fmt used in the TUI code can be replace by the generic
code with small change in print_fn callback. And it also needs to move
callback function to the generic __hpp__fmt().
No functional changes intended.
Signed-off-by: Namhyung Kim <namhyung@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: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1393809254-4480-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-03-14 18:08:39 -03:00
a0088adcd6
perf ui/hists: Pass struct hpp to print functions
...
Instead of the pointer to buffer and its size so that it can also get
private argument passed along with hpp.
This is a preparation of further change.
Signed-off-by: Namhyung Kim <namhyung@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: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1393809254-4480-4-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-03-14 18:08:38 -03:00
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