mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 02/15] perf intel-pt: Update documentation about context switch events
Date: Mon, 14 Nov 2016 22:38:34 -0300	[thread overview]
Message-ID: <1479173927-24613-3-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1479173927-24613-1-git-send-email-acme@kernel.org>

From: Arnaldo Carvalho de Melo <acme@redhat.com>

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>
---
 tools/perf/Documentation/intel-pt.txt | 19 +++++++++++++++++--
 1 file 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
 have memory limits imposed upon them.  That affects what buffer sizes they can
 have as outlined above.
 
+The v4.2 kernel introduced support for a context switch metadata event,
+PERF_RECORD_SWITCH, which allows unprivileged users to see when their processes
+are scheduled out and in, just not by whom, which is left for the
+PERF_RECORD_SWITCH_CPU_WIDE, that is only accessible in system wide context,
+which in turn requires CAP_SYS_ADMIN.
+
+Please see the 45ac1403f564 ("perf: Add PERF_RECORD_SWITCH to indicate context
+switches") commit, that introduces these metadata events for further info.
+
+When working with kernels < v4.2, the following considerations must be taken,
+as the sched:sched_switch tracepoints will be used to receive such information:
+
 Unless /proc/sys/kernel/perf_event_paranoid is set to -1, unprivileged users are
 not permitted to use tracepoints which means there is insufficient side-band
 information to decode Intel PT in per-cpu mode, and potentially workload-only
@@ -564,8 +576,11 @@ sched_switch tracepoint
 -----------------------
 
 The sched_switch tracepoint is used to provide side-band data for Intel PT
-decoding.  sched_switch events are automatically added. e.g. the second event
-shown below
+decoding in kernels where the PERF_RECORD_SWITCH metadata event isn't
+available.
+
+The sched_switch events are automatically added. e.g. the second event shown
+below:
 
 	$ perf record -vv -e intel_pt//u uname
 	------------------------------------------------------------
-- 
2.7.4

  parent reply	other threads:[~2016-11-15  1:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-15  1:38 [GIT PULL 00/15] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-11-15  1:38 ` [PATCH 01/15] perf callchain: Fixup help/config for no-unwinding Arnaldo Carvalho de Melo
2016-11-15  1:38 ` Arnaldo Carvalho de Melo [this message]
2016-11-15  1:38 ` [PATCH 03/15] tools build: Add CFLAGS_REMOVE_* support Arnaldo Carvalho de Melo
2016-11-15  1:38 ` [PATCH 04/15] tools build: Add jvmti feature detection support Arnaldo Carvalho de Melo
2016-11-15  1:38 ` [PATCH 05/15] perf jvmti: Plug compilation into perf build Arnaldo Carvalho de Melo
2016-11-15  1:38 ` [PATCH 06/15] perf kvmti: Remove unused Makefile file Arnaldo Carvalho de Melo
2016-11-15  1:38 ` [PATCH 07/15] perf config: Add support for getting config key-value pairs Arnaldo Carvalho de Melo
2016-11-15  1:38 ` [PATCH 08/15] perf config: Validate config variable arguments before trying use them Arnaldo Carvalho de Melo
2016-11-15  1:38 ` [PATCH 09/15] perf config: Add support setting variables in a config file Arnaldo Carvalho de Melo
2016-11-15  2:20   ` Taeung Song
2016-11-15  1:38 ` [PATCH 10/15] perf config: Mark where are config items from (user or system) Arnaldo Carvalho de Melo
2016-11-15  1:38 ` [PATCH 11/15] perf report: Add branch flag to callchain cursor node Arnaldo Carvalho de Melo
2016-11-15  1:38 ` [PATCH 12/15] perf report: Create a symbol_conf flag for showing branch flag counting Arnaldo Carvalho de Melo
2016-11-15  1:38 ` [PATCH 13/15] perf report: Calculate and return the " Arnaldo Carvalho de Melo
2016-11-15  1:38 ` [PATCH 14/15] perf report: Show branch info in callchain entry for stdio mode Arnaldo Carvalho de Melo
2016-11-15  1:38 ` [PATCH 15/15] perf report: Show branch info in callchain entry for browser mode Arnaldo Carvalho de Melo
2016-11-15  8:47 ` [GIT PULL 00/15] perf/core improvements and fixes Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1479173927-24613-3-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome