From: Namhyung Kim <namhyung@kernel.org>
To: Tengda Wu <wutengda@huaweicloud.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
song@kernel.org, Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
kan.liang@linux.intel.com, linux-perf-users@vger.kernel.org,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH -next 0/2] perf stat: a set of small fixes for bperf
Date: Tue, 8 Oct 2024 22:20:16 -0700 [thread overview]
Message-ID: <ZwYSkJqKRmB5NXrx@google.com> (raw)
In-Reply-To: <20240925135523.367957-1-wutengda@huaweicloud.com>
Hello,
On Wed, Sep 25, 2024 at 01:55:21PM +0000, Tengda Wu wrote:
> Hi,
>
> This is a set of small fixes for bperf (perf-stat --bpf-counters).
>
> It aims to fix the following two issues:
> 1) bperf limited the number of events to a maximum of 16, which
> caused failures in some scenarios and lacked friendly prompts.
> 2) bperf failed to correctly handle whether events were supported,
> resulting in the incorrect display when the event count was 0.
>
> The reason for fixing these issues is that bperf is very useful in
> some cost-sensitive scenarios, such as top-down analysis scenarios.
> Increasing the attr map size can allow these scenarios to collect
> more events at the same time, making it possible to gather enough
> information to perform complex metric calculations in top-down.
So I tried this patchset and found a couple of issues.
1. Running bperf failed due to perf_event_attr map locking issue.
It seems that the message is misleading since it didn't to get the
lock actually. I think it failed the map is not compatible anymore
and the error message should say about that.
2. It seems bperf keeps the map pinned in the file system. I'm not sure
if we have an option to unpin the map automatically. I had to find
the path and delete it manually.
3. Currently bperf doesn't support event groups. On Intel machines,
topdown metrics are enabled by default and it makes the perf stat
failing when --bpf-counters option is used (after the step 2).
$ sudo ./perf stat -a --bpf-counters true
bpf managed perf events do not yet support groups.
Maybe we need to drop the topdown metrics when bperf fails.
Thanks,
Namhyung
>
> Thanks,
> Tengda
>
> Tengda Wu (2):
> perf stat: Increase perf_attr_map entries
> perf stat: Fix incorrect display of bperf when event count is 0
>
> tools/lib/perf/include/perf/bpf_perf.h | 1 +
> tools/perf/util/bpf_counter.c | 26 +++++++++++++++++---------
> 2 files changed, 18 insertions(+), 9 deletions(-)
>
> --
> 2.34.1
>
prev parent reply other threads:[~2024-10-09 5:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-25 13:55 [PATCH -next 0/2] perf stat: a set of small fixes for bperf Tengda Wu
2024-09-25 13:55 ` [PATCH -next 1/2] perf stat: Increase perf_attr_map entries Tengda Wu
2024-09-26 4:16 ` Namhyung Kim
2024-09-27 2:35 ` Tengda Wu
2024-09-27 17:12 ` Namhyung Kim
2024-09-29 0:54 ` Tengda Wu
2024-09-25 13:55 ` [PATCH -next 2/2] perf stat: Fix incorrect display of bperf when event count is 0 Tengda Wu
2024-10-09 5:20 ` Namhyung Kim [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=ZwYSkJqKRmB5NXrx@google.com \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=bpf@vger.kernel.org \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=song@kernel.org \
--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