Files
linux/include/uapi/linux
Peter Zijlstra c69993ecdd perf: Support deferred user unwind
Add support for deferred userspace unwind to perf.

Where perf currently relies on in-place stack unwinding; from NMI
context and all that. This moves the userspace part of the unwind to
right before the return-to-userspace.

This has two distinct benefits, the biggest is that it moves the
unwind to a faultable context. It becomes possible to fault in debug
info (.eh_frame, SFrame etc.) that might not otherwise be readily
available. And secondly, it de-duplicates the user callchain where
multiple samples happen during the same kernel entry.

To facilitate this the perf interface is extended with a new record
type:

  PERF_RECORD_CALLCHAIN_DEFERRED

and two new attribute flags:

  perf_event_attr::defer_callchain - to request the user unwind be deferred
  perf_event_attr::defer_output    - to request PERF_RECORD_CALLCHAIN_DEFERRED records

The existing PERF_RECORD_SAMPLE callchain section gets a new
context type:

  PERF_CONTEXT_USER_DEFERRED

After which will come a single entry, denoting the 'cookie' of the
deferred callchain that should be attached here, matching the 'cookie'
field of the above mentioned PERF_RECORD_CALLCHAIN_DEFERRED.

The 'defer_callchain' flag is expected on all events with
PERF_SAMPLE_CALLCHAIN. The 'defer_output' flag is expect on the event
responsible for collecting side-band events (like mmap, comm etc.).
Setting 'defer_output' on multiple events will get you duplicated
PERF_RECORD_CALLCHAIN_DEFERRED records.

Based on earlier patches by Josh and Steven.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20251023150002.GR4067720@noisy.programming.kicks-ass.net
2025-10-29 10:29:58 +01:00
..
2024-04-15 13:42:38 +02:00
2025-02-05 13:22:04 +09:00
2024-06-11 12:57:49 -05:00
2025-02-12 02:29:30 +00:00
2025-09-19 14:26:16 +02:00
2025-08-29 15:08:07 +02:00
2025-09-05 09:11:28 +02:00
2025-05-03 12:02:09 +02:00
2024-05-07 01:35:57 +02:00
2025-07-14 09:15:58 +02:00
2024-04-01 10:49:28 +01:00
2024-08-26 09:37:23 -07:00
2025-09-15 14:32:54 +02:00
2024-06-01 07:28:21 +02:00
2024-09-01 20:26:05 -07:00
2025-04-17 11:09:10 +02:00
2024-08-19 22:36:26 -04:00
2025-07-08 12:39:24 +02:00
2023-12-15 17:01:30 +01:00
2024-09-06 08:31:40 -06:00
2024-08-12 17:50:34 -07:00
2023-11-28 19:05:16 +00:00
2025-01-08 13:18:11 +01:00
2025-04-17 12:30:02 +02:00
2025-06-24 15:50:06 +02:00
2023-12-20 19:26:31 -05:00
2025-02-25 18:14:03 -08:00
2025-07-14 18:41:42 -07:00
2025-09-15 17:34:06 +02:00
2025-06-19 14:28:22 +02:00
2025-05-21 13:41:03 +02:00
2025-04-17 12:30:02 +02:00
2023-12-29 11:58:24 -08:00
2025-09-21 17:44:20 -04:00
2025-09-22 09:29:28 +01:00
2025-05-27 10:27:54 -04:00
2025-09-22 09:29:29 +01:00