linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Oliver Sang <oliver.sang@intel.com>
Cc: oe-lkp@lists.linux.dev, lkp@intel.com,
	linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	James Clark <james.clark@linaro.org>,
	Ravi Bangoria <ravi.bangoria@amd.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	James Clark <james.clark@arm.com>,
	Atish Patra <atishp@atishpatra.org>,
	Mingwei Zhang <mizhang@google.com>,
	Kajol Jain <kjain@linux.ibm.com>,
	Thomas Richter <tmricht@linux.ibm.com>,
	Palmer Dabbelt <palmer@rivosinc.com>,
	linux-perf-users@vger.kernel.org
Subject: Re: [linus:master] [perf tools]  af954f76ee: perf-sanity-tests.Test_data_symbol.fail
Date: Wed, 4 Dec 2024 14:21:06 -0800	[thread overview]
Message-ID: <Z1DV0lN8qHSysX7f@google.com> (raw)
In-Reply-To: <Z1DNJpDzCIBFrIZT@google.com>

On Wed, Dec 04, 2024 at 01:44:06PM -0800, Namhyung Kim wrote:
[SNIP]
>   perf_event_attr:
>     type                             4 (cpu)
>     size                             136
>     config                           0x1cd (mem-loads)
>     { sample_period, sample_freq }   4000
>     sample_type                      IP|TID|TIME|ADDR|CPU|PERIOD|IDENTIFIER|DATA_SRC|WEIGHT_STRUCT
>     read_format                      ID|LOST
>     freq                             1
>     precise_ip                       3
>     sample_id_all                    1
>     { bp_addr, config1 }             0x1f
>   ------------------------------------------------------------
>   sys_perf_event_open: pid -1  cpu 0  group_fd 5  flags 0x8
>   sys_perf_event_open failed, error -22
>   Using PERF_SAMPLE_READ / :S modifier is not compatible with inherit, falling back to no-inherit.
>   Error:
>   The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (cpu/mem-loads,ldlat=30/).
>   "dmesg | grep -i perf" may provide additional information.
> 
> There's an issue with fallback on the inherit bit with the sample read.
> I'll take a look.

Hmm, no.  It doesn't have neight SAMPLE_READ nor inherit.  So the error
message was misleading.  Maybe it should be printed when it actually
clears the bits.

Anyway, I've tested with the old code and realzed that it might be due
to precise_ip being 3.  I expected it'd return EOPNOTSUPP for the case
but it seems to return EINVAL sometimes.  Then it should check it after
the missing features like below.  Can you please test?

Thanks,
Namhyung


---8<---
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index f745723d486ba962..d22c5df1701eccc5 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2571,12 +2571,12 @@ static int evsel__open_cpu(struct evsel *evsel, struct perf_cpu_map *cpus,
 	if (err == -EMFILE && rlimit__increase_nofile(&set_rlimit))
 		goto retry_open;
 
-	if (err == -EOPNOTSUPP && evsel__precise_ip_fallback(evsel))
-		goto retry_open;
-
 	if (err == -EINVAL && evsel__detect_missing_features(evsel))
 		goto fallback_missing_features;
 
+	if (evsel__precise_ip_fallback(evsel))
+		goto retry_open;
+
 	if (evsel__handle_error_quirks(evsel, err))
 		goto retry_open;
 

  reply	other threads:[~2024-12-04 22:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-30  7:03 [linus:master] [perf tools] af954f76ee: perf-sanity-tests.Test_data_symbol.fail kernel test robot
2024-12-02 20:32 ` Namhyung Kim
2024-12-04 14:04   ` Oliver Sang
2024-12-04 21:44     ` Namhyung Kim
2024-12-04 22:21       ` Namhyung Kim [this message]
2024-12-05 15:30         ` Arnaldo Carvalho de Melo
2024-12-11 17:27           ` Namhyung Kim
2024-12-12  2:00             ` Oliver Sang
2024-12-06  2:10         ` Oliver Sang

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=Z1DV0lN8qHSysX7f@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=atishp@atishpatra.org \
    --cc=james.clark@arm.com \
    --cc=james.clark@linaro.org \
    --cc=kan.liang@linux.intel.com \
    --cc=kjain@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mizhang@google.com \
    --cc=oe-lkp@lists.linux.dev \
    --cc=oliver.sang@intel.com \
    --cc=palmer@rivosinc.com \
    --cc=ravi.bangoria@amd.com \
    --cc=tmricht@linux.ibm.com \
    /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).