From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754042AbcKJIQZ (ORCPT ); Thu, 10 Nov 2016 03:16:25 -0500 Received: from mga09.intel.com ([134.134.136.24]:3413 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751582AbcKJIQY (ORCPT ); Thu, 10 Nov 2016 03:16:24 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,617,1473145200"; d="scan'208";a="2219212" Subject: Re: [PATCH] perf tools pt: Remove obsolete paragraph in intel-pt.c To: Arnaldo Carvalho de Melo References: <1478650260-30140-1-git-send-email-andi@firstfloor.org> <20161109131426.GD12125@kernel.org> <20161109135927.GE12125@kernel.org> <344fddd4-718b-ecf3-75f0-585eda90df6f@intel.com> <20161109144412.GI12125@kernel.org> Cc: Arnaldo Carvalho de Melo , Andi Kleen , linux-kernel@vger.kernel.org, Andi Kleen From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <268a9dd2-e901-38cb-fcc6-3393de7880b3@intel.com> Date: Thu, 10 Nov 2016 10:11:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20161109144412.GI12125@kernel.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/11/16 16:44, Arnaldo Carvalho de Melo wrote: > Em Wed, Nov 09, 2016 at 04:01:12PM +0200, Adrian Hunter escreveu: >> On 09/11/16 15:59, Arnaldo Carvalho de Melo wrote: >>> Em Wed, Nov 09, 2016 at 10:14:26AM -0300, Arnaldo Carvalho de Melo escreveu: >>> +++ b/tools/perf/Documentation/intel-pt.txt >>> @@ -546,6 +546,18 @@ mode by using the --per-thread option. >>> Privileged vs non-privileged users >>> ---------------------------------- > >>> +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 >>> have memory limits imposed upon them. That affects what buffer sizes they can >>> have as outlined above. > >> Maybe put that last paragraph about memory limits above the new text. > > Ok, adding your Acked-by, it now stands as, please ack: Yes that is good. Thank you! > > commit c955ced680270b95a3de6a2434311befaeaea948 > Author: Arnaldo Carvalho de Melo > Date: Wed Nov 9 11:04:05 2016 -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 > > 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 > ------------------------------------------------------------ >