Syncing tools's uapi with mmap2 build id data changes.

Signed-off-by: Jiri Olsa <[email protected]>
---
 tools/include/uapi/linux/perf_event.h | 26 +++++++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/tools/include/uapi/linux/perf_event.h 
b/tools/include/uapi/linux/perf_event.h
index b95d3c485d27..b6caf61bf9fd 100644
--- a/tools/include/uapi/linux/perf_event.h
+++ b/tools/include/uapi/linux/perf_event.h
@@ -384,7 +384,8 @@ struct perf_event_attr {
                                aux_output     :  1, /* generate AUX records 
instead of events */
                                cgroup         :  1, /* include cgroup events */
                                text_poke      :  1, /* include text poke 
events */
-                               __reserved_1   : 30;
+                               build_id       :  1, /* use build id in mmap2 
events */
+                               __reserved_1   : 29;
 
        union {
                __u32           wakeup_events;    /* wakeup every n events */
@@ -688,6 +689,7 @@ struct perf_event_mmap_page {
  *
  *   PERF_RECORD_MISC_EXACT_IP           - PERF_RECORD_SAMPLE of precise events
  *   PERF_RECORD_MISC_SWITCH_OUT_PREEMPT - PERF_RECORD_SWITCH* events
+ *   PERF_RECORD_MISC_BUILD_ID           - PERF_RECORD_MMAP2 event
  *
  *
  * PERF_RECORD_MISC_EXACT_IP:
@@ -697,9 +699,13 @@ struct perf_event_mmap_page {
  *
  * PERF_RECORD_MISC_SWITCH_OUT_PREEMPT:
  *   Indicates that thread was preempted in TASK_RUNNING state.
+ *
+ * PERF_RECORD_MISC_BUILD_ID:
+ *   Indicates that mmap2 event carries build id data.
  */
 #define PERF_RECORD_MISC_EXACT_IP              (1 << 14)
 #define PERF_RECORD_MISC_SWITCH_OUT_PREEMPT    (1 << 14)
+#define PERF_RECORD_MISC_BUILD_ID              (1 << 14)
 /*
  * Reserve the last bit to indicate some extended misc field
  */
@@ -911,10 +917,20 @@ enum perf_event_type {
         *      u64                             addr;
         *      u64                             len;
         *      u64                             pgoff;
-        *      u32                             maj;
-        *      u32                             min;
-        *      u64                             ino;
-        *      u64                             ino_generation;
+        *      union {
+        *              struct {
+        *                      u32             maj;
+        *                      u32             min;
+        *                      u64             ino;
+        *                      u64             ino_generation;
+        *              };
+        *              struct {
+        *                      u8              build_id[20];
+        *                      u8              build_id_size;
+        *                      u8              __reserved_1;
+        *                      u16             __reserved_2;
+        *              };
+        *      };
         *      u32                             prot, flags;
         *      char                            filename[];
         *      struct sample_id                sample_id;
-- 
2.26.2

Reply via email to