From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Antoine HURET <antoine.huret@bull.com>,
Ingo Molnar <mingo@redhat.com>,
Namhyung Kim <namhyung@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>,
James Clark <james.clark@linaro.org>,
Ravi Bangoria <ravi.bangoria@amd.com>,
"linux-perf-users@vger.kernel.org"
<linux-perf-users@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"regressions@lists.linux.dev" <regressions@lists.linux.dev>
Subject: Re: [REGRESSION] perf: Rewrite core context handling breaks multiplexed cgroup events
Date: Fri, 23 Oct 2026 18:28:59 -0300 [thread overview]
Message-ID: <atvRmz_uGKpiYfMv@phoenix2> (raw)
In-Reply-To: <20261015132135.GK4121339@noisy.programming.kicks-ass.net>
On Thu, Oct 15, 2026 at 03:21:35PM +0200, Peter Zijlstra wrote:
> On Thu, Oct 15, 2026 at 12:30:55PM +0000, Antoine HURET wrote:
> > On Thu, Oct 15, 2026 at 11:13 UTC, Peter Zijlstra wrote:
> > > /me mutters something about having to go install and learn docker and
> > > what's wrong with simple shells scripts that poke about in /cgroup
> > > filesystems :-)
> > Fair enough, sorry about that! Next time I'll do plain cgroupfs,
> > promised :-)
> FWIW, it might be useful to extend perf-test with a bunch of cgroup
> tests - this one included. AFAICT we have nothing there atm.
The more the merrier, so far:
acme@phoenix2:~/git/perf-tools-next$ grep -rw cgroup tools/perf/tests/
tools/perf/tests/expand-cgroup.c:#include "cgroup.h"
tools/perf/tests/expand-cgroup.c: pr_debug("cgroup name doesn't match:\n");
tools/perf/tests/shell/lib/perf_json_output_lint.py: 'cgroup': lambda x: True,
tools/perf/tests/shell/lock_contention.sh: echo "Testing perf lock contention --lock-cgroup"
tools/perf/tests/shell/lock_contention.sh: perf lock con -a -b --lock-cgroup -E 1 -q -- ${msg_workload} > /dev/null 2> ${result}
tools/perf/tests/shell/lock_contention.sh: echo "Testing perf lock contention --cgroup-filter"
tools/perf/tests/shell/lock_contention.sh: perf lock con -a -b --lock-cgroup -E 1 -F wait_total -q \
tools/perf/tests/shell/lock_contention.sh: echo "[Fail] BPF result should have a cgroup result:" "$(cat "${result}")"
tools/perf/tests/shell/lock_contention.sh: cgroup=$(cat "${result}" | awk '{ print $3 }')
tools/perf/tests/shell/lock_contention.sh: perf lock con -a -b --lock-cgroup -E 1 -G "${cgroup}" -q \
tools/perf/tests/shell/lock_contention.sh: echo "[Fail] BPF result should have a result with cgroup filter:" "$(cat "${cgroup}")"
tools/perf/tests/shell/record_bpf_filter.sh: if ! perf record -e task-clock --filter 'cgroup == /' \
tools/perf/tests/shell/record_bpf_filter.sh: -a --all-cgroups --synth=cgroup -o "${perfdata}" true 2> /dev/null
tools/perf/tests/shell/record_bpf_filter.sh: echo "Cgroup bpf-filter test [Skipped cgroup not supported]"
tools/perf/tests/shell/record_bpf_filter.sh: # 'cgroup' requires PERF_SAMPLE_CGROUP flag
tools/perf/tests/shell/record_bpf_filter.sh: if ! perf record -e task-clock --filter 'cgroup == /' \
tools/perf/tests/shell/record_bpf_filter.sh: if ! perf report -i "${perfdata}" -s cgroup -q | grep -q -F '100.00%'
tools/perf/tests/shell/record_bpf_filter.sh: echo "Cgroup bpf-filter test [Failed root cgroup does not have 100%]"
tools/perf/tests/shell/record.sh: perf script -i "${perfdata}" -F cgroup 2>/dev/null | grep -q -v "unknown"
tools/perf/tests/shell/record.sh: -aB --synth=cgroup --all-cgroups || ret=$?
tools/perf/tests/shell/trace_summary.sh:# summary only for system wide - cgroup summary mode with BPF
tools/perf/tests/shell/trace_summary.sh:test_perf_trace "-as --summary-mode=cgroup --bpf-summary"
tools/perf/tests/shell/trace_summary.sh:# summary with normal output for system wide - cgroup summary mode with BPF
tools/perf/tests/shell/trace_summary.sh:test_perf_trace "-aS --summary-mode=cgroup --bpf-summary"
tools/perf/tests/shell/stat_bpf_counters_cgrp.sh:# perf stat --bpf-counters --for-each-cgroup test (no_mlock)
tools/perf/tests/shell/stat_bpf_counters_cgrp.sh:# skip if --bpf-counters --for-each-cgroup is not supported
tools/perf/tests/shell/stat_bpf_counters_cgrp.sh: if ! perf stat -a --bpf-counters --for-each-cgroup / true > /dev/null 2>&1; then
tools/perf/tests/shell/stat_bpf_counters_cgrp.sh: echo "Skipping: --bpf-counters --for-each-cgroup not supported"
tools/perf/tests/shell/stat_bpf_counters_cgrp.sh: perf --no-pager stat -a --bpf-counters --for-each-cgroup / true || true
tools/perf/tests/shell/stat_bpf_counters_cgrp.sh: if [ -d /sys/fs/cgroup/system.slice ] && [ -d /sys/fs/cgroup/user.slice ]; then
tools/perf/tests/shell/stat_bpf_counters_cgrp.sh: find_cgroups_self_cgrp=$(grep perf_event /proc/self/cgroup | cut -d: -f3)
tools/perf/tests/shell/stat_bpf_counters_cgrp.sh: # cgroup v2 doesn't specify perf_event
tools/perf/tests/shell/stat_bpf_counters_cgrp.sh: find_cgroups_self_cgrp=$(grep ^0: /proc/self/cgroup | cut -d: -f3)
tools/perf/tests/shell/stat_bpf_counters_cgrp.sh:# As cgroup events are cpu-wide, we cannot simply compare the result.
tools/perf/tests/shell/stat_bpf_counters_cgrp.sh: check_system_wide_counted_output=$(perf stat -a --bpf-counters --for-each-cgroup ${test_cgroups} -e cpu-clock -x, sleep 1 2>&1)
tools/perf/tests/shell/stat_bpf_counters_cgrp.sh: expand_output=$(perf stat -a -x, --bpf-counters --for-each-cgroup / true 2>&1 | wc -l)
tools/perf/tests/shell/stat_metrics_cgrp.sh:# perf stat metrics --for-each-cgroup test (no_mlock)
tools/perf/tests/shell/stat_metrics_cgrp.sh: if [ -d /sys/fs/cgroup/system.slice ] && [ -d /sys/fs/cgroup/user.slice ]
tools/perf/tests/shell/stat_metrics_cgrp.sh: find_cgroups_self_cgrp=$(grep perf_event /proc/self/cgroup | cut -d: -f3)
tools/perf/tests/shell/stat_metrics_cgrp.sh: # cgroup v2 doesn't specify perf_event
tools/perf/tests/shell/stat_metrics_cgrp.sh: find_cgroups_self_cgrp=$(grep ^0: /proc/self/cgroup | cut -d: -f3)
tools/perf/tests/shell/stat_metrics_cgrp.sh:# Check if metric is reported for each cgroup
tools/perf/tests/shell/stat_metrics_cgrp.sh: --for-each-cgroup "${test_cgroups}" \
tools/perf/tests/shell/stat_metrics_cgrp.sh: # Find metric lines for this cgroup
tools/perf/tests/shell/stat_metrics_cgrp.sh: /) # The root cgroup, leave unchanged.
tools/perf/tests/shell/stat_metrics_cgrp.sh: # We use exact cgroup match with surrounding commas
tools/perf/tests/shell/stat_metrics_cgrp.sh: echo "FAIL: No metric lines found for cgroup '${cgrp}'"
tools/perf/tests/shell/stat_metrics_cgrp.sh: log_verbose "Enforcing metric check for cgroup '${cgrp}' \
tools/perf/tests/shell/stat_metrics_cgrp.sh:for cgroup '${cgrp}'"
tools/perf/tests/shell/stat_metrics_cgrp.sh: echo "FAIL: Empty metric value for cgroup '${cgrp}'"
tools/perf/tests/shell/stat_metrics_cgrp.sh: log_verbose "Skipping metric check for cgroup '${cgrp}' \
tools/perf/tests/shell/stat_metrics_cgrp.sh:if perf stat -a --bpf-counters --for-each-cgroup / true > /dev/null 2>&1
tools/perf/tests/sample-parsing.c: COMP(cgroup);
tools/perf/tests/sample-parsing.c: .cgroup = 114,
tools/perf/tests/Build:perf-test-y += expand-cgroup.o
acme@phoenix2:~/git/perf-tools-next$
- Arnaldo
prev parent reply other threads:[~2026-10-23 21:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 9:03 [REGRESSION] perf: Rewrite core context handling breaks multiplexed cgroup events Antoine HURET
2026-10-15 11:13 ` Peter Zijlstra
2026-10-15 12:30 ` Antoine HURET
2026-10-15 13:21 ` Peter Zijlstra
2026-10-23 21:28 ` Arnaldo Carvalho de Melo [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=atvRmz_uGKpiYfMv@phoenix2 \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=antoine.huret@bull.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=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=ravi.bangoria@amd.com \
--cc=regressions@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.