All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>, Andi Kleen <ak@linux.intel.com>,
	linux-kernel@vger.kernel.org,
	Mathieu Poirier <mathieu.poirier@linaro.org>
Subject: Re: [PATCH 2/2] perf intel-pt: Refine kernel decoding only warning message
Date: Thu, 28 May 2020 11:38:18 -0300	[thread overview]
Message-ID: <20200528143818.GH16490@kernel.org> (raw)
In-Reply-To: <20200528120859.21604-2-adrian.hunter@intel.com>

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@intel.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

  reply	other threads:[~2020-05-28 14:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 12:08 [PATCH 1/2] perf record: Respect --no-switch-events Adrian Hunter
2020-05-28 12:08 ` [PATCH 2/2] perf intel-pt: Refine kernel decoding only warning message Adrian Hunter
2020-05-28 14:38   ` Arnaldo Carvalho de Melo [this message]
2020-05-28 14:37 ` [PATCH 1/2] perf record: Respect --no-switch-events Arnaldo Carvalho de Melo

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=20200528143818.GH16490@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.