357cfff1c2
perf hists browser: Override ui_browser refresh_dimensions method
...
This requires some more work so that we can really just use the width of
current entries when we want to partition the screen.
Right now its just a prep patch so that we can have where to update
ui_browser->rows when introducing the column headers line, that will be
togglable, so we need to update it everytime we refresh the dimensions
of the browser.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.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-ovk654rx525b4657y0mh6ku9@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-07-07 12:36:55 -03:00
ca3ff33b5c
perf hists browser: Introduce gotorc method
...
That will allow us to add a row offset to open up space for the column
headers.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.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-otc3ployokfci5qi81o7jo22@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-07-07 12:36:54 -03:00
62c95ae33f
perf ui browser: Add ->rows to disambiguate from ->height
...
The ui_browser->height is about the whole browser "window", including
any header, status lines or any other space needed for some "Yes", "No",
etc buttons a descendent browser, like hist_browser, may have.
Since the navigation is done mostly on the ui_browser methods, it needs
to know how many rows are on the screen, while details about what other
components are, say, if a header (that may be composed of multiple
lines, etc) is present.
Besides this we'll need to add a ui_browser->refresh_dimensions() hook
so that browsers like hist_browser can update ->rows in response to
screen resizes, this will come in a follow up patch.
This patch just adds ->rows and updates it when updating ->height, keeps
using ->height for the only other widget that can come with ui_browser,
the scrollbar, that goes on using all the height on the rightmost column
in the screen, using ->rows for the keyboard navigation needs.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.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-xexmwg1mv7u03j5imn66jdak@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-07-07 12:36:54 -03:00
06c654ca8b
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
...
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
User visible changes:
* Add --repeat global option to 'perf bench' to be used in benchmarks
such as the existing 'futex' one, that was modified to use it instead
of a local option. (Davidlohr Bueso)
* Fix fd -> pathname resolution in 'trace', be it using /proc or
a vfs_getname probe point. (Arnaldo Carvalho de Melo)
* Add suggestion of how to set perf_event_paranoid sysctl, to help
non-root users trying tools like 'trace' to get a working environment.
(Arnaldo Carvalho de Melo)
Fixes:
* Fix memory leak in the 'sched-messaging' perf bench test. (Davidlohr Bueso)
* The -o and -n 'perf bench mem' options are mutually exclusive, emit error
when both are specified. (Davidlohr Bueso)
* Fix scrollbar refresh row index in the ui browser, problem exposed now
that headers will be added and will be allowed to be switched on/off.
(Jiri Olsa)
Cleanups:
* Remove needless reassignments in 'trace' (Arnaldo Carvalho de Melo)
* Cache the is_exit syscall test in 'trace) (Arnaldo Carvalho de Melo)
* No need to reimplement err() in 'perf bench sched-messaging', drop barf().
(Davidlohr Bueso).
* Remove ev_name argument from perf_evsel__hists_browse, can be obtained
from the other parameters. (Jiri Olsa)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Signed-off-by: Ingo Molnar <mingo@kernel.org >
2014-06-25 07:42:24 +02:00
d755330c5e
perf tools: Fix segfault in cumulative.callchain report
...
When cumulative callchain mode is on, we could get samples with
with no actual hits. This breaks the assumption of the annotation
code, that each sample has annotation counts allocated and leads
to segfault.
Fixing this by additional checks for annotation stats.
Acked-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Arnaldo Carvalho de Melo <acme@kernel.org >
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Ingo Molnar <mingo@kernel.org >
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/r/1402821332-12419-1-git-send-email-jolsa@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-06-20 09:34:18 +02:00
dd00d486dd
perf hists browser: Remove ev_name argument from perf_evsel__hists_browse
...
Removing ev_name argument from perf_evsel__hists_browse function,
because it's not needed. We can get the name out of the 'struct
perf_evsel' which is passed as argument as well.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Ingo Molnar <mingo@kernel.org >
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/r/1403178076-14072-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2014-06-19 16:13:14 -03:00
f299842269
perf tools: Move elide bool into perf_hpp_fmt struct
...
After output/sort fields refactoring, it's expensive
to check the elide bool in its current location inside
the 'struct sort_entry'.
The perf_hpp__should_skip function gets highly noticable in
workloads with high number of output/sort fields, like for:
$ perf report -i perf-test.data -F overhead,sample,period,comm,pid,dso,symbol,cpu --stdio
Performance report:
9.70% perf [.] perf_hpp__should_skip
Moving the elide bool into the 'struct perf_hpp_fmt', which
makes the perf_hpp__should_skip just single struct read.
Got speedup of around 22% for my test perf.data workload.
The change should not harm any other workload types.
Performance counter stats for (10 runs):
before:
358,319,732,626 cycles ( +- 0.55% )
467,129,581,515 instructions # 1.30 insns per cycle ( +- 0.00% )
150.943975206 seconds time elapsed ( +- 0.62% )
now:
278,785,972,990 cycles ( +- 0.12% )
370,146,797,640 instructions # 1.33 insns per cycle ( +- 0.00% )
116.416670507 seconds time elapsed ( +- 0.31% )
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: Arnaldo Carvalho de Melo <acme@kernel.org >
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
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/20140601142622.GA9131@krava.brq.redhat.com
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-06-03 21:34:59 +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
0434ddd214
perf ui/browser: 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-12-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-06-01 14:35:01 +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
c0f1527b7e
perf report/tui: Fix a bug when --fields/sort is given
...
The hists__filter_entries() function is called when down arrow key is
pressed for navigating through the entries in TUI. It has a check for
filtering out entries that have very small overhead (under min_pcnt).
However it just assumed the entries are sorted by the overhead so when
it saw such a small overheaded entry, it just stopped navigating as an
optimization. But it's not true anymore due to new --fields and
--sort optoin behavior and this case users cannot go down to a next
entry if ther's an entry with small overhead in-between.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Link: http://lkml.kernel.org/r/1400480762-22852-14-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
c3b789527b
perf hists/tui: Count callchain rows separately
...
When TUI hist browser expands/collapses callchains it accounted number
of callchain nodes into total entries to show. However this code
ignores filtering so that it can make the cursor go to out of screen.
Thanks to Jiri Olsa for pointing out a bug (and a fix) in the code.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Link: http://lkml.kernel.org/r/1398327843-31845-12-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-04-24 16:34:27 +02:00
268397cb2a
perf top/tui: Update nr_entries properly after a filter is applied
...
The hist_browser__reset() is only called right after a filter is
applied so it needs to udpate browser->nr_entries properly. We cannot
use hists->nr_non_filtered_entreis directly since it's possible that
such entries are also filtered out by minimum percentage limit.
In addition when a filter is used for perf top, hist browser's
nr_entries field was not updated after applying the filter. But it
needs to be updated as new samples are coming.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Link: http://lkml.kernel.org/r/1398327843-31845-11-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-04-24 16:34:09 +02:00
112f761fc0
perf ui/tui: Rename hist_browser__update_nr_entries()
...
Rename ->nr_pcnt_entries and hist_browser__update_pcnt_entries() to
->nr_non_filtered_entries and hist_browser__update_nr_entries() since
it's now used for filtering as well.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Link: http://lkml.kernel.org/r/1398327843-31845-10-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-04-24 16:33:47 +02:00
c481f93011
perf ui/tui: Fix off-by-one in hist_browser__update_nr_entries()
...
The nr_entries variable is increased inside the loop in the function
but it always count the first entry regardless of it's filtered or
not; caused an off-by-one error.
It'd become a problem especially there's no entry at all - it'd get a
segfault during referencing a NULL pointer.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Link: http://lkml.kernel.org/r/1398327843-31845-9-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
2014-04-24 16:33:08 +02:00
105eb30f18
perf ui/tui: Add 'F' hotkey to toggle percentage output
...
Add 'F' hotkey to toggle relative and absolute percentage of filtered
entries.
Suggested-by: Jiri Olsa <jolsa@redhat.com >
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Link: http://lkml.kernel.org/r/1397145720-8063-7-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@redhat.com >
2014-04-16 17:16:04 +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
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
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
74cf249d5c
perf tools: Use zfree to help detect use after free bugs
...
Several areas already used this technique, so do some audit to
consistently use it elsewhere.
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-9sbere0kkplwe45ak6rk4a1f@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-12-27 17:08:19 -03:00
046625231a
perf tools: Introduce zfree
...
For the frequent idiom of:
free(ptr);
ptr = NULL;
Make it expect a pointer to the pointer being freed, so that it becomes
clear at first sight that the variable being freed is being modified.
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-pfw02ezuab37kha18wlut7ir@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-12-27 15:17:00 -03:00
6dd601354f
perf ui/tui: Implement header window
...
Implement a simple, full-screen header window which shows session header
(metadata) information. Press 'i' key to display the header window.
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: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1388036284-32342-4-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-12-26 11:22:02 -03:00
e8e684a58b
perf ui/tui: Split help message for perf top and report
...
Some hotkeys don't work for perf top so split help messages for them.
It'll be helpful to a future modification. Also sort the message by
alphabetical order of the hotkey.
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: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1388036284-32342-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-12-26 11:22:02 -03:00
d87fcb4a2d
perf evsel: Introduce perf_evsel__prev() method
...
Just one use so far, on the hists browser, for completeness since there
we use perf_evlist__{first,last} and perf_evsel__next() for handling the
TAB and UNTAB keys.
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-d09l4lejp5427enuf3igpckw@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-11-14 16:00:16 -03:00
9a354cdc2f
perf tools: Use perf_evlist__{first,last}, perf_evsel__next
...
In a few remaining places where the equivalent open coded variant was
still being used.
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-4vjnloi5fisilykwxalb5nel@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-11-14 16:00:10 -03:00
316c7136f8
perf tools: Finish the removal of 'self' arguments
...
They convey no information, perhaps I was bitten by some snake at some
point, complete the detox by naming the last of those arguments more
sensibly.
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: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-u1r0dnjoro08dgztiy2g3t2q@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-11-05 15:32:36 -03:00
b9c5143a01
perf tools: Use an accessor to read thread comm
...
As the thread comm is going to be implemented by way of a more
complicated data structure than just a pointer to a string from the
thread struct, convert the readers of comm to use an accessor instead of
accessing it directly.
The accessor will be later overriden to support an enhanced comm
implementation.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com >
Tested-by: Jiri Olsa <jolsa@redhat.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Ingo Molnar <mingo@elte.hu >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-wr683zwy94hmj4ibogmnv9ce@git.kernel.org
[ Rename thread__comm_curr() to thread__comm_str() ]
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
[ Fixed up some minor const pointer issues ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-11-04 11:50:28 -03:00
2b8bfa6bb8
perf tools: Centralize default columns init in perf_hpp__init
...
Now when diff command is separated from other standard outputs,
we can use perf_hpp__init to initialize all standard columns.
Moving PERF_HPP__OVERHEAD column init back to perf_hpp__init,
and removing extra enable calls.
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-nj2xk89tj972tbqswfs498ex@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-07-12 13:53:59 -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
380512345e
perf tools: struct thread has a tid not a pid
...
As evident from 'machine__process_fork_event()' and
'machine__process_exit_event()' the 'pid' member of struct thread is
actually the tid.
Rename 'pid' to 'tid' in struct thread accordingly.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: David Ahern <dsahern@gmail.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Ingo Molnar <mingo@kernel.org >
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/r/1372944040-32690-13-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-07-12 13:53:50 -03:00
fa5df94350
perf top: Add --percent-limit option
...
The --percent-limit option is for not showing small overhead entries in
the output.
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-8-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-05-28 16:24:01 +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
9c796ec8db
perf hists browser: Use sort__has_sym
...
The TUI hist browser had a similar variable has_symbols for the same
purpose. Let's get rid of the duplication.
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: 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/1365125198-8334-9-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-05-28 16:23:56 +03:00
55369fc179
perf sort: Introduce sort__mode variable
...
It's used for determining current sort mode which can be one of
NORMAL, BRANCH and new MEMORY.
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: 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/1364816125-12212-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-05-28 16:23:53 +03:00
6692c262df
perf tools: Remove dependency on libnewt
...
Now that the map browser shares the input routine with the hists
browser, there is no need for using any libnewt routine, so remove all
traces except for honouring NO_NEWT=1 on the makefile command line as an
indication that TUI support is not needed, in fact it just sets
NO_SLANG=1.
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-wae5o7xca9m52bj1re28jc5j@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-04-01 12:23:21 -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
db8fd07a54
perf annotate: Pass evsel instead of evidx on annotation functions
...
Pass evsel instead of evidx. This is a preparation for supporting event
group view in annotation and no functional change is intended.
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-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-03-15 13:06:04 -03:00
341487ab56
perf hists browser: Add option for runtime switching perf data file
...
Based on perf report/top/scripts browser integration idea from acme.
This will enable user to runtime switch the data file, when this option
is selected, it will popup all the legal data files in current working
directory, and the filename selected by user is saved in the global
variable "input_name", and a new key 'K_SWITCH_INPUT_DATA' will be
passed back to the built-in command which will perform the switch.
This initial version only enables it for 'perf report'.
v2: rebase to latest 'perf/core' branch (6e1d4dd) of acme's perf tree
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/1359873501-24541-1-git-send-email-feng.tang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-02-06 18:09:24 -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
371d8c402e
perf hists browser: Add suppport for event group view
...
Show group members' overhead also when showing the 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: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/r/1358845787-1350-12-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-01-31 13:07:47 -03:00
897014603c
perf hists browser: Move coloring logic to hpp functions
...
Move coloring logic into the hpp functions so that each value can
be colored independently. It'd required for event group view.
For overhead column, add a callback for printing 'folded_sign' of
callchains of a hist entry.
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Cc: Ingo Molnar <mingo@kernel.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1358845787-1350-11-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-01-31 13:07:47 -03:00
5aed9d2493
perf hists 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: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/r/1358845787-1350-8-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2013-01-31 13:07:46 -03:00
1240005e0d
perf hists: Introduce perf_hpp__list for period related columns
...
Adding perf_hpp__list list to register and contain all period related
columns the command is interested in.
This way we get rid of static array holding all possible columns and
enable commands to register their own columns.
It'll be handy for diff command in future to process and display data
for multiple files.
Signed-off-by: Jiri Olsa <jolsa@redhat.com >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Ingo Molnar <mingo@elte.hu >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Link: http://lkml.kernel.org/n/tip-kiykge4igrcl7etmpmveto1h@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-12-09 08:46:05 -03:00
68d807586b
perf report: Postpone objdump check until annotation requested
...
David reported that current perf report refused to run on a data file
captured from a different machine because of objdump.
Since the objdump tools won't be used unless annotation was requested,
checking its presence at init time doesn't make sense.
Reported-by: David Ahern <dsahern@gmail.com >
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Reviewed-by: David Ahern <dsahern@gmail.com >
Tested-by: 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-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-11-05 14:03:58 -03:00
9783adf777
perf tools: Introduce struct hist_browser_timer
...
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-11-05 14:03:58 -03:00
c77d8d7030
perf browser: Don't show scripts menu for 'perf top'
...
As 'perf top' has no data files to run scripts against. Also add a
is_report_browser() helper function to judge whether the running browser
is for 'perf report'.
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/1351699257-5102-1-git-send-email-feng.tang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2012-10-31 16:14:19 -02:00