From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755670AbcKOKls (ORCPT ); Tue, 15 Nov 2016 05:41:48 -0500 Received: from terminus.zytor.com ([198.137.202.10]:50672 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753983AbcKOKlo (ORCPT ); Tue, 15 Nov 2016 05:41:44 -0500 Date: Tue, 15 Nov 2016 02:41:27 -0800 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: ak@linux.intel.com, acme@redhat.com, tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org, linux-kernel@vger.kernel.org, adrian.hunter@intel.com Reply-To: ak@linux.intel.com, acme@redhat.com, tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org, linux-kernel@vger.kernel.org, adrian.hunter@intel.com To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf intel-pt: Update documentation about context switch events Git-Commit-ID: 699c12a7cca376d16f75672f9047faa37b184eda X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 699c12a7cca376d16f75672f9047faa37b184eda Gitweb: http://git.kernel.org/tip/699c12a7cca376d16f75672f9047faa37b184eda Author: Arnaldo Carvalho de Melo AuthorDate: Wed, 9 Nov 2016 11:04:05 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 11 Nov 2016 13:18:52 -0300 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 Report-Link: http://lkml.kernel.org/r/http://lkml.kernel.org/n/tip-x2ybghpqxxn3zu0m8o7qi42r@git.kernel.org Acked-by: Adrian Hunter 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 --- 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 c6c8318..b0b3007 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 ------------------------------------------------------------