Adrian Hunter
9f1d122b52
perf intel-pt: Enable decoder to handle TIP.PGD with missing IP
...
When address filters are used, the decoder must detect the end of a
filter region (or a branch into a tracestop region) by matching Packet
Generation Disabled (TIP.PGD) packets against the object code using the
IP given in the packet. However, due to errata SKL014 "Intel PT TIP.PGD
May Not Have Target IP Payload", that IP may not be present.
Enable the decoder to handle that by adding a new callback function
'pgd_ip()' which indicates whether the IP is not traced, in which case
that is the point where the trace was disabled.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: http://lkml.kernel.org/r/1474641528-18776-16-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-29 11:17:06 -03:00
Adrian Hunter
2b9e32c47f
perf intel-pt: Read address filter from AUXTRACE_INFO event
...
Read the address filter from the AUXTRACE_INFO event in preparation for
using it to assist in decoding.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: http://lkml.kernel.org/r/1474641528-18776-15-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-29 11:17:05 -03:00
Adrian Hunter
c093f308ce
perf intel-pt: Record address filter in AUXTRACE_INFO event
...
The address filter is needed to help decode the trace, so store it in
the AUXTRACE_INFO event.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: http://lkml.kernel.org/r/1474641528-18776-14-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-29 11:17:05 -03:00
Adrian Hunter
40b746a063
perf intel-pt: Add a helper function for processing AUXTRACE_INFO
...
Add a helper function 'intel_pt_has()' to make it easier to determine
which members the AUXTRACE_INFO event contains.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: http://lkml.kernel.org/r/1474641528-18776-13-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-29 11:17:04 -03:00
Adrian Hunter
4d34e10a9f
perf intel-pt: Fix missing error codes processing auxtrace_info
...
Fix 2 places where the err variable was not being set.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: http://lkml.kernel.org/r/1474641528-18776-12-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-29 11:17:04 -03:00
Adrian Hunter
fa8025c374
perf intel-pt: Add support for recording the max non-turbo ratio
...
Previously the maximum non-turbo ratio was calculated from TSC assuming
a 100 MHz multiplier which is correct for current hardware supporting
Intel PT. However more recent kernels also now export the value, so use
that in preference to the calculated value.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: http://lkml.kernel.org/r/1474641528-18776-11-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-29 11:17:03 -03:00
Adrian Hunter
810c398bc0
perf intel-pt: Fix snapshot overlap detection decoder errors
...
Fix occasional decoder errors decoding trace data collected in snapshot
mode.
Snapshot mode can take successive snapshots of trace which might overlap.
The decoder checks whether there is an overlap but only looks at the
current and previous buffer. However buffers that do not contain
synchronization (i.e. PSB) packets cannot be decoded or used for overlap
checking. That means the decoder actually needs to check overlaps between
the current buffer and the previous buffer that contained usable data.
Make that change.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Cc: stable@vger.kernel.org # v4.3+
Link: http://lkml.kernel.org/r/1474641528-18776-10-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-29 11:17:03 -03:00
Adrian Hunter
f9655200ec
perf probe: Increase debug level of SDT debug messages
...
Two SDT debug messages can occur for every DSO which is too noisy.
Consequently, increase debug level of SDT messages.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: http://lkml.kernel.org/r/1474641528-18776-9-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-29 11:17:02 -03:00
Adrian Hunter
1b36c03e35
perf record: Add support for using symbols in address filters
...
Symbols come from either the DSO or /proc/kallsyms for the kernel.
Details of the functionality can be found in Documentation/perf-record.txt.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: http://lkml.kernel.org/r/1474641528-18776-8-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-29 11:17:02 -03:00
Adrian Hunter
cd67f99fe9
perf symbols: Add dso__last_symbol()
...
Add a function to find the last symbol in a DSO. This will be used when
parsing address filters to calculate a region that includes the entire
DSO.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: http://lkml.kernel.org/r/1474641528-18776-7-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-29 11:17:01 -03:00
Adrian Hunter
5c01ad60b8
perf record: Fix error paths
...
Some error paths do not tidy-up. Fix that.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: http://lkml.kernel.org/r/1474641528-18776-6-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-29 11:17:01 -03:00
Adrian Hunter
394c01ed8a
perf record: Rename label 'out_symbol_exit'
...
In preparation for fixing the error paths, rename label
'out_symbol_exit' to be 'out' because that error path can be used
irrespective of whether symbols (or anything else) has been initialized.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: http://lkml.kernel.org/r/1474641528-18776-5-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-29 11:17:00 -03:00
Adrian Hunter
e7a06a5353
perf script: Fix vanished idle symbols
...
Commit 608c34de0b ("perf symbols: Mark if a symbol is idle in the
library") causes idle symbols to vanish from perf script output. That is
because print functions suppress symbols marked as 'idle'.
However, suppression of 'idle' functions is only used by 'perf top' and
'perf top' does not use the print functions. Consequently that
functionality can simply be removed from the print functions.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Fixes: 608c34de0b ("perf symbols: Mark if a symbol is idle in the library")
Link: http://lkml.kernel.org/r/1474641528-18776-4-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-29 11:17:00 -03:00
Mathieu Poirier
1e85748437
perf evsel: Add support for address filters
...
This patch makes it possible to use the current filter framework with
address filters. That way address filters for HW tracers such as
CoreSight and Intel PT can be communicated to the kernel drivers.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Acked-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1474037045-31730-4-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-29 11:16:59 -03:00
Mathieu Poirier
3541c034d9
perf evsel: New tracepoint specific function
...
Making function perf_evsel__append_filter() static and introducing a new
tracepoint specific function to append filters. That way we eliminate
redundant code and avoid formatting mistake.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Acked-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1474037045-31730-3-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-29 11:16:59 -03:00
Mathieu Poirier
b15d0a4c82
perf tools: Make perf_evsel__append_filter() generic
...
By making function perf_evsel__append_filter() take a format rather than
an operator it is possible to reuse the code for other purposes (ex.
Intel PT and CoreSight) than tracepoints.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Acked-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1474037045-31730-2-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-29 11:16:58 -03:00
Simon Que
2acad19500
perf tools: Update documentation info about quipper
...
The existing link is outdated. The most recent quipper code can be found at the
new URL.
Committer notes:
Quipper is a C++ parser that can be used to convert from a perf.data
file to and from a protobuf, a Chromium OS facility.
Signed-off-by: Simon Que <sque@chromium.org >
Acked-by: Andi Kleen <ak@linux.intel.com >
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Chong Jiang <chongjiang@chromium.org >
Link: http://lkml.kernel.org/n/tip-4q1nm7jl3vovp66p5bki20pq@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-29 11:16:44 -03:00
Arnaldo Carvalho de Melo
f0bbd60226
perf trace: Beautify sched_[gs]et_attr return value
...
Both return errno, show the string associated then.
More work needed to capture the sched_attr arg to beautify it in turn,
probably using BPF.
Before:
0.210 ( 0.001 ms): sched_setattr(uattr: 0x7ffc684f02b0) = -22
After the patch, for this sched_attr, all other parms are zero, so not
shown:
struct sched_attr attr = {
.size = sizeof(attr),
.sched_policy = SCHED_DEADLINE,
.sched_runtime = 10 * USECS_PER_SEC,
.sched_period = 30 * USECS_PER_SEC,
.sched_deadline = attr.sched_period,
};
0.321 ( 0.002 ms): sched_setattr(uattr: 0x7ffc44116da0) = -1 EINVAL Invalid argument
[root@jouet c]# perf trace -e sched_setattr ./sched_deadline
Couldn't negotiate deadline: Invalid argument
0.229 ( 0.003 ms): sched_setattr(uattr: 0x7ffd8dcd8df0) = -1 EINVAL Invalid argument
[root@jouet c]#
Now to figure out the reason for this EINVAL.
Cc: Adrian Hunter <adrian.hunter@intel.com >
Cc: Clark Williams <williams@redhat.com >
Cc: Daniel Bristot de Oliveira <bristot@redhat.com >
Cc: David Ahern <dsahern@gmail.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Steven Rostedt <rostedt@goodmis.org >
Cc: Wang Nan <wangnan0@huawei.com >
Link: http://lkml.kernel.org/n/tip-tyot2n7e48zm8pdw8tbcm3sl@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-28 13:48:04 -03:00
Wang Nan
f2c8852e6e
perf data: Fix building in 32 bit platform with libbabeltrace
...
On ARM32 building it report following error when we build with
libbabeltrace:
util/data-convert-bt.c: In function 'add_bpf_output_values':
util/data-convert-bt.c:440:3: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Werror=format]
cc1: all warnings being treated as errors
Fix it by changing %lu to %zu.
Signed-off-by: Wang Nan <wangnan0@huawei.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Zefan Li <lizefan@huawei.com >
Cc: pi3orama@163.com
Fixes: 6122d57e9f ("perf data: Support converting data from bpf_perf_event_output()")
Link: http://lkml.kernel.org/r/1475035126-146587-1-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-28 10:38:20 -03:00
Adrian Hunter
973186ca7f
perf tools: Fix MMAP event synthesis broken by MAP_HUGETLB change
...
Patch "perf record: Mark MAP_HUGETLB when synthesizing mmap events") breaks
MMAP event synthesis. The executable name comparison will match any name
if the length is zero, resulting in all the user space maps becoming
anonymous. This is particularly noticeable with system-wide traces.
Example:
perf record -a sleep 1
perf script --show-mmap-events
Committer note:
That is not the case when, say, one has a qemu instance and libvirt actually
mounts hugetlbfs. To test this I had to first umount it:
[root@jouet ~]# mount | grep hugetlbfs
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,seclabel)
[root@jouet ~]#
After unmount it the error fixed by this patch manifests itself:
# perf record -a sleep 1
# perf script --show-mmap-events | grep PERF_RECORD_MMAP2 | head -5
systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x557d47ed8000(0x167000) @ 0 fd:00 3146896 7362875424355726126]: r-xp //anon
systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c488d000(0x4000) @ 0 fd:00 3153214 7362875424355726126]: r-xp //anon
systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4a92000(0x3d000) @ 0 fd:00 3159276 7362875424355726126]: r-xp //anon
systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4cd5000(0x15000) @ 0 fd:00 3153725 7362875424355726126]: r-xp //anon
systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4eeb000(0x25000) @ 0 fd:00 3153260 7362875424355726126]: r-xp //anon
#
Fixed version:
# perf record -a sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 1.419 MB perf.data (182 samples) ]
# perf script --show-mmap-events | grep PERF_RECORD_MMAP2 | head -5
systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x557d47ed8000(0x167000) @ 0 fd:00 3146896 7362875424355726126]: r-xp /usr/lib/systemd/systemd
systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c488d000(0x4000) @ 0 fd:00 3153214 7362875424355726126]: r-xp /usr/lib64/libuuid.so.1.3.0
systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4a92000(0x3d000) @ 0 fd:00 3159276 7362875424355726126]: r-xp /usr/lib64/libblkid.so.1.1.0
systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4cd5000(0x15000) @ 0 fd:00 3153725 7362875424355726126]: r-xp /usr/lib64/libz.so.1.2.8
systemd 0 [000] 0.000000: PERF_RECORD_MMAP2 1/1: [0x7f96c4eeb000(0x25000) @ 0 fd:00 3153260 7362875424355726126]: r-xp /usr/lib64/liblzma.so.5.2.2
[root@jouet ~]#
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: http://lkml.kernel.org/r/1474641528-18776-3-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-28 10:21:15 -03:00
Adrian Hunter
a9e57009da
perf record: Fix documentation 'event_sources' -> 'event_source'
...
Change '/sys/bus/event_sources' to the correct path which is
'/sys/bus/event_source'.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Jiri Olsa <jolsa@redhat.com >
Cc: Masami Hiramatsu <mhiramat@kernel.org >
Cc: Mathieu Poirier <mathieu.poirier@linaro.org >
Link: http://lkml.kernel.org/r/1474641528-18776-2-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-27 15:00:29 -03:00
Matthew Wilcox
62fd5258eb
radix tree test suite: Test radix_tree_replace_slot() for multiorder entries
...
When we replace a multiorder entry, check that all indices reflect the
new value.
Also, compile the test suite with -O2, which shows other problems with
the code due to some dodgy pointer operations in the radix tree code.
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2016-09-25 11:49:16 -07:00
Shuah Khan
a67cd5482f
tools: move pcmcia crc32hash tool from Documentation
...
Move pcmcia crc32hash tool from Documentation to tools/pcmcia and
remove it from Documentation Makefile. Update location information
for this tool. Create a new Makefile to build pcmcia. It can be built
from top level directory or from pcmcia directory:
Run make -C tools/pcmcia or cd tools/pcmcia; make
Acked-by: Dominik Brodowski <linux@dominikbrodowski.net >
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Acked-by: Jonathan Corbet <corbet@lwn.net >
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2016-09-23 13:07:27 -06:00
Shuah Khan
3ca9760fdf
tools: move laptops dslm tool from Documentation
...
Move laptops dslm tool to tools/laptop/dslm and remove it from
Documentation Makefile. Update location information for this
tool. Create a new Makefile to build dslm. It can be built
from top level directory or from laptops directory:
Run make -C tools/laptop/dslm or cd tools/laptop/dslm; make
Acked-by: Jonathan Corbet <corbet@lwn.net >
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2016-09-23 13:07:21 -06:00
Shuah Khan
d522b2cdfe
tools: move accounting tool from Documentation
...
Move accounting tool to tools and remove it from Documentation
Makefile. Update location information for this tool. Create a
new Makefile to build accounting. It can be built from top level
directory or from accounting directory:
Run make -C tools/accounting or cd tools/accounting; make
Acked-by: Jonathan Corbet <corbet@lwn.net >
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2016-09-23 13:07:15 -06:00
Cyril Bur
96c447077c
selftests/powerpc: Compile selftests against headers without AT_HWCAP2
...
It might be nice to compile selftests against older kernels and
headers but which may not have HWCAP2.
Signed-off-by: Cyril Bur <cyrilbur@gmail.com >
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
2016-09-23 22:36:05 +10:00
Josh Poimboeuf
c1fad9ef7e
objtool: Add do_task_dead() to global noreturn list
...
objtool reports the following new warning:
kernel/exit.o: warning: objtool: do_exit() falls through to next function complete_and_exit()
The warning is caused by do_exit()'s new call to do_task_dead(), which
is a new "noreturn" function which objtool doesn't know about yet,
introduced by:
9af6528ee9 ("sched/core: Optimize __schedule()")
( objtool has to know all the global noreturn functions so it can follow
the control flow of any functions which call them. Unfortunately they
need to be hard-coded because there's no automated way to detect them. )
Reported-by: kbuild test robot <fengguang.wu@intel.com >
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com >
Cc: Linus Torvalds <torvalds@linux-foundation.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: kbuild-all@01.org
Cc: tipbuild@zytor.com
Link: http://lkml.kernel.org/r/20160922212125.zbuewckqll4yur25@treble
Signed-off-by: Ingo Molnar <mingo@kernel.org >
2016-09-23 07:28:05 +02:00
Ingo Molnar
6b652de2b2
Merge tag 'perf-core-for-mingo-20160922' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
...
Pull perf/core improvements from Arnaldo Carvalho de Melo:
New features:
- Add support for interacting with Coresight PMU ETMs/PTMs, that are IP blocks
to perform hardware assisted tracing on a ARM CPU core (Mathieu Poirier)
Infrastructure changes:
- Histogram prep work for the upcoming c2c tool (Jiri Olsa)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
Signed-off-by: Ingo Molnar <mingo@kernel.org >
2016-09-23 07:21:38 +02:00
Ingo Molnar
739f1bcd04
Merge branch 'perf/urgent' into perf/core, to pick up fixes
...
Signed-off-by: Ingo Molnar <mingo@kernel.org >
2016-09-23 07:20:33 +02:00
Andrey Vagin
6ad92bf63e
tools/testing: add a test to check nsfs ioctl-s
...
There are two new ioctl-s:
One ioctl for the user namespace that owns a file descriptor.
One ioctl for the parent namespace of a namespace file descriptor.
The test checks that these ioctl-s works and that they handle a case
when a target namespace is outside of the current process namespace.
Signed-off-by: Andrei Vagin <avagin@openvz.org >
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com >
2016-09-22 19:59:41 -05:00
Jiri Olsa
2d83145414
perf hists: Make hists__fprintf_headers function global
...
Will be used from external places in the upcoming c2c patch series.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.com >
Cc: Joe Mario <jmario@redhat.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1474558645-19956-10-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-22 13:08:59 -03:00
Jiri Olsa
bd28d0c598
perf hists: Make __hist_entry__snprintf function global
...
Will be used from external places in the upcoming c2c patch series.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.com >
Cc: Joe Mario <jmario@redhat.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1474558645-19956-9-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-22 13:08:58 -03:00
Jiri Olsa
98ba160929
perf tools: Make several display functions global
...
Will be used from external places in the upcoming c2c patch series.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.com >
Cc: Joe Mario <jmario@redhat.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1474558645-19956-8-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-22 13:08:58 -03:00
Jiri Olsa
5fe7b9b47c
perf tools: Make several sorting functions global
...
Will be used from external places in the upcoming c2c patch series.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.com >
Cc: Joe Mario <jmario@redhat.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1474558645-19956-7-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-22 13:08:57 -03:00
Jiri Olsa
a76490e4cd
perf tools: Make output_field_add and sort_dimension__add global
...
Will be used from external places in the upcoming c2c patch series.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.com >
Cc: Joe Mario <jmario@redhat.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1474558645-19956-6-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-22 13:08:57 -03:00
Jiri Olsa
bcf98740a2
perf tools: Make reset_dimensions global
...
Will be used from external places in the upcoming c2c patch series.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.com >
Cc: Joe Mario <jmario@redhat.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1474558645-19956-5-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-22 13:08:56 -03:00
Jiri Olsa
9da44db149
perf hists: Add __hist_entry__snprintf function
...
Add __hist_entry__snprintf() to take a perf_hpp_list as an argument
instead of using he->hists->hpp_list.
This way we can display arbitrary list of entries regardless of the
hists setup, which will be useful in the upcoming c2c patch series.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.com >
Cc: Joe Mario <jmario@redhat.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1474558645-19956-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-22 13:08:56 -03:00
Mathieu Poirier
3becf4525d
perf tools: Add sink configuration for cs_etm PMU
...
Using the PMU::set_drv_config() callback to enable the CoreSight sink
that will be used for the trace session.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1474041004-13956-8-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-22 13:08:55 -03:00
Mathieu Poirier
5d8bb1ec74
perf tools: Add PMU configuration to tools
...
Now that the required mechanic is there to deal with PMU specific
configuration, add the functionality to the tools where events can be
selected.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1474041004-13956-7-git-send-email-mathieu.poirier@linaro.org
[ Fix the build on XSI-compliant systems, using str_error_r() to make sure we return a string, not an integer ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-22 13:07:36 -03:00
Mathieu Poirier
859442bd3f
perf pmu: Push configuration down to PMU driver
...
This patch adds a PMU callback and the required mechanic so that drivers
can process the command line configuration elements found in
evsel::config_terms.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1474041004-13956-6-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-22 12:19:41 -03:00
Mathieu Poirier
a818c563ae
perf tools: Add coresight etm PMU record capabilities
...
Coresight ETMs are IP blocks used to perform HW assisted tracing on a
CPU core. This patch introduce the required auxiliary API functions
allowing the perf core to interact with a tracer.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Acked-by: Adrian Hunter <adrian.hunter@intel.com >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Jiri Olsa <jolsa@kernel.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1474041004-13956-4-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-22 12:19:40 -03:00
Mathieu Poirier
7e21b0d579
perf tools: Make coresight PMU listable
...
Adding the required mechanic allowing 'perf list pmu' to discover
coresight ETM/PTM tracers.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Acked-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1474041004-13956-3-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-22 12:19:35 -03:00
Mathieu Poirier
08d5204adb
perf tools: Confine __get_cpuid() to x86 architecture
...
The __get_cpuid() test is only valid when compiling for x86. When
compiling for other architectures like ARM/ARM64 the test fails event if
the functionality is not required.
This patch isolate the build-in feature check to x86 platform, allowing
the compilation and usage of PMUs that use the AUXTRACE infrastructure
on other architectures (i.e ARM CoreSight).
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org >
Acked-by: Adrian Hunter <adrian.hunter@intel.com >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com >
Cc: Peter Zijlstra <peterz@infradead.org >
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1474041004-13956-2-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-22 12:19:30 -03:00
Dan Williams
73606afd46
tools/testing/nvdimm: test get_config_size DSM failures
...
Add an nfit_test specific attribute for gating whether a get_config_size
DSM, or any DSM for that matter, succeeds or fails. The get_config_size
DSM is initial motivation since that is the first command libnvdimm core
issues to determine the state of the namespace label area.
Signed-off-by: Dan Williams <dan.j.williams@intel.com >
2016-09-21 09:36:36 -07:00
Jiri Olsa
d5278220be
perf hists: Use bigger buffer for stdio headers
...
With node column on big CPUs servers we can run out of stdio header
space quite soon. Enlarging header buffer.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.com >
Cc: Joe Mario <jmario@redhat.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1474290610-23241-5-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-21 12:14:59 -03:00
Jiri Olsa
82deb8a242
perf evsel: Remove superfluous initialization of weight
...
Removing superfluous initialization of weight, it's already set to 0 via
memset.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.com >
Cc: Joe Mario <jmario@redhat.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/1474290610-23241-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-21 12:07:24 -03:00
Jiri Olsa
3c028a0cb5
perf symbols: Do not open device files
...
The dso__read_binary_type_filename gets the dso's file name to open. We
need to check it for regular file before trying to open it, otherwise we
might get stuck with device file.
Signed-off-by: Jiri Olsa <jolsa@kernel.org >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: David Ahern <dsahern@gmail.com >
Cc: Don Zickus <dzickus@redhat.com >
Cc: Joe Mario <jmario@redhat.com >
Cc: Namhyung Kim <namhyung@kernel.org >
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl >
Link: http://lkml.kernel.org/r/20160920161245.GA8995@krava
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-20 16:20:21 -03:00
Namhyung Kim
e3b60bc93d
perf hists: Factor out hists__reset_column_width()
...
The stdio and tui has same code to reset hpp format column width.
Factor it out as a new function.
Suggested-and-Acked-by: Jiri Olsa <jolsa@redhat.com >
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Link: http://lkml.kernel.org/r/20160920053025.13989-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-20 16:13:37 -03:00
Namhyung Kim
5ff3e7a224
perf ui/tui: Reset output width for hierarchy
...
When --hierarchy option is used, each entry has its own hpp_list to show
the result. But it missed to update width of each column.
Before:
- 46.29% 48.12% netctl-auto
+ 31.44% 29.25% [kernel.vmlinux]
+ 8.52% 11.55% libc-2.22.so
+ 5.19% 6.91% bash
+ 10.75% 11.83% wpa_cli
+ 8.25% 2.23% swapper
+ 6.45% 5.40% tr
+ 4.81% 8.09% awk
+ 4.15% 2.85% firefox
+ 3.86% 2.53% sh
After:
- 46.29% 48.12% netctl-auto
+ 31.44% 29.25% [kernel.vmlinux]
+ 8.52% 11.55% libc-2.22.so
+ 5.19% 6.91% bash
+ 10.75% 11.83% wpa_cli
+ 8.25% 2.23% swapper
+ 6.45% 5.40% tr
+ 4.81% 8.09% awk
+ 4.15% 2.85% firefox
+ 3.86% 2.53% sh
Committer note:
Full testing instructions:
1) Record with an event group:
$ perf record -e '{cycles,instructions}' make -j4
2) Use report in hierarchy mode, to get a few expanded trees on
the same screen, use --percent-limit:
$ perf report --hierarchy --percent-limit 0.5
Samples: 103K of event 'anon group { cycles:u, instructions:u }',
Event count (approx.): 57317631725
Overhead Command / Shared Object / Symbol ◆
- 58.89% 55.12% cc1 ▒
- 50.26% 48.10% cc1 ▒
3.61% 5.13% [.] _cpp_lex_token ▒
2.58% 0.78% [.] ht_lookup_with_hash ▒
1.31% 1.30% [.] ggc_internal_alloc ▒
1.08% 2.25% [.] get_combined_adhoc_loc ▒
1.01% 1.95% [.] ira_init ▒
0.96% 1.78% [.] linemap_position_for_column ▒
0.65% 1.01% [.] cpp_get_token_with_location ▒
- 7.52% 6.58% libc-2.23.so ▒
1.70% 1.78% [.] _int_malloc ▒
0.69% 0.75% [.] _int_free ▒
0.67% 0.42% [.] malloc_consolidate ▒
- 0.58% 0.42% ld-2.23.so ▒
no entry >= 0.50% ▒
- 0.52% 0.03% [kernel.vmlinux] ▒
no entry >= 0.50% ▒
Signed-off-by: Namhyung Kim <namhyung@kernel.org >
Acked-by: Jiri Olsa <jolsa@kernel.org >
Cc: Andi Kleen <andi@firstfloor.org >
Cc: Peter Zijlstra <peterz@infradead.org >
Fixes: 1b2dbbf41a ("perf hists: Use own hpp_list for hierarchy mode")
Link: http://lkml.kernel.org/r/20160920053025.13989-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2016-09-20 16:08:30 -03:00
Shuah Khan
3d2c86e305
selftests: Move networking/timestamping from Documentation
...
Remove networking from Documentation Makefile to move the test to
selftests. Update networking/timestamping Makefile to work under
selftests. These tests will not be run as part of selftests suite
and will not be included in install targets. They can be built and
run separately for now.
This is part of the effort to move runnable code from Documentation.
Acked-by: Jonathan Corbet <corbet@lwn.net >
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com >
2016-09-20 09:59:50 -06:00