Arnaldo Carvalho de Melo
179f36dde3
Revert "perf symbols: Fix mismatched declarations for elf_getphdrnum"
...
This reverts commit f785f23576
.
We have a test to check if elf_getphdrnum() is present, so, if it fails,
we'll get:
[acme@rhel5 linux]$ cat /tmp/build/perf/feature/test-libelf-getphdrnum.make.output
cc1: warnings being treated as errors
test-libelf-getphdrnum.c: In function ‘main’:
test-libelf-getphdrnum.c:7: warning: implicit declaration of function ‘elf_getphdrnum’
[acme@rhel5 linux]$
And this block will not be compiled:
#ifndef HAVE_ELF_GETPHDRNUM_SUPPORT
static int elf_getphdrnum(Elf *elf, size_t *dst)
...
#endif
So, if elf_getphdrnum() is being defined somewhere, there is a problem
with the test that is not detecting that function, go fix it.
Reported-by: Vinson Lee <vlee@twopensource.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Victor Kamensky <victor.kamensky@linaro.org >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/n/tip-qn459fal6acvcvm50i8zxx9k@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-17 13:10:05 -03:00
Stephane Eranian
02d8dabc50
perf stat: Fix per-pkg event reporting bug
...
Per-pkg events need to be captured once per processor socket. The code
in check_per_pkg() ensures only one value per processor package is used.
However there is a problem with this function in case the first CPU of
the package does not measure anything for the per-pkg event, but other
CPUs do.
Consider the following:
$ create cgroup FOO; echo $$ >FOO/tasks; taskset -c 1 noploop &
$ perf stat -a -I 1000 -e intel_cqm/llc_occupancy/ -G FOO sleep 100
1.00000 <not counted> Bytes intel_cqm/llc_occupancy/ FOO
The reason for this is that CPU0 in the cgroup has nothing running on it.
Yet check_per_plg() will mark socket0 as processed and no other event
value will be considered for the socket.
This patch fixes the problem by having check_per_pkg() only consider
events which actually ran.
Signed-off-by: Stephane Eranian <eranian@google.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Kan Liang <kan.liang@intel.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Link: http://lkml.kernel.org/r/1441286620-10117-1-git-send-email-eranian@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-16 18:01:03 -03:00
Ingo Molnar
d71b0ad8d3
Merge branch 'perf/urgent' into perf/core, to resolve a conflict
...
Conflicts:
tools/perf/ui/browsers/hists.c
Signed-off-by: Ingo Molnar <mingo@kernel.org >
2015-09-16 09:19:56 +02:00
Adrian Hunter
c5e6bd2ed3
perf tests: Fix software clock events test setting maps
...
The test titled "Test software clock events have valid period values"
was setting cpu/thread maps directly. Make it use the proper function
perf_evlist__set_maps() especially now that it also propagates the maps.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@intel.com >
Link: http://lkml.kernel.org/r/1441699142-18905-15-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 11:04:49 -03:00
Adrian Hunter
2998272275
perf tests: Fix task exit test setting maps
...
The test titled "Test number of exit event of a simple workload" was
setting cpu/thread maps directly. Make it use the proper function
perf_evlist__set_maps() especially now that it also propagates the maps.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@intel.com >
Link: http://lkml.kernel.org/r/1441699142-18905-14-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 11:03:58 -03:00
Adrian Hunter
8c0498b689
perf evlist: Fix create_syswide_maps() not propagating maps
...
Fix it by making it call perf_evlist__set_maps() instead of setting the
maps itself.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@intel.com >
Link: http://lkml.kernel.org/r/1441699142-18905-13-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 11:03:22 -03:00
Adrian Hunter
44c42d71c6
perf evlist: Fix add() not propagating maps
...
If evsels are added after maps are created, then they won't have any
maps propagated to them. Fix that.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@intel.com >
Link: http://lkml.kernel.org/r/1441699142-18905-12-git-send-email-adrian.hunter@intel.com
[ Moved the moving of propagate_maps() to the patch before, so that this
one does _just_ the one lile fix calling in add()]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 11:01:25 -03:00
Adrian Hunter
adc0c3e87b
perf evlist: Factor out a function to propagate maps for a single evsel
...
Subsequent fixes will need a function that just propagates maps for a
single evsel so factor it out.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@intel.com >
Link: http://lkml.kernel.org/r/1441699142-18905-11-git-send-email-adrian.hunter@intel.com
[ Moved them to before perf_evlist__add() to avoid having to move it in the next patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 10:54:04 -03:00
Adrian Hunter
74bfd2b25d
perf evlist: Make create_maps() use set_maps()
...
Since there is a function to set maps, perf_evlist__create_maps() should
use it.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@intel.com >
Link: http://lkml.kernel.org/r/1441699142-18905-10-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 10:45:47 -03:00
Adrian Hunter
934e0f2053
perf evlist: Make set_maps() more resilient
...
Make perf_evlist__set_maps() more resilient by allowing for the
possibility that one or another of the maps isn't being changed and
therefore should not be "put".
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@intel.com >
Link: http://lkml.kernel.org/r/1441699142-18905-9-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 10:44:22 -03:00
Adrian Hunter
fce4d296b4
perf evsel: Add own_cpus member
...
perf_evlist__propagate_maps() cannot easily tell if an evsel has its own
cpu map. To make that simpler, keep a copy of the PMU cpu map and
adjust the propagation logic accordingly.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@intel.com >
Link: http://lkml.kernel.org/r/1441699142-18905-8-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 10:41:13 -03:00
Adrian Hunter
b278c364b3
perf evlist: Fix missing thread_map__put in propagate_maps()
...
perf_evlist__propagate_maps() incorrectly assumes evsel->threads is NULL
before reassigning it, but it won't be NULL when perf_evlist__set_maps()
is used to set different (or NULL) maps. Thus thread_map__put must be
used, which works even if evsel->threads is NULL.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@intel.com >
Link: http://lkml.kernel.org/r/1441699142-18905-7-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 10:24:30 -03:00
Adrian Hunter
f114d6eff7
perf evlist: Fix splice_list_tail() not setting evlist
...
Commit d49e469507
("perf evsel: Add a backpointer to the evlist a
evsel is in") updated perf_evlist__add() but not
perf_evlist__splice_list_tail().
This illustrates that it is better if perf_evlist__splice_list_tail()
calls perf_evlist__add() instead of duplicating the logic, so do that.
This will also simplify a subsequent fix for propagating maps.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@intel.com >
Link: http://lkml.kernel.org/r/1441699142-18905-6-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 10:23:17 -03:00
Adrian Hunter
ec9a77a7e3
perf evlist: Add has_user_cpus member
...
Subsequent patches will need to call perf_evlist__propagate_maps without
reference to a "target". Add evlist->has_user_cpus to record whether
the user has specified which cpus to target (and therefore whether that
list of cpus should override the default settings for a selected event
i.e. the cpu maps should be propagated)
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@intel.com >
Link: http://lkml.kernel.org/r/1441699142-18905-5-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 10:20:50 -03:00
Adrian Hunter
d5bc056e73
perf evlist: Remove redundant validation from propagate_maps()
...
The validation checks that the values that were just assigned, got
assigned i.e. the error can't ever happen. Subsequent patches will call
this code in places where errors are not being returned. Changing those
code paths to return this non-existent error is counter-productive, so
just remove it.
That in turn results in perf_evlist__set_maps not needing to return an
error, but callers aren't checking it either, so remove that too.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@intel.com >
Link: http://lkml.kernel.org/r/1441699142-18905-4-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 10:16:48 -03:00
Adrian Hunter
725e06b2e2
perf evlist: Simplify set_maps() logic
...
Don't need to check for NULL when "putting" evlist->maps and
evlist->threads because the "put" functions already do that.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@intel.com >
Link: http://lkml.kernel.org/r/1441699142-18905-3-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 10:15:39 -03:00
Adrian Hunter
a69b09e234
perf evlist: Simplify propagate_maps() logic
...
If evsel->cpus is to be reassigned then the current value must be "put",
which works even if it is NULL. Simplify the current logic by moving
the "put" next to the assignment.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@intel.com >
Link: http://lkml.kernel.org/r/1441699142-18905-2-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 10:08:22 -03:00
Wang Nan
bbbe6bf603
perf tools: Introduce regs_query_register_offset() for x86
...
regs_query_register_offset() is a helper function which converts
register name like "%rax" to offset of a register in 'struct pt_regs',
which is required by BPF prologue generator. Since the function is
identical, try to reuse the code in arch/x86/kernel/ptrace.c.
Comment inside dwarf-regs.c list the differences between this
implementation and kernel code.
get_arch_regstr() switches to regoffset_table and the old string table
is dropped.
Signed-off-by: He Kuang <hekuang@huawei.com >
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com >
Cc: Alexei Starovoitov <ast@plumgrid.com >
Cc: Brendan Gregg <brendan.d.gregg@gmail.com >
Cc: Daniel Borkmann <daniel@iogearbox.net >
Cc: David Ahern <dsahern@gmail.com >
Cc: He Kuang <hekuang@huawei.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Kaixu Xia <xiakaixu@huawei.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Zefan Li <lizefan@huawei.com >
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1441523623-152703-20-git-send-email-wangnan0@huawei.com
Signed-off-by: Wang Nan <wangnan0@huawei.com >
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 09:48:33 -03:00
Wang Nan
63ab024a5b
perf tools: regs_query_register_offset() infrastructure
...
regs_query_register_offset() is a helper function which converts
register name like "%rax" to offset of a register in 'struct pt_regs',
which is required by BPF prologue generator.
PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET indicates an architecture
supports converting name of a register to its offset in 'struct
pt_regs'.
HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET is introduced as the corresponding
CFLAGS of PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET.
Signed-off-by: Wang Nan <wangnan0@huawei.com >
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com >
Cc: Alexei Starovoitov <ast@plumgrid.com >
Cc: Brendan Gregg <brendan.d.gregg@gmail.com >
Cc: Daniel Borkmann <daniel@iogearbox.net >
Cc: David Ahern <dsahern@gmail.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Kaixu Xia <xiakaixu@huawei.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Paul Mackerras <paulus@samba.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Zefan Li <lizefan@huawei.com >
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1441523623-152703-19-git-send-email-wangnan0@huawei.com
Signed-off-by: He Kuang <hekuang@huawei.com >
[ Extracted from eBPF patches ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 09:48:33 -03:00
Jiri Olsa
196581717d
perf tools: Enhance parsing events tracepoint error output
...
Enhancing parsing events tracepoint error output. Adding
more verbose output when the tracepoint is not found or
the tracing event path cannot be access.
$ sudo perf record -e sched:sched_krava ls
event syntax error: 'sched:sched_krava'
\___ unknown tracepoint
Error: File /sys/kernel/debug/tracing//tracing/events/sched/sched_krava not found.
Hint: Perhaps this kernel misses some CONFIG_ setting to enable this feature?.
Run 'perf list' for a list of valid events
...
$ perf record -e sched:sched_krava ls
event syntax error: 'sched:sched_krava'
\___ can't access trace events
Error: No permissions to read /sys/kernel/debug/tracing//tracing/events/sched/sched_krava
Hint: Try 'sudo mount -o remount,mode=755 /sys/kernel/debug'
Run 'perf list' for a list of valid events
...
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Raphael Beamonte <raphael.beamonte@gmail.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Matt Fleming <matt@codeblueprint.co.uk >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1441615087-13886-6-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 09:48:33 -03:00
Jiri Olsa
8dd2a1317e
perf evsel: Propagate error info from tp_format
...
Propagate error info from tp_format via ERR_PTR to get it all the way
down to the parse-event.c tracepoint adding routines. Following
functions now return pointer with encoded error:
- tp_format
- trace_event__tp_format
- perf_evsel__newtp_idx
- perf_evsel__newtp
This affects several other places in perf, that cannot use pointer check
anymore, but must utilize the err.h interface, when getting error
information from above functions list.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Matt Fleming <matt@codeblueprint.co.uk >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Raphael Beamonte <raphael.beamonte@gmail.com >
Link: http://lkml.kernel.org/r/1441615087-13886-5-git-send-email-jolsa@kernel.org
[ Add two missing ERR_PTR() and one IS_ERR() ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 09:48:33 -03:00
Jiri Olsa
e2f9f8ea6a
perf tools: Propagate error info for the tracepoint parsing
...
Pass 'struct parse_events_error *error' to the parse-event.c tracepoint
adding path. It will be filled with error data in following patches.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Reviewed-by: Raphael Beamonte <raphael.beamonte@gmail.com >
Reviewed-by: Matt Fleming <matt@codeblueprint.co.uk >
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/1441615087-13886-4-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 09:48:32 -03:00
Namhyung Kim
9bae1e8c3f
perf probe: Export init/exit_probe_symbol_maps()
...
The init/exit_symbols_maps() functions are to setup and cleanup
necessary info for probe events. But they need to be called from out of
the probe code now, so this patch exports them.
However the names are too generic, so change them to have 'probe'. :)
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/r/1441852026-28974-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 09:48:32 -03:00
Namhyung Kim
a43aac299c
perf probe: Free perf_probe_event in cleanup_perf_probe_events()
...
The cleanup_perf_probe_events() frees all resources related to a perf
probe event. However it only freed resources in trace probe events, not
perf probe events. So call clear_perf_probe_event() too.
Reported-by: Wang Nan <wangnan0@huawei.com >
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1441852026-28974-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-15 09:48:32 -03:00
Wang Nan
bd315aab8a
perf top: Fix segfault pressing -> with no hist entries
...
'perf top' segfaults with following operation:
# perf top -e page-faults -p 11400 # 11400 never generates page-fault
Then on the resulting empty interface, press right key:
# ./perf top -e page-faults -p 11400
perf: Segmentation fault
-------- backtrace --------
./perf[0x535428]
/lib64/libc.so.6(+0x3545f)[0x7f0dd360745f]
./perf[0x531d46]
./perf(perf_evlist__tui_browse_hists+0x96)[0x5340d6]
./perf[0x44ba2f]
/lib64/libpthread.so.0(+0x81d0)[0x7f0dd49dc1d0]
/lib64/libc.so.6(clone+0x6c)[0x7f0dd36b90dc]
The bug resides in perf_evsel__hists_browse() that, in the above
circumstance browser->selection can be NULL, but code after
skip_annotation doesn't consider it.
This patch fix it by checking browser->selection before fetching
browser->selection->map.
Signed-off-by: Wang Nan <wangnan0@huawei.com >
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Zefan Li <lizefan@huawei.com >
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1442226235-117265-1-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 15:10:41 -03:00
Kan Liang
92d424ae89
perf test: Add entry for hists socket filter
...
Add test case for hists socket filter.
Signed-off-by: Kan Liang <kan.liang@intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/r/1441377946-44429-5-git-send-email-kan.liang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 13:04:10 -03:00
Kan Liang
84734b06b6
perf hists browser: Zoom in/out for processor socket
...
Currently, users can zoom in/out for threads and dso in 'perf top' and
'perf report'.
This patch extends it for the processor sockets.
'S' is the short key to zoom into current Processor Socket.
Signed-off-by: Kan Liang <kan.liang@intel.com >
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/r/1441377946-44429-4-git-send-email-kan.liang@intel.com
[ - Made it elide the Socket column when zooming into it,
just like with the other zoom ops;
- Make it use browser->pstack, to unzoom level by level;
- Rename 'socket' variables to 'socket_id' to make it build on
older systems where it shadows a global glibc declaration ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 13:02:08 -03:00
Kan Liang
21394d948a
perf report: Introduce --socket-filter option
...
Introduce --socket-filter option for 'perf report' to only show entries
for a processor socket that match this filter.
$ perf report --socket-filter 1 --stdio
# To display the perf.data header info, please use --header/--header-only options.
#
# Total Lost Samples: 0
#
# Samples: 752 of event 'cycles'
# Event count (approx.): 350995599
# Processor Socket: 1
#
# Overhead Command Shared Object Symbol
# ........ ......... ................ .................................
#
97.02% test test [.] plusB_c
0.97% test test [.] plusA_c
0.23% swapper [kernel.vmlinux] [k] acpi_idle_do_entry
0.09% rcu_sched [kernel.vmlinux] [k] dyntick_save_progress_counter
0.01% swapper [kernel.vmlinux] [k] task_waking_fair
0.00% swapper [kernel.vmlinux] [k] run_timer_softirq
Signed-off-by: Kan Liang <kan.liang@intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/r/1441377946-44429-3-git-send-email-kan.liang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:31 -03:00
Kan Liang
2e7ea3ab82
perf tools: Introduce new sort type "socket" for the processor socket
...
This patch enable perf report to sort by processor socket:
$ perf report --stdio --sort socket,comm,dso,symbol
# To display the perf.data header info, please use --header/--header-only options.
#
# Total Lost Samples: 0
#
# Samples: 686 of event 'cycles'
# Event count (approx.): 349215462
#
# Overhead SOCKET Command Shared Object Symbol
# ........ ...... ....... ................ ............................
#
97.05% 000 test test [.] plusB_c
0.98% 000 test test [.] plusA_c
0.93% 001 perf [kernel.vmlinux] [k] smp_call_function_single
0.19% 001 perf [kernel.vmlinux] [k] page_fault
0.19% 001 swapper [kernel.vmlinux] [k] pm_qos_request
0.16% 000 test [kernel.vmlinux] [k] add_mm_counter_fast
Signed-off-by: Kan Liang <kan.liang@intel.com >
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/r/1441377946-44429-2-git-send-email-kan.liang@intel.com
[ Fix col calc, un-allcapsify col header & read the topology when not using perf.data ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:30 -03:00
Kan Liang
0c4c4debb0
perf tools: Add processor socket info to hist_entry and addr_location
...
This information will come from perf.data files of from the current
system, cached when needed, such as when the 'socket' sort order gets
introduced.
Signed-off-by: Kan Liang <kan.liang@intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/r/1441377946-44429-1-git-send-email-kan.liang@intel.com
[ Don't blindly use env->cpu[al.cpu].socket_id & use machine->env, fixes by Jiri & Arnaldo ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:29 -03:00
Arnaldo Carvalho de Melo
4cde998d20
perf machine: Add pointer to sample's environment
...
The 'struct machine' represents the machine where the samples were/are
being collected, and we also have a 'struct perf_env' with extra details
about such machine, that we were collecting at 'perf.data' creation time
but we also needed when no perf.data file is being used, such as in
'perf top'.
So, get those structs closer together, as they provide a bigger picture
of the sample's environment.
In 'perf session', when the file argument is NULL, we can assume that
the tool is sampling the running machine, so point machine->env to
the global put in place in previous patches, while set it to the
perf_header.env one when reading from a file.
This paves the way for machine->env to be used in
perf_event__preprocess_sample to populate addr_location.socket.
Tested-by: Wang Nan <wangnan0@huawei.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
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: Namhyung Kim <namhyung@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-2ajotl0khscutm68exictoy9@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:29 -03:00
Arnaldo Carvalho de Melo
aa36ddd7af
perf env: Introduce read_cpu_topology_map() method
...
Out of the code to write the cpu topology map in the perf.data file
header.
Now if one needs the CPU topology map for the running machine, one needs
to call perf_env__read_cpu_topology_map(perf_env) and the info will be
stored in perf_env.cpu.
For now we're using a global perf_env variable, that will have its
contents freed after we run a builtin.
v2: Check perf_env__read_cpu_topology_map() return in
write_cpu_topology() (Kan Liang)
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
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: Namhyung Kim <namhyung@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/r/1441828225-667-5-git-send-email-acme@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:28 -03:00
Arnaldo Carvalho de Melo
5d8cf721cb
perf cpu_map: Use sysfs__read_int in get_{core,socket}_id()
...
We have the tools/lib/ sysfs__read_int() for that, avoid code
duplication.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@intel.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/n/tip-fqg6vt5ku72pbf54ljg6tmoy@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:27 -03:00
Kan Liang
e0838e029f
perf env: Read msr pmu type from header
...
Get msr pmu type when processing pmu_mappings
Signed-off-by: Kan Liang <kan.liang@intel.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Link: http://lkml.kernel.org/n/tip-3ngei63gepydwxhvytl2wx89@git.kernel.org
[ Fixed it up wrt moving perf_env from header.h ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:24 -03:00
Jiri Olsa
b60114067c
perf tools: Add tools/include into tags directories
...
Adding tools/include into tags directories, to have include definitions
reachable via tags/cscope.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Matt Fleming <matt@codeblueprint.co.uk >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Raphael Beamonte <raphael.beamonte@gmail.com >
Link: http://lkml.kernel.org/r/1441615087-13886-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:23 -03:00
Arnaldo Carvalho de Melo
8168caded3
perf evsel: Remove forward declaration of 'struct perf_evlist'
...
We have no use for it in evsel.h.
Tested-by: Wang Nan <wangnan0@huawei.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@intel.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-um03yjrgyi3bj1hzqiqs4dsu@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:22 -03:00
Arnaldo Carvalho de Melo
a4978eca68
perf hists browser: Fixup the "cpu" column width calculation
...
Since we were not setting it to at least 3 chars ('CPU'), it was being
reset to zero when recalculating the columns width when refreshing the
screen, in 'perf top'. Fix it.
Tested-by: Wang Nan <wangnan0@huawei.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
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: Namhyung Kim <namhyung@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-iqcdnkkqm6sew06x01fbijmy@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:22 -03:00
Arnaldo Carvalho de Melo
b699869285
perf env: Adopt perf_header__set_cmdline
...
Move this from two globals to perf_env global, that eventually will
be just perf_header->env or something else, to ease the refactoring
series, leave it as a global and go on reading more of its fields,
not as part of the header writing process but as a perf_env init one
that will be used for perf.data-less situations.
Tested-by: Wang Nan <wangnan0@huawei.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
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: Namhyung Kim <namhyung@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-2j78tdf8zn1ci0y6ji15bifj@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:21 -03:00
Arnaldo Carvalho de Melo
eebd0bfca5
perf env: Rename some leftovers from rename to perf_env
...
In ce80d3bef9
("perf tools: Rename perf_session_env to perf_env") we
forgot to rename a few functions to the "perf_env" prefix, do it now.
Tested-by: Wang Nan <wangnan0@huawei.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
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: Namhyung Kim <namhyung@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-b3ui3z6ock89z1814pu2er98@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:20 -03:00
Arnaldo Carvalho de Melo
f0ce888c06
perf env: Move perf_env out of header.h and session.c into separate object
...
Since it can be used separately from 'perf_session' and 'perf_header',
move it to separate include file and object, next csets will try to move
a perf_env__init() routine.
Tested-by: Wang Nan <wangnan0@huawei.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
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: Namhyung Kim <namhyung@kernel.org >
Cc: Stephane Eranian <eranian@google.com >
Link: http://lkml.kernel.org/n/tip-ff2rw99tsn670y1b6gxbwdsi@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:19 -03:00
Matt Fleming
e8210cefb7
perf tests: Introduce iterator function for tests
...
In preparation for introducing more arrays of tests, e.g. "arch tests"
(architecture-specific tests), abstract the code to iterate over the
list of tests into a helper function.
This way, code that uses a 'struct test' doesn't need to worry about how
the tests are grouped together and changes to the list of tests doesn't
require changes to the code using it.
Signed-off-by: Matt Fleming <matt.fleming@intel.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: Kanaka Juvva <kanaka.d.juvva@intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Vikas Shivappa <vikas.shivappa@intel.com >
Cc: Vince Weaver <vince@deater.net >
Link: http://lkml.kernel.org/r/1441479742-15402-2-git-send-email-matt@codeblueprint.co.uk
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:18 -03:00
Kan Liang
c84974ed9f
perf test: Add entry to test cpu topology
...
This patch test cpu core_id and socket_id which are stored in perf_env.
Commiter note:
# perf test topo
40: Test topology in session: Ok
# perf test -v topo
40: Test topology in session:
--- start ---
test child forked, pid 31767
templ file: /tmp/perf-test-VTZ1PL
CPU 0, core 0, socket 0
CPU 1, core 1, socket 0
CPU 2, core 0, socket 0
CPU 3, core 1, socket 0
test child finished with 0
---- end ----
Test topology in session: Ok
#
Based-on-a-patch-by: Jiri Olsa <jolsa@kernel.org >
Signed-off-by: Kan Liang <kan.liang@intel.com >
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Andi Kleen <ak@linux.intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Link: http://lkml.kernel.org/r/1441357111-64522-1-git-send-email-kan.liang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:17 -03:00
Jiri Olsa
fbf99625b8
perf tools: Switch to tracing_path interface on appropriate places
...
Using tracing_path interface on several places, that more or less
copy the functionality of tracing_path interface.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Matt Fleming <matt@codeblueprint.co.uk >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Raphael Beamonte <raphael.beamonte@gmail.com >
Cc: Steven Rostedt <rostedt@goodmis.org >
Link: http://lkml.kernel.org/r/1441180605-24737-16-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:16 -03:00
Jiri Olsa
4605eab348
tools lib api fs: Replace debugfs/tracefs objects interface with fs.c
...
Switching to the fs.c related filesystem framework.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Matt Fleming <matt@codeblueprint.co.uk >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Cc: Raphael Beamonte <raphael.beamonte@gmail.com >
Cc: Steven Rostedt <rostedt@goodmis.org >
Link: http://lkml.kernel.org/r/1441180605-24737-14-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:15 -03:00
Jan Stancek
fd405cf6cf
perf tests: Print objdump/dso buffers if they don't match
...
Signed-off-by: Jan Stancek <jstancek@redhat.com >
Acked-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@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/d0f42f786bc0e965918e0f422df25617a12a4021.1441181335.git.jstancek@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:13 -03:00
Jan Stancek
edfdb7eab0
perf tests: Stop reading if objdump output crossed sections
...
objdump output can span across multiple sections:
Disassembly of section .text:
0000000000000008 <crc32c+0x8>:
8: 48 89 e5 mov %rsp,%rbp
b: 53 push %rbx
c: 8b 01 mov (%rcx),%eax
<snip>
6b: 90 nop
Disassembly of section .init.text:
0000000000000008 <init_module+0x8>:
8: 00 00 add %al,(%rax)
a: 00 00 add %al,(%rax)
c: 48 89 e5
Stop further reading if an address starts going backwards, assuming we
crossed sections.
Signed-off-by: Jan Stancek <jstancek@redhat.com >
Acked-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@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/9d1ea95e5f9884fdff1be6f761a2feabef37412c.1441181335.git.jstancek@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:12 -03:00
Jan Stancek
06f679c18f
perf tests: Make objdump disassemble zero blocks
...
Add -z parameter to avoid skipping zero blocks:
ffffffff816704fe <sysret_check+0x4b>:
ffffffff816704fe: 7b 34 jnp ffffffff81670534 <sysret_signal+0x1c>
...
ffffffff81670501 <sysret_careful>:
ffffffff81670501: 0f ba e2 03 bt $0x3,%edx
ffffffff81670505: 73 11 jae ffffffff81670518 <sysret_signal>
Signed-off-by: Jan Stancek <jstancek@redhat.com >
Acked-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@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/130c6267fbdb9af506633a9efa06f3269ff5bd2c.1441275982.git.jstancek@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:11 -03:00
Jan Stancek
729a7ed103
perf tests: Take into account address of each objdump line
...
objdump output can contain repeated bytes. At the moment test reads all
output sequentially, assuming each address is represented in output only
once:
ffffffff8164efb3 <retint_swapgs+0x9>:
ffffffff8164efb3: c1 5d 00 eb rcrl $0xeb,0x0(%rbp)
ffffffff8164efb7: 00 4c 8b 5c add %cl,0x5c(%rbx,%rcx,4)
ffffffff8164efb8 <restore_c_regs_and_iret>:
ffffffff8164efb8: 4c 8b 5c 24 30 mov 0x30(%rsp),%r11
ffffffff8164efbd: 4c 8b 54 24 38 mov 0x38(%rsp),%r10
Store objdump output to buffer according to offset calculated from
address on each line.
Signed-off-by: Jan Stancek <jstancek@redhat.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@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/ad13289a55d6350f7717757c7e32c2d4286402bd.1441181335.git.jstancek@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-14 12:50:10 -03:00
Arnaldo Carvalho de Melo
caa470475d
perf header: Fixup reading of HEADER_NRCPUS feature
...
The original patch introducing this header wrote the number of CPUs available
and online in one order and then swapped those values when reading, fix it.
Before:
# perf record usleep 1
# perf report --header-only | grep 'nrcpus \(online\|avail\)'
# nrcpus online : 4
# nrcpus avail : 4
# echo 0 > /sys/devices/system/cpu/cpu2/online
# perf record usleep 1
# perf report --header-only | grep 'nrcpus \(online\|avail\)'
# nrcpus online : 4
# nrcpus avail : 3
# echo 0 > /sys/devices/system/cpu/cpu1/online
# perf record usleep 1
# perf report --header-only | grep 'nrcpus \(online\|avail\)'
# nrcpus online : 4
# nrcpus avail : 2
After the fix, bringing back the CPUs online:
# perf report --header-only | grep 'nrcpus \(online\|avail\)'
# nrcpus online : 2
# nrcpus avail : 4
# echo 1 > /sys/devices/system/cpu/cpu2/online
# perf record usleep 1
# perf report --header-only | grep 'nrcpus \(online\|avail\)'
# nrcpus online : 3
# nrcpus avail : 4
# echo 1 > /sys/devices/system/cpu/cpu1/online
# perf record usleep 1
# perf report --header-only | grep 'nrcpus \(online\|avail\)'
# nrcpus online : 4
# nrcpus avail : 4
Acked-by: Namhyung Kim <namhyung@kernel.org >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Borislav Petkov <bp@suse.de >
Cc: David Ahern <dsahern@gmail.com >
Cc: Frederic Weisbecker <fweisbec@gmail.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Kan Liang <kan.liang@intel.com >
Cc: Stephane Eranian <eranian@google.com >
Cc: Wang Nan <wangnan0@huawei.com >
Fixes: fbe96f29ce
("perf tools: Make perf.data more self-descriptive (v8)")
Link: http://lkml.kernel.org/r/20150911153323.GP23511@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2015-09-13 11:41:34 -03:00
Ingo Molnar
3bd7617596
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:
- Use PERF_RECORD_SWITCH when available in intel-pt, instead of
"sched:sched_switch" events, enabling an unprivileged user to trace
multi-threaded or multi-process workloads. (Adrian Hunter)
- Always use non inlined file name for 'srcfile' sort key. (Andi Kleen)
- Quieten failed to read counter message, helps in systems without
backend-stalled-cycles. (Andi Kleen)
Infrastructure changes:
- Add a 'perf test' entry for decoding of new x86 instructions. (Adrian Hunter)
- Add new instructions (sha, clflushopt, clwb, pcommit, rdpkru, wrpkru, xsavec,
xsaves, xrstors) to the x86 instruction decoder. (Adrian Hunter)
- Add a build test to warn when source code drifts happen for the
instruction decoder files in the kernel and in tools/perf. (Adrian Hunter)
- Copy linux/filter.h to tools/include. (He Kuang)
- Support function __get_dynamic_array_len in libtraceevent. (He Kuanguuu)
- Tracing path finding/mounting/error reporting refactorings. (Jiri Olsa)
- Store CPU socket and core IDs in perf.data. (Kan Liang)
- Reorganize add/del probe insertion routines in 'perf probe'. (Namhyung Kim, Wang Nan)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Signed-off-by: Ingo Molnar <mingo@kernel.org >
2015-09-08 16:22:29 +02:00