Ian Rogers
38f83cc9ab
perf top: Switch user option to use BPF filter
...
Finding user processes by scanning /proc is inherently racy and
results in perf_event_open failures. Use a BPF filter to drop samples
where the uid doesn't match.
Signed-off-by: Ian Rogers <[email protected] >
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Namhyung Kim <[email protected] >
2025-06-09 11:18:18 -07:00
Ian Rogers
3e0594f9f0
perf top: Avoid repeated function calls to perf_cpu_map__nr().
...
Add a local variable to avoid repeated calls to perf_cpu_map__nr().
Reviewed-by: James Clark <[email protected] >
Signed-off-by: Adrian Hunter <[email protected] >
Signed-off-by: Ian Rogers <[email protected] >
Acked-by: Adrian Hunter <[email protected] >
Acked-by: Namhyung Kim <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Alexandre Ghiti <[email protected] >
Cc: Andrew Jones <[email protected] >
Cc: André Almeida <[email protected] >
Cc: Athira Rajeev <[email protected] >
Cc: Atish Patra <[email protected] >
Cc: Changbin Du <[email protected] >
Cc: Darren Hart <[email protected] >
Cc: Davidlohr Bueso <[email protected] >
Cc: Huacai Chen <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: John Garry <[email protected] >
Cc: K Prateek Nayak <[email protected] >
Cc: Kajol Jain <[email protected] >
Cc: Kan Liang <[email protected] >
Cc: Leo Yan <[email protected] >
Cc: Mark Rutland <[email protected] >
Cc: Mike Leach <[email protected] >
Cc: Nick Desaulniers <[email protected] >
Cc: Paolo Bonzini <[email protected] >
Cc: Paran Lee <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Ravi Bangoria <[email protected] >
Cc: Sandipan Das <[email protected] >
Cc: Sean Christopherson <[email protected] >
Cc: Steinar H. Gunderson <[email protected] >
Cc: Suzuki Poulouse <[email protected] >
Cc: Thomas Gleixner <[email protected] >
Cc: Will Deacon <[email protected] >
Cc: Yang Jihong <[email protected] >
Cc: Yang Li <[email protected] >
Cc: Yanteng Si <[email protected] >
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2023-12-18 21:34:39 -03:00
Ian Rogers
ea0c52399d
perf util: Move perf_guest/host declarations
...
The definitions are in util.c so move the declarations to match.
Signed-off-by: Ian Rogers <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Athira Rajeev <[email protected] >
Cc: Chengdong Li <[email protected] >
Cc: Denis Nikitin <[email protected] >
Cc: Florian Fischer <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: James Clark <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: John Garry <[email protected] >
Cc: Kan Liang <[email protected] >
Cc: Leo Yan <[email protected] >
Cc: Mark Rutland <[email protected] >
Cc: Martin Liška <[email protected] >
Cc: Mathieu Poirier <[email protected] >
Cc: Mike Leach <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Raul Silvera <[email protected] >
Cc: Ravi Bangoria <[email protected] >
Cc: Rob Herring <[email protected] >
Cc: Sean Christopherson <[email protected] >
Cc: Suzuki Poulouse <[email protected] >
Cc: Will Deacon <[email protected] >
Cc: Xing Zhengjun <[email protected] >
Cc: [email protected]
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2023-04-10 19:22:05 -03:00
Ian Rogers
0df6ade711
perf evlist: Rename cpus to user_requested_cpus
...
evlist contains cpus and all_cpus. all_cpus is the union of the cpu maps
of all evsels.
For non-task targets, cpus is set to be cpus requested from the command
line, defaulting to all online cpus if no cpus are specified.
For an uncore event, all_cpus may be just CPU 0 or every online CPU.
This causes all_cpus to have fewer values than the cpus variable which
is confusing given the 'all' in the name.
To try to make the behavior clearer, rename cpus to user_requested_cpus
and add comments on the two struct variables.
Signed-off-by: Ian Rogers <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Alexander Antonov <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Alexei Starovoitov <[email protected] >
Cc: Alexey Bayduraev <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: Andrii Nakryiko <[email protected] >
Cc: Daniel Borkmann <[email protected] >
Cc: German Gomez <[email protected] >
Cc: James Clark <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: John Fastabend <[email protected] >
Cc: John Garry <[email protected] >
Cc: KP Singh <[email protected] >
Cc: Kajol Jain <[email protected] >
Cc: Leo Yan <[email protected] >
Cc: Mark Rutland <[email protected] >
Cc: Martin KaFai Lau <[email protected] >
Cc: Mathieu Poirier <[email protected] >
Cc: Mike Leach <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Riccardo Mancini <[email protected] >
Cc: Song Liu <[email protected] >
Cc: Stephane Eranian <[email protected] >
Cc: Suzuki Poulouse <[email protected] >
Cc: Will Deacon <[email protected] >
Cc: Yonghong Song <[email protected] >
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2022-04-01 16:19:35 -03:00
Ian Rogers
4402869939
perf cpumap: Migrate to libperf cpumap api
...
Switch from directly accessing the perf_cpu_map to using the appropriate
libperf API when possible. Using the API simplifies the job of
refactoring use of perf_cpu_map.
Signed-off-by: Ian Rogers <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Alexey Bayduraev <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: Andrew Morton <[email protected] >
Cc: André Almeida <[email protected] >
Cc: Andy Shevchenko <[email protected] >
Cc: Darren Hart <[email protected] >
Cc: Davidlohr Bueso <[email protected] >
Cc: Dmitriy Vyukov <[email protected] >
Cc: Eric Dumazet <[email protected] >
Cc: German Gomez <[email protected] >
Cc: James Clark <[email protected] >
Cc: Jin Yao <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: John Garry <[email protected] >
Cc: Kajol Jain <[email protected] >
Cc: Kan Liang <[email protected] >
Cc: Leo Yan <[email protected] >
Cc: Madhavan Srinivasan <[email protected] >
Cc: Mark Rutland <[email protected] >
Cc: Masami Hiramatsu <[email protected] >
Cc: Miaoqian Lin <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Riccardo Mancini <[email protected] >
Cc: Shunsuke Nakamura <[email protected] >
Cc: Song Liu <[email protected] >
Cc: Stephane Eranian <[email protected] >
Cc: Stephen Brennan <[email protected] >
Cc: Steven Rostedt (VMware) <[email protected] >
Cc: Thomas Gleixner <[email protected] >
Cc: Thomas Richter <[email protected] >
Cc: Yury Norov <[email protected] >
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2022-01-22 17:08:42 -03:00
Arnaldo Carvalho de Melo
8ab2e96d8f
perf evsel: Rename *perf_evsel__*name() to *evsel__*name()
...
As they are 'struct evsel' methods or related routines, not part of
tools/lib/perf/, aka libperf, to whom the perf_ prefix belongs.
Cc: Adrian Hunter <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: Namhyung Kim <[email protected] >
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2020-05-05 16:35:30 -03:00
Jiri Olsa
515dbe48f6
libperf: Add perf_evlist__first()/last() functions
...
Add perf_evlist__first()/last() functions to libperf, as internal
functions and rename perf's origins to evlist__first/last.
Signed-off-by: Jiri Olsa <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Michael Petlan <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2019-09-25 09:51:48 -03:00
Arnaldo Carvalho de Melo
87ffb6c640
perf env: Remove needless cpumap.h header
...
Only a 'struct perf_cmp_map' forward allocation is necessary, fix the
places that need the header but were getting it indirectly, by luck,
from env.h.
Cc: Adrian Hunter <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: Namhyung Kim <[email protected] >
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2019-09-20 09:19:21 -03:00
Arnaldo Carvalho de Melo
c1a604dff4
perf tools: Remove needless perf.h include directive from headers
...
Its not needed there, add it to the places that need it and were getting
it via those headers.
Cc: Adrian Hunter <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: Namhyung Kim <[email protected] >
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2019-08-29 17:38:32 -03:00
Jiri Olsa
f72f901d90
libperf: Add cpus to struct perf_evlist
...
Move cpus from tools/perf's evlist to libperf's perf_evlist struct.
Committer notes:
Fixed up this one:
tools/perf/arch/arm/util/cs-etm.c
Signed-off-by: Jiri Olsa <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Alexey Budankov <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: Michael Petlan <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2019-07-29 18:34:45 -03:00
Jiri Olsa
1fc632cef4
libperf: Move perf_event_attr field from perf's evsel to libperf's perf_evsel
...
Move the perf_event_attr struct fron 'struct evsel' to 'struct perf_evsel'.
Committer notes:
Fixed up these:
tools/perf/arch/arm/util/auxtrace.c
tools/perf/arch/arm/util/cs-etm.c
tools/perf/arch/arm64/util/arm-spe.c
tools/perf/arch/s390/util/auxtrace.c
tools/perf/util/cs-etm.c
Also
cc1: warnings being treated as errors
tests/sample-parsing.c: In function 'do_test':
tests/sample-parsing.c:162: error: missing initializer
tests/sample-parsing.c:162: error: (near initialization for 'evsel.core.cpus')
struct evsel evsel = {
.needs_swap = false,
- .core.attr = {
- .sample_type = sample_type,
- .read_format = read_format,
+ .core = {
+ . attr = {
+ .sample_type = sample_type,
+ .read_format = read_format,
+ },
[perfbuilder@a70e4eeb5549 /]$ gcc --version |& head -1
gcc (GCC) 4.4.7
Also we don't need to include perf_event.h in
tools/perf/lib/include/perf/evsel.h, forward declaring 'struct
perf_event_attr' is enough. And this even fixes the build in some
systems where things are used somewhere down the include path from
perf_event.h without defining __always_inline.
Signed-off-by: Jiri Olsa <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Alexey Budankov <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: Michael Petlan <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2019-07-29 18:34:45 -03:00
Jiri Olsa
6484d2f9dc
libperf: Add nr_entries to struct perf_evlist
...
Move nr_entries count from 'struct perf' to into perf_evlist struct.
Committer notes:
Fix tools/perf/arch/s390/util/auxtrace.c case. And also the comment in
tools/perf/util/annotate.h.
Signed-off-by: Jiri Olsa <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Alexey Budankov <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: Michael Petlan <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2019-07-29 18:34:45 -03:00
Jiri Olsa
32dcd021d0
perf evsel: Rename struct perf_evsel to struct evsel
...
Rename struct perf_evsel to struct evsel, so we don't have a name clash
when we add struct perf_evsel in libperf.
Committer notes:
Added fixes for arm64, provided by Jiri.
Signed-off-by: Jiri Olsa <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Alexey Budankov <[email protected] >
Cc: Andi Kleen <[email protected] >
Cc: Michael Petlan <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2019-07-29 18:34:42 -03:00
Thomas Gleixner
910070454e
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 251
...
Based on 1 normalized pattern(s):
released under the gpl v2 and only v2 not any later version
extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-only
has been chosen to replace the boilerplate/reference in 12 file(s).
Signed-off-by: Thomas Gleixner <[email protected] >
Reviewed-by: Steve Winslow <[email protected] >
Reviewed-by: Alexios Zavras <[email protected] >
Reviewed-by: Kate Stewart <[email protected] >
Reviewed-by: Allison Randal <[email protected] >
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected] >
2019-06-05 17:30:26 +02:00
Jiri Olsa
8aa5c8eddc
perf top: Move perf_top__reset_sample_counters() to after counts display
...
Move the perf_top__reset_sample_counters() call to right after we
display the counters so we can see the updated numbers for longer.
Signed-off-by: Jiri Olsa <[email protected] >
Acked-by: David S. Miller <[email protected] >
Acked-by: Namhyung Kim <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2018-12-17 14:58:47 -03:00
Jiri Olsa
97f7e0b33d
perf top: Save and display the drop count stats
...
Add drop count to 'perf top' headers:
# perf top --stdio
PerfTop: 3549 irqs/sec kernel:51.8% exact: 100.0% lost: 0/0 drop: 0/0 [4000Hz cycles:ppp], (all, 8 CPUs)
# perf top
Samples: 0 of event 'cycles:ppp', 4000 Hz, Event count (approx.): 0 lost: 0/0 drop: 0/0
The format is: <current period drop>/<total drop>
Signed-off-by: Jiri Olsa <[email protected] >
Acked-by: David S. Miller <[email protected] >
Acked-by: Namhyung Kim <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2018-12-17 14:58:33 -03:00
Jiri Olsa
d24e3c98ac
perf top: Save and display the lost count stats
...
Add a 'lost count' to 'perf top' headers:
# perf top --stdio
PerfTop: 3850 irqs/sec kernel:49.0% exact: 100.0% lost: 0/0 [4000Hz cycles:ppp], (all, 8 CPUs)
# perf top
Samples: 0 of event 'cycles:ppp', 4000 Hz, Event count (approx.): 0 lost: 0/0
The format is: <current period lost>/<total lost>
Signed-off-by: Jiri Olsa <[email protected] >
Acked-by: David S. Miller <[email protected] >
Acked-by: Namhyung Kim <[email protected] >
Tested-by: Arnaldo Carvalho de Melo <[email protected] >
Cc: Alexander Shishkin <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Link: https://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2018-12-17 14:57:36 -03:00
Arnaldo Carvalho de Melo
b40067964f
perf tools: Rename 'perf_record_opts' to 'record_opts
...
Reduce typing, functions use class__method convention, so unlikely to
clash with other libraries.
This actually was discussed in the "Link:" referenced message below.
Cc: Adrian Hunter <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Frederic Weisbecker <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: Mike Galbraith <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Paul Mackerras <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2013-12-19 14:43:45 -03:00
Arnaldo Carvalho de Melo
602ad878d4
perf target: Shorten perf_target__ to target__
...
Getting unwieldly long, for this app domain should be descriptive enough
and the use of __ to separate the class from the method names should
help with avoiding clashes with other code bases.
Reported-by: David Ahern <[email protected] >
Suggested-by: Ingo Molnar <[email protected] >
Cc: Adrian Hunter <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Frederic Weisbecker <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: Mike Galbraith <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Paul Mackerras <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2013-11-12 16:51:03 -03:00
Namhyung Kim
6f29097f45
perf top: Fix percent output when no samples collected
...
If there's no sample, kernel and exact percent output at the header
looked like "-nan%".
Tested-by: Jiri Olsa <[email protected] >
Signed-off-by: Namhyung Kim <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: Paul Mackerras <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2013-05-28 16:23:59 +03:00
Arnaldo Carvalho de Melo
2376c67a7b
perf top: Use perf_evlist__config()
...
Using struct perf_record_opts to specify how to configure the evsel
perf_event_attrs.
This gets top closer to record in the way it sets up evsels, with the
aim of sharing more and more to the point that both will be a single
utility.
In this direction top now uses the same callchain option parsing as
record and that brings DWARF callchains to top, something that was
already available for record.
Cc: David Ahern <[email protected] >
Cc: Frederic Weisbecker <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: Mike Galbraith <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Paul Mackerras <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2012-12-11 17:22:39 -03:00
Arnaldo Carvalho de Melo
0c21f736e0
perf evlist: Introduce evsel list accessors
...
To replace the longer list_entry constructs for things that are widely
used:
perf_evlist__{first,last}(evlist)
perf_evsel__next(evsel)
Acked-by: Jiri Olsa <[email protected] >
Acked-by: Namhyung Kim <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Frederic Weisbecker <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: Mike Galbraith <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Paul Mackerras <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2012-08-15 10:14:18 -03:00
Arnaldo Carvalho de Melo
7289f83cce
perf tools: Move all users of event_name to perf_evsel__name
...
So that we don't use global variables that could make us misreport event
names when having a multi window top, for instance.
Cc: David Ahern <[email protected] >
Cc: Frederic Weisbecker <[email protected] >
Cc: Jiri Olsa <[email protected] >
Cc: Mike Galbraith <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Paul Mackerras <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2012-06-19 13:06:20 -03:00
Namhyung Kim
fe9d18a71d
perf top: Convert to struct perf_target
...
Use struct perf_target as it is introduced by previous patch.
This is a preparation of further changes.
Signed-off-by: Namhyung Kim <[email protected] >
Reviewed-by: David Ahern <[email protected] >
Cc: David Ahern <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Namhyung Kim <[email protected] >
Cc: Paul Mackerras <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2012-05-02 15:20:30 -03:00
David Ahern
b52956c961
perf tools: Allow multiple threads or processes in record, stat, top
...
Allow a user to collect events for multiple threads or processes
using a comma separated list.
e.g., collect data on a VM and its vhost thread:
perf top -p 21483,21485
perf stat -p 21483,21485 -ddd
perf record -p 21483,21485
or monitoring vcpu threads
perf top -t 21488,21489
perf stat -t 21488,21489 -ddd
perf record -t 21488,21489
Cc: Frederic Weisbecker <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Paul Mackerras <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Thomas Gleixner <[email protected] >
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: David Ahern <[email protected] >
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2012-02-13 22:54:11 -02:00
Arnaldo Carvalho de Melo
0d37aa34f8
perf tools: Introduce per user view
...
The new --uid command line option will show only the tasks for a given
user, using the proc interface to figure out the existing tasks.
Kernel work is needed to close races at startup, but this should already
be useful in many use cases.
Cc: David Ahern <[email protected] >
Cc: Frederic Weisbecker <[email protected] >
Cc: Mike Galbraith <[email protected] >
Cc: Paul Mackerras <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2012-01-24 19:47:37 -02:00
Arnaldo Carvalho de Melo
ab81f3fd35
perf top: Reuse the 'report' hist_entry/hists classes
...
This actually fixes several problems we had in the old 'perf top':
1. Unresolved symbols not show, limitation that came from the old
"KernelTop" codebase, to solve it we would need to do changes
that would make sym_entry have most of the hist_entry fields.
2. It was using the number of samples, not the sum of sample->period.
And brings the --sort code that allows us to have all the views in
'perf report', for instance:
[root@emilia ~]# perf top --sort dso
PerfTop: 5903 irqs/sec kernel:77.5% exact: 0.0% [1000Hz cycles], (all, 8 CPUs)
------------------------------------------------------------------------------
31.59% libcrypto.so.1.0.0
21.55% [kernel]
18.57% libpython2.6.so.1.0
7.04% libc-2.12.so
6.99% _backend_agg.so
4.72% sshd
1.48% multiarray.so
1.39% libfreetype.so.6.3.22
1.37% perf
0.71% libgobject-2.0.so.0.2200.5
0.53% [tg3]
0.48% libglib-2.0.so.0.2200.5
0.44% libstdc++.so.6.0.13
0.40% libcairo.so.2.10800.8
0.38% libm-2.12.so
0.34% umath.so
0.30% libgdk-x11-2.0.so.0.1800.9
0.22% libpthread-2.12.so
0.20% libgtk-x11-2.0.so.0.1800.9
0.20% librt-2.12.so
0.15% _path.so
0.13% libpango-1.0.so.0.2800.1
0.11% libatlas.so.3.0
0.09% ft2font.so
0.09% libpangoft2-1.0.so.0.2800.1
0.08% libX11.so.6.3.0
0.07% [vdso]
0.06% cyclictest
^C
All the filter lists can be used as well: --dsos, --comms, --symbols,
etc.
The 'perf report' TUI is also reused, being possible to apply all the
zoom operations, do annotation, etc.
This change will allow multiple simplifications in the symbol system as
well, that will be detailed in upcoming changesets.
Cc: David Ahern <[email protected] >
Cc: Frederic Weisbecker <[email protected] >
Cc: Mike Galbraith <[email protected] >
Cc: Paul Mackerras <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2011-10-07 16:56:44 -03:00
Arnaldo Carvalho de Melo
8b8ba4a9a5
perf top: Remove redundant syme->origin field
...
We can get it from syme->map->dso->kernel (that should be renamed to
origin, but leave this for another patch).
Cc: Frederic Weisbecker <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Mike Galbraith <[email protected] >
Cc: Paul Mackerras <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Cc: Tom Zanussi <[email protected] >
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2011-03-11 13:28:45 -03:00
Arnaldo Carvalho de Melo
ec52d9765a
perf top: Remove redundant perf_top->sym_counter
...
We can get that counter index from perf_top->sym_evsel->idx instead.
Cc: Frederic Weisbecker <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Mike Galbraith <[email protected] >
Cc: Paul Mackerras <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Cc: Tom Zanussi <[email protected] >
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2011-03-11 13:28:45 -03:00
Jiri Olsa
6547250381
perf top: Don't let events to eat up whole header line
...
Passing multiple events might force out information about pid/tid/cpu.
Attached patch leaves 30 characters for this info at the expense of the
events' names.
Cc: Ingo Molnar <[email protected] >
Cc: Paul Mackerras <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Han Pingtian <[email protected] >
LKML-Reference: <[email protected] >
Signed-off-by: Jiri Olsa <[email protected] >
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2011-03-10 10:55:00 -03:00
Jiri Olsa
b9a46bba88
perf top: Fix events overflow in top command
...
The snprintf function returns number of printed characters even if it
cross the size parameter. So passing enough events via '-e' parameter
will cause segmentation fault.
It's reproduced by following command:
perf top -e `perf list | grep Tracepoint | awk -F'[' '\
{gsub(/[[:space:]]+/,"",$1);array[FNR]=$1}END{outputs=array[1];\
for (i=2;i<=FNR;i++){ outputs=outputs "," array[i];};print outputs}'`
Attached patch is adding SNPRINTF macro that provides the overflow check
and returns actuall number of printed characters.
Reported-by: Han Pingtian <[email protected] >
Cc: Han Pingtian <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Paul Mackerras <[email protected] >
Cc: Peter Zijlstra <[email protected] >
LKML-Reference: <[email protected] >
Signed-off-by: Jiri Olsa <[email protected] >
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2011-03-10 10:54:13 -03:00
Arnaldo Carvalho de Melo
764328d320
perf top: Remove superfluous name_len field
...
From the sym_entry struct, struct symbol already has this field.
Cc: Frederic Weisbecker <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Mike Galbraith <[email protected] >
Cc: Paul Mackerras <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Cc: Tom Zanussi <[email protected] >
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2011-02-05 12:26:40 -02:00
Arnaldo Carvalho de Melo
c0443df1b6
perf top: Introduce slang based TUI
...
Disabled by default as there are features found in the stdio based one
that aren't implemented, like live annotation, filtering knobs data
entry.
Annotation hopefully will get somehow merged with the 'perf annotate'
code.
To use it:
perf top --tui
Cc: Frederic Weisbecker <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Mike Galbraith <[email protected] >
Cc: Paul Mackerras <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Cc: Tom Zanussi <[email protected] >
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2011-01-31 18:19:33 -02:00
Arnaldo Carvalho de Melo
8c3e10eb19
perf top: Move display agnostic routines to util/top.[ch]
...
Paving the way for a slang browser a la 'perf report --tui'.
Cc: Frederic Weisbecker <[email protected] >
Cc: Ingo Molnar <[email protected] >
Cc: Mike Galbraith <[email protected] >
Cc: Paul Mackerras <[email protected] >
Cc: Peter Zijlstra <[email protected] >
Cc: Stephane Eranian <[email protected] >
Cc: Tom Zanussi <[email protected] >
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected] >
2011-01-31 14:50:39 -02:00