]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tools headers UAPI: Sync linux/perf_event.h for deferred callchains
authorNamhyung Kim <namhyung@kernel.org>
Thu, 20 Nov 2025 23:47:59 +0000 (15:47 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Wed, 3 Dec 2025 00:13:32 +0000 (16:13 -0800)
It needs to sync with the kernel to support user space changes for the
deferred callchains.

Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/include/uapi/linux/perf_event.h

index 0d0ed85ad8cb348d5d655a9e5177b5ea2f4556c6..c44a8fb3e4181c91a1e6e3a40e23fcf1de421af3 100644 (file)
@@ -464,7 +464,9 @@ struct perf_event_attr {
                                inherit_thread :  1, /* children only inherit if cloned with CLONE_THREAD */
                                remove_on_exec :  1, /* event is removed from task on exec */
                                sigtrap        :  1, /* send synchronous SIGTRAP on event */
-                               __reserved_1   : 26;
+                               defer_callchain:  1, /* request PERF_RECORD_CALLCHAIN_DEFERRED records */
+                               defer_output   :  1, /* output PERF_RECORD_CALLCHAIN_DEFERRED records */
+                               __reserved_1   : 24;
 
        union {
                __u32           wakeup_events;    /* wake up every n events */
@@ -1241,6 +1243,22 @@ enum perf_event_type {
         */
        PERF_RECORD_AUX_OUTPUT_HW_ID            = 21,
 
+       /*
+        * This user callchain capture was deferred until shortly before
+        * returning to user space.  Previous samples would have kernel
+        * callchains only and they need to be stitched with this to make full
+        * callchains.
+        *
+        * struct {
+        *      struct perf_event_header        header;
+        *      u64                             cookie;
+        *      u64                             nr;
+        *      u64                             ips[nr];
+        *      struct sample_id                sample_id;
+        * };
+        */
+       PERF_RECORD_CALLCHAIN_DEFERRED          = 22,
+
        PERF_RECORD_MAX,                        /* non-ABI */
 };
 
@@ -1271,6 +1289,7 @@ enum perf_callchain_context {
        PERF_CONTEXT_HV                         = (__u64)-32,
        PERF_CONTEXT_KERNEL                     = (__u64)-128,
        PERF_CONTEXT_USER                       = (__u64)-512,
+       PERF_CONTEXT_USER_DEFERRED              = (__u64)-640,
 
        PERF_CONTEXT_GUEST                      = (__u64)-2048,
        PERF_CONTEXT_GUEST_KERNEL               = (__u64)-2176,