From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Thomas Falcon <thomas.falcon@intel.com>,
Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
Song Liu <songliubraving@fb.com>,
bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-perf-users@vger.kernel.org,
Howard Chu <howardchu95@gmail.com>,
Gabriele Monaco <gmonaco@redhat.com>,
Athira Rajeev <atrajeev@linux.vnet.ibm.com>,
James Clark <james.clark@linaro.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Tengda Wu <wutengda@huaweicloud.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH v1 2/2] perf bpf_counter: Fix handling of cpumap fixing hybrid
Date: Mon, 6 Oct 2025 16:57:53 -0300 [thread overview]
Message-ID: <aOQfQW5WODbioEiA@x1> (raw)
In-Reply-To: <CAP-5=fVHetc8DqdqxURJm_VtaH6apJKoyVOSpfQrE2ntkEa+4g@mail.gmail.com>
On Mon, Oct 06, 2025 at 09:18:22AM -0700, Ian Rogers wrote:
> On Wed, Oct 1, 2025 at 11:12 AM Ian Rogers <irogers@google.com> wrote:
> >
> > Don't open evsels on all CPUs, open them just on the CPUs they
> > support. This avoids opening say an e-core event on a p-core and
> > getting a failure - achieve this by getting rid of the "all_cpu_map".
> >
> > In install_pe functions don't use the cpu_map_idx as a CPU number,
> > translate the cpu_map_idx, which is a dense index into the cpu_map
> > skipping holes at the beginning, to a proper CPU number.
> >
> > Before:
> > ```
> > $ perf stat --bpf-counters -a -e cycles,instructions -- sleep 1
> >
> > Performance counter stats for 'system wide':
> >
> > <not supported> cpu_atom/cycles/
> > 566,270,672 cpu_core/cycles/
> > <not supported> cpu_atom/instructions/
> > 572,792,836 cpu_core/instructions/ # 1.01 insn per cycle
> >
> > 1.001595384 seconds time elapsed
> > ```
> >
> > After:
> > ```
> > $ perf stat --bpf-counters -a -e cycles,instructions -- sleep 1
> >
> > Performance counter stats for 'system wide':
> >
> > 443,299,201 cpu_atom/cycles/
> > 1,233,919,737 cpu_core/cycles/
> > 213,634,112 cpu_atom/instructions/ # 0.48 insn per cycle
> > 2,758,965,527 cpu_core/instructions/ # 2.24 insn per cycle
> >
> > 1.001699485 seconds time elapsed
> > ```
> >
> > Fixes: 7fac83aaf2ee ("perf stat: Introduce 'bperf' to share hardware PMCs with BPF")
> > Signed-off-by: Ian Rogers <irogers@google.com>
>
> +Thomas Falcon
>
> I think it'd be nice to get this quite major fix for
> --bpf-counters/bperf for hybrid architectures into v6.18 and stable
> builds. Thomas would it be possible for you to give a Tested-by tag
> using the reproduction in the commit message?
Its even already in linux-next:
⬢ [acme@toolbx perf-tools-next]$ git log -5 --oneline linux-next/master tools/perf/util/bpf_counter.c
b91917c0c6fa6df9 perf bpf_counter: Fix handling of cpumap fixing hybrid
8c519a825b4add85 perf bpf_counter: Move header declarations into C code
07dc3a6de33098b0 perf stat: Support inherit events during fork() for bperf
effe957c6bb70cac libperf cpumap: Replace usage of perf_cpu_map__new(NULL) with perf_cpu_map__new_online_cpus()
b84b3f47921568a8 perf bpf_counter: Fix a few memory leaks
⬢ [acme@toolbx perf-tools-next]$
next prev parent reply other threads:[~2025-10-06 19:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-01 18:12 [PATCH v1 1/2] perf bpf_counter: Move header declarations into C code Ian Rogers
2025-10-01 18:12 ` [PATCH v1 2/2] perf bpf_counter: Fix handling of cpumap fixing hybrid Ian Rogers
2025-10-06 16:18 ` Ian Rogers
2025-10-06 19:57 ` Arnaldo Carvalho de Melo [this message]
2025-10-06 21:20 ` Ian Rogers
2025-10-06 20:47 ` Falcon, Thomas
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=aOQfQW5WODbioEiA@x1 \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=atrajeev@linux.vnet.ibm.com \
--cc=bpf@vger.kernel.org \
--cc=gmonaco@redhat.com \
--cc=howardchu95@gmail.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=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=songliubraving@fb.com \
--cc=thomas.falcon@intel.com \
--cc=wutengda@huaweicloud.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).