Re: [PATCH v16 0/4] perf: Support the deferred unwinding infrastructure

Steven Rostedt
2025-10-23T16:40:45Z

On Thu, 23 Oct 2025 17:00:02 +0200
Peter Zijlstra <peterz@infradead.org> wrote:

> +/* Deferred unwinding callback for task specific events */
> +static void perf_unwind_deferred_callback(struct unwind_work *work,
> + struct unwind_stacktrace *trace, u64 cookie)
> +{
> + struct perf_callchain_deferred_event deferred_event = {
> + .trace = trace,
> + .event = {
> + .header = {
> + .type = PERF_RECORD_CALLCHAIN_DEFERRED,
> + .misc = PERF_RECORD_MISC_USER,
> + .size = sizeof(deferred_event.event) +
> + (trace->nr * sizeof(u64)),
> + },
> + .cookie = cookie,
> + .nr = trace->nr,
> + },
> + };
> +
> + perf_iterate_sb(perf_callchain_deferred_output, &deferred_event, NULL);
> +}
> +

So "perf_iterate_sb()" was the key point I was missing. I'm guessing it's
basically a demultiplexer that distributes events to all the requestors?

If I had know this, I would have done it completely different.

-- Steve