* Re: [PATCH 0/2] perf: Fix PERF_EVENT_IOC_REFRESH for tracepoints and breakpoints
@ 2026-11-03 13:11 Paolo Bertinetti
2026-11-03 15:10 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bertinetti @ 2026-11-03 13:11 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar
Cc: Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers,
Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
James Clark, Kan Liang, Leo Yan, Francesco Nigro,
Sumanth Korikkar, linux-perf-users, linux-trace-kernel,
linux-kernel, regressions
This series went out twice by mistake. Please ignore this copy and
reply to the first one:
https://lore.kernel.org/r/20261103130732.764081-1-paolobertinetti200f4@proton.me/
Sorry for the noise.
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 0/2] perf: Fix PERF_EVENT_IOC_REFRESH for tracepoints and breakpoints
2026-11-03 13:11 [PATCH 0/2] perf: Fix PERF_EVENT_IOC_REFRESH for tracepoints and breakpoints Paolo Bertinetti
@ 2026-11-03 15:10 ` Steven Rostedt
0 siblings, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2026-11-03 15:10 UTC (permalink / raw)
To: Paolo Bertinetti
Cc: Peter Zijlstra, Ingo Molnar, Masami Hiramatsu, Mathieu Desnoyers,
Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
James Clark, Kan Liang, Leo Yan, Francesco Nigro,
Sumanth Korikkar, linux-perf-users, linux-trace-kernel,
linux-kernel, regressions
On Tue, 03 Nov 2026 13:11:41 +0000
Paolo Bertinetti <paolobertinetti200f4@proton.me> wrote:
> This series went out twice by mistake. Please ignore this copy and
> reply to the first one:
>
> https://lore.kernel.org/r/20261103130732.764081-1-paolobertinetti200f4@proton.me/
>
> Sorry for the noise.
Yet this one has the cover letter whereas the other one does not :-/
-- Steve
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 0/2] perf: Fix PERF_EVENT_IOC_REFRESH for tracepoints and breakpoints
@ 2026-11-03 13:07 Paolo Bertinetti
0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bertinetti @ 2026-11-03 13:07 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar
Cc: Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers,
Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
James Clark, Kan Liang, Leo Yan, Francesco Nigro,
Sumanth Korikkar, linux-perf-users, linux-trace-kernel,
linux-kernel, regressions
Since commit 18dbcbfabfff ("perf: Fix the POLL_HUP delivery breakage"),
an event that reaches its PERF_EVENT_IOC_REFRESH limit is stopped with
pmu->stop() and disabled. Re-arming it adds it back with PERF_EF_START,
but perf_trace_add() and hw_breakpoint_add() never clear
PERF_HES_STOPPED. Tracepoint, kprobe, uprobe and breakpoint events
re-armed this way deliver only their first overflow. Francesco reported
it with the "Event re-armed with PERF_EVENT_IOC_REFRESH" perf test,
found through an async-profiler bug.
These patches make both PMUs set the state from PERF_EF_START on every
add, as perf_swevent_add() does. The pmu->stop() call stays, so the
POLL_HUP fix of 18dbcbfabfff is kept.
Leo's series [1] removes that pmu->stop() call instead, which also
avoids this, and is still pending. Either way, add() with PERF_EF_START
should start the event.
Tested in QEMU/KVM, x86_64, 4 vCPUs, v7.4-rc1 with PROVE_LOCKING:
- perf test "Event re-armed with PERF_EVENT_IOC_REFRESH": the tracepoint
case goes from FAILED (count 1, 1 overflow) to Ok (count 1000, 1000
POLL_HUP signals).
- A small test that re-arms each event from its signal handler and
triggers it 200 times, overflows delivered:
v7.4-rc1 + patch 1 + patch 2
tracepoint 1 200 200
kprobe 1 200 200
uprobe 1 200 200
breakpoint 1 1 200
- The full perf test suite and tools/testing/selftests/perf_events give
the same results before and after, apart from the REFRESH test. Many
perf tests fail in my VM on both kernels, for setup reasons.
- No lockdep or other warnings in dmesg.
I can add kprobe, uprobe and breakpoint cases to the perf test if that
helps.
[1] https://lore.kernel.org/r/20260514-arm_cs_clean_perf_handle-v2-0-cbb29c3b3661@arm.com/
Paolo Bertinetti (2):
tracing/perf: Clear stop state in perf_trace_add()
perf/hw_breakpoint: Clear stop state in hw_breakpoint_add()
kernel/events/hw_breakpoint.c | 3 +--
kernel/trace/trace_event_perf.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-03 15:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03 13:11 [PATCH 0/2] perf: Fix PERF_EVENT_IOC_REFRESH for tracepoints and breakpoints Paolo Bertinetti
2026-11-03 15:10 ` Steven Rostedt
-- strict thread matches above, loose matches on Subject: below --
2026-11-03 13:07 Paolo Bertinetti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®