diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-11-09 09:04:05 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-11-11 11:18:52 -0500 |
commit | 699c12a7cca376d16f75672f9047faa37b184eda (patch) | |
tree | 6a68d876b73f4b981003c0264c96eb0f51862117 /tools/perf | |
parent | c56cb33b56c13493eeb95612f80e4dd6e35cd109 (diff) |
perf intel-pt: Update documentation about context switch events
Since the unprivileged sched switch event was added in perf, PT doesn't
need need perf_event_paranoid=-1 anymore for per cpu decoding.
Add a note stating that that is only needed for kernels < 4.2.
Reported-by: Andi Kleen <ak@linux.intel.com>
Report-Link: http://lkml.kernel.org/r/http://lkml.kernel.org/n/tip-x2ybghpqxxn3zu0m8o7qi42r@git.kernel.org
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Fixes: 45ac1403f564 ("perf: Add PERF_RECORD_SWITCH to indicate context switches")
Link: http://lkml.kernel.org/n/tip-x2ybghpqxxn3zu0m8o7qi42r@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/Documentation/intel-pt.txt | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tools/perf/Documentation/intel-pt.txt b/tools/perf/Documentation/intel-pt.txt index c6c8318e38a2..b0b3007d3c9c 100644 --- a/tools/perf/Documentation/intel-pt.txt +++ b/tools/perf/Documentation/intel-pt.txt | |||
@@ -550,6 +550,18 @@ Unless /proc/sys/kernel/perf_event_paranoid is set to -1, unprivileged users | |||
550 | have memory limits imposed upon them. That affects what buffer sizes they can | 550 | have memory limits imposed upon them. That affects what buffer sizes they can |
551 | have as outlined above. | 551 | have as outlined above. |
552 | 552 | ||
553 | The v4.2 kernel introduced support for a context switch metadata event, | ||
554 | PERF_RECORD_SWITCH, which allows unprivileged users to see when their processes | ||
555 | are scheduled out and in, just not by whom, which is left for the | ||
556 | PERF_RECORD_SWITCH_CPU_WIDE, that is only accessible in system wide context, | ||
557 | which in turn requires CAP_SYS_ADMIN. | ||
558 | |||
559 | Please see the 45ac1403f564 ("perf: Add PERF_RECORD_SWITCH to indicate context | ||
560 | switches") commit, that introduces these metadata events for further info. | ||
561 | |||
562 | When working with kernels < v4.2, the following considerations must be taken, | ||
563 | as the sched:sched_switch tracepoints will be used to receive such information: | ||
564 | |||
553 | Unless /proc/sys/kernel/perf_event_paranoid is set to -1, unprivileged users are | 565 | Unless /proc/sys/kernel/perf_event_paranoid is set to -1, unprivileged users are |
554 | not permitted to use tracepoints which means there is insufficient side-band | 566 | not permitted to use tracepoints which means there is insufficient side-band |
555 | information to decode Intel PT in per-cpu mode, and potentially workload-only | 567 | information to decode Intel PT in per-cpu mode, and potentially workload-only |
@@ -564,8 +576,11 @@ sched_switch tracepoint | |||
564 | ----------------------- | 576 | ----------------------- |
565 | 577 | ||
566 | The sched_switch tracepoint is used to provide side-band data for Intel PT | 578 | The sched_switch tracepoint is used to provide side-band data for Intel PT |
567 | decoding. sched_switch events are automatically added. e.g. the second event | 579 | decoding in kernels where the PERF_RECORD_SWITCH metadata event isn't |
568 | shown below | 580 | available. |
581 | |||
582 | The sched_switch events are automatically added. e.g. the second event shown | ||
583 | below: | ||
569 | 584 | ||
570 | $ perf record -vv -e intel_pt//u uname | 585 | $ perf record -vv -e intel_pt//u uname |
571 | ------------------------------------------------------------ | 586 | ------------------------------------------------------------ |