public inbox for linux-perf-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: Ian Rogers <irogers@google.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	James Clark <james.clark@linaro.org>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf record: Make logs more readable for event open failures
Date: Thu, 5 Feb 2026 10:30:36 +0000	[thread overview]
Message-ID: <20260205103036.GF3481290@e132581.arm.com> (raw)
In-Reply-To: <CAP-5=fUQxuVK+6GObmqVdBmTLzu06FyNaLdLsW6tcgNv5=7gxw@mail.gmail.com>

On Wed, Feb 04, 2026 at 09:29:14AM -0800, Ian Rogers wrote:

[...]

> > This commit restores evsel__open_strerror() to generate a readable error
> > message and print it out:

> Lgtm and sorry for making things worse - I believe it was motivated by
> trying to avoid spammy warnings.
> 
> Reviewed-by: Ian Rogers <irogers@google.com>

Thanks for review, Ian.

Just wander if we can go a bit further.  My understanding is that now we only
handle the special case of duplicate "cycles" naming on Arm/Arm64, it is
not necessarily to tolerate other failure cases.

So could we report errors and directly bail out for other PMU event failure?
This somehow reverts to old neat log rather the duplicated error logs for
each events.  Something like:

---8<---

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 2584d0d8bc82..ca7d6805840a 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1404,10 +1404,21 @@ static int record__open(struct record *rec)
                        }
 #endif
                        if (report_error || verbose > 0) {
+                               evsel__open_strerror(pos, &opts->target, errno, msg, sizeof(msg));
                                ui__error("Failure to open event '%s' on PMU '%s' which will be "
                                          "removed.\n%s\n",
                                          evsel__name(pos), evsel__pmu_name(pos), msg);
+
+                               /*
+                                * Only tolerate Arm cycle failures and bail out
+                                * on any other event failures.
+                                */
+                               if (report_error) {
+                                       rc = -errno;
+                                       goto out;
+                               }
                        }


If this is okay for you, I can send a updated patch.

Thanks,
Leo

  reply	other threads:[~2026-02-05 10:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-04 14:26 [PATCH] perf record: Make logs more readable for event open failures Leo Yan
2026-02-04 17:29 ` Ian Rogers
2026-02-05 10:30   ` Leo Yan [this message]
2026-02-05 17:07     ` Ian Rogers
2026-02-05 21:41   ` Arnaldo Carvalho de Melo
2026-02-05 22:33     ` Ian Rogers
2026-02-06 16:32       ` Leo Yan

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=20260205103036.GF3481290@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@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