* [PATCH] perf tools pt: Remove obsolete paragraph in intel-pt.c @ 2016-11-09 0:11 Andi Kleen 2016-11-09 13:14 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 7+ messages in thread From: Andi Kleen @ 2016-11-09 0:11 UTC (permalink / raw) To: acme; +Cc: linux-kernel, Andi Kleen, adrian.hunter From: Andi Kleen <ak@linux.intel.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. So remove the obsolete paragraph in the documentation. Cc: adrian.hunter@intel.com Signed-off-by: Andi Kleen <ak@linux.intel.com> --- tools/perf/Documentation/intel-pt.txt | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tools/perf/Documentation/intel-pt.txt b/tools/perf/Documentation/intel-pt.txt index c6c8318e38a2..c7f817fd3611 100644 --- a/tools/perf/Documentation/intel-pt.txt +++ b/tools/perf/Documentation/intel-pt.txt @@ -550,16 +550,6 @@ 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. -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 -mode too if the workload creates new processes. - -Note also, that to use tracepoints, read-access to debugfs is required. So if -debugfs is not mounted or the user does not have read-access, it will again not -be possible to decode Intel PT in per-cpu mode. - - sched_switch tracepoint ----------------------- -- 2.5.5 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] perf tools pt: Remove obsolete paragraph in intel-pt.c 2016-11-09 0:11 [PATCH] perf tools pt: Remove obsolete paragraph in intel-pt.c Andi Kleen @ 2016-11-09 13:14 ` Arnaldo Carvalho de Melo 2016-11-09 13:59 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 7+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-11-09 13:14 UTC (permalink / raw) To: Andi Kleen; +Cc: linux-kernel, Andi Kleen, adrian.hunter Em Tue, Nov 08, 2016 at 04:11:00PM -0800, Andi Kleen escreveu: > From: Andi Kleen <ak@linux.intel.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. So remove the obsolete paragraph in > the documentation. Thanks for pointing that out, I'll do something slightly different tho, pointing out that from kernel X.Y.Z, when the unprivileged PERF_RECORD_SWITCH metadata event was introduced, this is no longer an issue, having to be considered only on older kernels. - Arnaldo > Cc: adrian.hunter@intel.com > Signed-off-by: Andi Kleen <ak@linux.intel.com> > --- > tools/perf/Documentation/intel-pt.txt | 10 ---------- > 1 file changed, 10 deletions(-) > > diff --git a/tools/perf/Documentation/intel-pt.txt b/tools/perf/Documentation/intel-pt.txt > index c6c8318e38a2..c7f817fd3611 100644 > --- a/tools/perf/Documentation/intel-pt.txt > +++ b/tools/perf/Documentation/intel-pt.txt > @@ -550,16 +550,6 @@ 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. > > -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 > -mode too if the workload creates new processes. > - > -Note also, that to use tracepoints, read-access to debugfs is required. So if > -debugfs is not mounted or the user does not have read-access, it will again not > -be possible to decode Intel PT in per-cpu mode. > - > - > sched_switch tracepoint > ----------------------- > > -- > 2.5.5 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] perf tools pt: Remove obsolete paragraph in intel-pt.c 2016-11-09 13:14 ` Arnaldo Carvalho de Melo @ 2016-11-09 13:59 ` Arnaldo Carvalho de Melo 2016-11-09 14:01 ` Adrian Hunter 0 siblings, 1 reply; 7+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-11-09 13:59 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Andi Kleen, linux-kernel, Andi Kleen, adrian.hunter Em Wed, Nov 09, 2016 at 10:14:26AM -0300, Arnaldo Carvalho de Melo escreveu: > Em Tue, Nov 08, 2016 at 04:11:00PM -0800, Andi Kleen escreveu: > > From: Andi Kleen <ak@linux.intel.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. So remove the obsolete paragraph in > > the documentation. > > Thanks for pointing that out, I'll do something slightly different tho, > pointing out that from kernel X.Y.Z, when the unprivileged > PERF_RECORD_SWITCH metadata event was introduced, this is no longer an > issue, having to be considered only on older kernels. It ended up as: diff --git a/tools/perf/Documentation/intel-pt.txt b/tools/perf/Documentation/intel-pt.txt index c6c8318e38a2..4d12db118476 100644 --- a/tools/perf/Documentation/intel-pt.txt +++ 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. ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] perf tools pt: Remove obsolete paragraph in intel-pt.c 2016-11-09 13:59 ` Arnaldo Carvalho de Melo @ 2016-11-09 14:01 ` Adrian Hunter 2016-11-09 14:39 ` Arnaldo Carvalho de Melo 2016-11-09 14:44 ` Arnaldo Carvalho de Melo 0 siblings, 2 replies; 7+ messages in thread From: Adrian Hunter @ 2016-11-09 14:01 UTC (permalink / raw) To: Arnaldo Carvalho de Melo, Arnaldo Carvalho de Melo Cc: Andi Kleen, linux-kernel, Andi Kleen 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: >> Em Tue, Nov 08, 2016 at 04:11:00PM -0800, Andi Kleen escreveu: >>> From: Andi Kleen <ak@linux.intel.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. So remove the obsolete paragraph in >>> the documentation. >> >> Thanks for pointing that out, I'll do something slightly different tho, >> pointing out that from kernel X.Y.Z, when the unprivileged >> PERF_RECORD_SWITCH metadata event was introduced, this is no longer an >> issue, having to be considered only on older kernels. > > It ended up as: > > diff --git a/tools/perf/Documentation/intel-pt.txt b/tools/perf/Documentation/intel-pt.txt > index c6c8318e38a2..4d12db118476 100644 > --- a/tools/perf/Documentation/intel-pt.txt > +++ 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. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] perf tools pt: Remove obsolete paragraph in intel-pt.c 2016-11-09 14:01 ` Adrian Hunter @ 2016-11-09 14:39 ` Arnaldo Carvalho de Melo 2016-11-09 14:44 ` Arnaldo Carvalho de Melo 1 sibling, 0 replies; 7+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-11-09 14:39 UTC (permalink / raw) To: Adrian Hunter Cc: Arnaldo Carvalho de Melo, Andi Kleen, linux-kernel, Andi Kleen 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: > >> Em Tue, Nov 08, 2016 at 04:11:00PM -0800, Andi Kleen escreveu: > >>> From: Andi Kleen <ak@linux.intel.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. So remove the obsolete paragraph in > >>> the documentation. > >> > >> Thanks for pointing that out, I'll do something slightly different tho, > >> pointing out that from kernel X.Y.Z, when the unprivileged > >> PERF_RECORD_SWITCH metadata event was introduced, this is no longer an > >> issue, having to be considered only on older kernels. > > > > It ended up as: > > > > diff --git a/tools/perf/Documentation/intel-pt.txt b/tools/perf/Documentation/intel-pt.txt > > index c6c8318e38a2..4d12db118476 100644 > > --- a/tools/perf/Documentation/intel-pt.txt > > +++ 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, as it is not affected by the new text, thanks. - Arnaldo ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] perf tools pt: Remove obsolete paragraph in intel-pt.c 2016-11-09 14:01 ` Adrian Hunter 2016-11-09 14:39 ` Arnaldo Carvalho de Melo @ 2016-11-09 14:44 ` Arnaldo Carvalho de Melo 2016-11-10 8:11 ` Adrian Hunter 1 sibling, 1 reply; 7+ messages in thread From: Arnaldo Carvalho de Melo @ 2016-11-09 14:44 UTC (permalink / raw) To: Adrian Hunter Cc: Arnaldo Carvalho de Melo, Andi Kleen, linux-kernel, Andi Kleen 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: commit c955ced680270b95a3de6a2434311befaeaea948 Author: Arnaldo Carvalho de Melo <acme@redhat.com> 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 <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> 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 ------------------------------------------------------------ ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] perf tools pt: Remove obsolete paragraph in intel-pt.c 2016-11-09 14:44 ` Arnaldo Carvalho de Melo @ 2016-11-10 8:11 ` Adrian Hunter 0 siblings, 0 replies; 7+ messages in thread From: Adrian Hunter @ 2016-11-10 8:11 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo, Andi Kleen, linux-kernel, Andi Kleen 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 <acme@redhat.com> > 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 <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> > > 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 > ------------------------------------------------------------ > ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-11-10 8:16 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-11-09 0:11 [PATCH] perf tools pt: Remove obsolete paragraph in intel-pt.c Andi Kleen 2016-11-09 13:14 ` Arnaldo Carvalho de Melo 2016-11-09 13:59 ` Arnaldo Carvalho de Melo 2016-11-09 14:01 ` Adrian Hunter 2016-11-09 14:39 ` Arnaldo Carvalho de Melo 2016-11-09 14:44 ` Arnaldo Carvalho de Melo 2016-11-10 8:11 ` Adrian Hunter
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).