[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200528143818.GH16490@kernel.org>
Date: Thu, 28 May 2020 11:38:18 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Adrian Hunter <adrian.hunter@...el.com>
Cc: Jiri Olsa <jolsa@...hat.com>, Andi Kleen <ak@...ux.intel.com>,
linux-kernel@...r.kernel.org,
Mathieu Poirier <mathieu.poirier@...aro.org>
Subject: Re: [PATCH 2/2] perf intel-pt: Refine kernel decoding only warning
message
Em Thu, May 28, 2020 at 03:08:59PM +0300, Adrian Hunter escreveu:
> Stop the message displaying when user space is not being traced.
>
> Example:
>
> Prerequisites:
>
> sudo setcap "cap_sys_rawio,cap_sys_admin,cap_sys_ptrace,cap_syslog,cap_ipc_lock=ep" ~/bin/perf
> sudo chmod +r /proc/kcore
>
> Before:
>
> $ perf record --no-switch-events --kcore -a -e intel_pt//k -- sleep 0.001
> Warning:
> Intel Processor Trace decoding will not be possible except for kernel tracing!
> [ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 0.838 MB perf.data ]
>
> After:
>
> $ perf record --no-switch-events --kcore -a -e intel_pt//k -- sleep 0.001
> [ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 1.068 MB perf.data ]
>
> $ sudo chmod go-r /proc/kcore
> $ sudo setcap -r ~/bin/perf
Thanks, tested as root and applied.
- Arnaldo
> Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
> ---
> tools/perf/arch/x86/util/intel-pt.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
> index 3fc547769707..9fb137282dc8 100644
> --- a/tools/perf/arch/x86/util/intel-pt.c
> +++ b/tools/perf/arch/x86/util/intel-pt.c
> @@ -879,7 +879,8 @@ static int intel_pt_recording_options(struct auxtrace_record *itr,
> * per-cpu with no sched_switch (except workload-only).
> */
> if (!ptr->have_sched_switch && !perf_cpu_map__empty(cpus) &&
> - !target__none(&opts->target))
> + !target__none(&opts->target) &&
> + !intel_pt_evsel->core.attr.exclude_user)
> ui__warning("Intel Processor Trace decoding will not be possible except for kernel tracing!\n");
>
> return 0;
> --
> 2.17.1
>
--
- Arnaldo
Powered by blists - more mailing lists