linux-kernel.vger.kernel.org archive mirror
 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>, Ian Rogers <irogers@google.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf tools: Fix misleading add event pmu debug message
Date: Mon, 11 Apr 2022 14:59:33 -0300	[thread overview]
Message-ID: <YlRshf1/FVSaQEXJ@kernel.org> (raw)
In-Reply-To: <20220411061758.2458417-1-adrian.hunter@intel.com>

Em Mon, Apr 11, 2022 at 09:17:58AM +0300, Adrian Hunter escreveu:
> Fix incorrect debug message:
> 
>    Attempting to add event pmu 'intel_pt' with '' that may result in
>    non-fatal errors
> 
> which always appears with perf record -vv and intel_pt e.g.
> 
>     perf record -vv -e intel_pt//u uname
> 
> The message is incorrect because there will never be non-fatal errors.
> 
> Suppress the message if the pmu is 'selectable' i.e. meant to be selected
> directly as an event.

Thanks, applied.

- Arnaldo

 
> Fixes: 4ac22b484d4c79 ("perf parse-events: Make add PMU verbose output clearer")
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
>  tools/perf/util/parse-events.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
> index 24997925ae00..dd84fed698a3 100644
> --- a/tools/perf/util/parse-events.c
> +++ b/tools/perf/util/parse-events.c
> @@ -1523,7 +1523,9 @@ int parse_events_add_pmu(struct parse_events_state *parse_state,
>  	bool use_uncore_alias;
>  	LIST_HEAD(config_terms);
>  
> -	if (verbose > 1) {
> +	pmu = parse_state->fake_pmu ?: perf_pmu__find(name);
> +
> +	if (verbose > 1 && !(pmu && pmu->selectable)) {
>  		fprintf(stderr, "Attempting to add event pmu '%s' with '",
>  			name);
>  		if (head_config) {
> @@ -1536,7 +1538,6 @@ int parse_events_add_pmu(struct parse_events_state *parse_state,
>  		fprintf(stderr, "' that may result in non-fatal errors\n");
>  	}
>  
> -	pmu = parse_state->fake_pmu ?: perf_pmu__find(name);
>  	if (!pmu) {
>  		char *err_str;
>  
> -- 
> 2.25.1

-- 

- Arnaldo

      reply	other threads:[~2022-04-11 17:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11  6:17 [PATCH] perf tools: Fix misleading add event pmu debug message Adrian Hunter
2022-04-11 17:59 ` Arnaldo Carvalho de Melo [this message]

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=YlRshf1/FVSaQEXJ@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.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 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).