From: Namhyung Kim <namhyung@kernel.org>
To: sashiko-reviews@lists.linux.dev
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2 4/4] perf test: Update test for --for-each-cgroup option
Date: Fri, 10 Jul 2026 16:59:09 -0700 [thread overview]
Message-ID: <alGHTR25xLliMEUJ@google.com> (raw)
In-Reply-To: <20260710235200.CD3001F000E9@smtp.kernel.org>
On Fri, Jul 10, 2026 at 11:52:00PM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
> - [Medium] The `check_evlist_expand()` test fails to exercise the bug it intends to verify because it specifies `-e cpu-clock`.
> - [Medium] Bash pipeline semantics mask `perf stat` command failures, potentially causing false test passes.
> --
>
> --- Patch [4]: [PATCH v2 4/4] perf test: Update test for --for-each-cgroup option ---
> commit b42b21fdf494fb61acde3f563ac29e9b49df9327
> Author: Namhyung Kim <namhyung@kernel.org>
>
> perf test: Update test for --for-each-cgroup option
>
> This commit updates the stat_bpf_counters_cgrp.sh test to simply check the
> number of output lines with and without the --for-each-cgroup option.
>
> > diff --git a/tools/perf/tests/shell/stat_bpf_counters_cgrp.sh b/tools/perf/tests/shell/stat_bpf_counters_cgrp.sh
> > index ff2e06c408bc6..17b17b112169c 100755
> > --- a/tools/perf/tests/shell/stat_bpf_counters_cgrp.sh
> > +++ b/tools/perf/tests/shell/stat_bpf_counters_cgrp.sh
> [ ... ]
> > @@ -58,9 +58,24 @@ check_system_wide_counted()
> > fi
> > }
> >
> > +# Missing flags in evlist__clone() resulted in different output.
> > +# Just check the number of output lines for simple verification.
> > +check_evlist_expand()
> > +{
> > + normal_output=$(perf stat -a -e cpu-clock -x, true 2>&1 | wc -l)
> > + expand_output=$(perf stat -a -e cpu-clock -x, --bpf-counters --for-each-cgroup / true 2>&1 | wc -l)
>
> [Severity: Medium]
> Will this actually test the bug with evlist__clone() missing flags?
>
> By specifying -e cpu-clock, the loading of default events is disabled,
> meaning default_metricgroup and default_show_events are false. This prevents
> the duplication bug from occurring during evsel__clone(), rendering the test
> ineffective at catching the regression it was meant to verify.
Oops, that's right. It should have this on top.
Thanks,
Namhyung
diff --git a/tools/perf/tests/shell/stat_bpf_counters_cgrp.sh b/tools/perf/tests/shell/stat_bpf_counters_cgrp.sh
index 17b17b112169c8ba..febe3af0644157f3 100755
--- a/tools/perf/tests/shell/stat_bpf_counters_cgrp.sh
+++ b/tools/perf/tests/shell/stat_bpf_counters_cgrp.sh
@@ -62,8 +62,8 @@ check_system_wide_counted()
# Just check the number of output lines for simple verification.
check_evlist_expand()
{
- normal_output=$(perf stat -a -e cpu-clock -x, true 2>&1 | wc -l)
- expand_output=$(perf stat -a -e cpu-clock -x, --bpf-counters --for-each-cgroup / true 2>&1 | wc -l)
+ normal_output=$(perf stat -a -x, true 2>&1 | wc -l)
+ expand_output=$(perf stat -a -x, --bpf-counters --for-each-cgroup / true 2>&1 | wc -l)
if [ "${normal_output}" != "${expand_output}" ]; then
if [ "${verbose}" = "1" ]; then
echo "Normal output has ${normal_output} lines, but it now has ${expand_output}"
prev parent reply other threads:[~2026-07-10 23:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-10 23:41 [PATCH v2 1/4] perf stat: Fix duplicate output with --for-each-cgroup Namhyung Kim
2026-07-10 23:41 ` [PATCH v2 2/4] perf evsel: Remove unused BPF related fields Namhyung Kim
2026-07-10 23:41 ` [PATCH v2 3/4] perf evsel: Arrange some fields that should be cloned Namhyung Kim
2026-07-10 23:41 ` [PATCH v2 4/4] perf test: Update test for --for-each-cgroup option Namhyung Kim
2026-07-10 23:52 ` sashiko-bot
2026-07-10 23:59 ` 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=alGHTR25xLliMEUJ@google.com \
--to=namhyung@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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