[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zw9CK2mS6fHoxnKf@google.com>
Date: Tue, 15 Oct 2024 21:33:47 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Ravi Bangoria <ravi.bangoria@....com>
Cc: Ian Rogers <irogers@...gle.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Kan Liang <kan.liang@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
linux-perf-users@...r.kernel.org,
Mark Rutland <mark.rutland@....com>,
James Clark <james.clark@....com>, Kajol Jain <kjain@...ux.ibm.com>,
Thomas Richter <tmricht@...ux.ibm.com>,
Atish Patra <atishp@...shpatra.org>,
Palmer Dabbelt <palmer@...osinc.com>,
Mingwei Zhang <mizhang@...gle.com>
Subject: Re: [PATCH 7/8] perf tools: Check fallback error and order
Hello Ravi,
On Tue, Oct 15, 2024 at 09:51:50AM +0530, Ravi Bangoria wrote:
> > @@ -2366,9 +2403,6 @@ static int evsel__open_cpu(struct evsel *evsel, struct perf_cpu_map *cpus,
> > return 0;
> >
> > try_fallback:
> > - if (evsel__precise_ip_fallback(evsel))
> > - goto retry_open;
> > -
> > if (evsel__ignore_missing_thread(evsel, perf_cpu_map__nr(cpus),
> > idx, threads, thread, err)) {
> > /* We just removed 1 thread, so lower the upper nthreads limit. */
> > @@ -2385,11 +2419,15 @@ 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 != -EINVAL || idx > 0 || thread > 0)
> > - goto out_close;
> > + if (err == -EOPNOTSUPP && evsel__precise_ip_fallback(evsel))
> > + goto retry_open;
>
> This will change the behavior of events like instructions:P on AMD.
>
> Without patch:
> $ ./perf record -e instructions:P -- true
> [ perf record: Woken up 2 times to write data ]
> [ perf record: Captured and wrote 0.009 MB perf.data (9 samples) ]
>
> With the patch:
>
> $ ./perf record -e instructions:P -- true
> Error:
> The instructions:Pu event is not supported.
Thanks for the test, it should support other events too. I've noticed
it returns -ENOENT for non-IBS events with precise_ip > 0. Will handle
them as well.
Thanks,
Namhyung
Powered by blists - more mailing lists