Mgerge remote-tracking branch 'torvalds/master' into perf/core
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 6 Aug 2020 11:15:47 +0000 (08:15 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 6 Aug 2020 11:15:47 +0000 (08:15 -0300)
To sync headers, for instance, in this case tools/perf was ahead of
upstream till Linus merged tip/perf/core to get the
PERF_RECORD_TEXT_POKE changes:

  Warning: Kernel ABI header at 'tools/include/uapi/linux/perf_event.h' differs from latest version at 'include/uapi/linux/perf_event.h'
  diff -u tools/include/uapi/linux/perf_event.h include/uapi/linux/perf_event.h

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1  2 
tools/build/feature/Makefile
tools/include/uapi/linux/perf_event.h

@@@ -68,12 -68,14 +68,12 @@@ FILES
           test-llvm-version.bin                        \
           test-libaio.bin                      \
           test-libzstd.bin                     \
-          test-clang-bpf-global-var.bin                \
+          test-clang-bpf-co-re.bin             \
           test-file-handle.bin                 \
           test-libpfm4.bin
  
  FILES := $(addprefix $(OUTPUT),$(FILES))
  
 -CC ?= $(CROSS_COMPILE)gcc
 -CXX ?= $(CROSS_COMPILE)g++
  PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
  LLVM_CONFIG ?= llvm-config
  CLANG ?= clang
@@@ -323,7 -325,7 +323,7 @@@ $(OUTPUT)test-libaio.bin
  $(OUTPUT)test-libzstd.bin:
        $(BUILD) -lzstd
  
- $(OUTPUT)test-clang-bpf-global-var.bin:
+ $(OUTPUT)test-clang-bpf-co-re.bin:
        $(CLANG) -S -g -target bpf -o - $(patsubst %.bin,%.c,$(@F)) |   \
                grep BTF_KIND_VAR
  
@@@ -383,8 -383,7 +383,8 @@@ struct perf_event_attr 
                                bpf_event      :  1, /* include bpf events */
                                aux_output     :  1, /* generate AUX records instead of events */
                                cgroup         :  1, /* include cgroup events */
 -                              __reserved_1   : 31;
 +                              text_poke      :  1, /* include text poke events */
 +                              __reserved_1   : 30;
  
        union {
                __u32           wakeup_events;    /* wakeup every n events */
@@@ -533,9 -532,10 +533,10 @@@ struct perf_event_mmap_page 
                                cap_bit0_is_deprecated  : 1, /* Always 1, signals that bit 0 is zero */
  
                                cap_user_rdpmc          : 1, /* The RDPMC instruction can be used to read counts */
-                               cap_user_time           : 1, /* The time_* fields are used */
+                               cap_user_time           : 1, /* The time_{shift,mult,offset} fields are used */
                                cap_user_time_zero      : 1, /* The time_zero field is used */
-                               cap_____res             : 59;
+                               cap_user_time_short     : 1, /* the time_{cycle,mask} fields are used */
+                               cap_____res             : 58;
                };
        };
  
         *               ((rem * time_mult) >> time_shift);
         */
        __u64   time_zero;
        __u32   size;                   /* Header size up to __reserved[] fields. */
+       __u32   __reserved_1;
+       /*
+        * If cap_usr_time_short, the hardware clock is less than 64bit wide
+        * and we must compute the 'cyc' value, as used by cap_usr_time, as:
+        *
+        *   cyc = time_cycles + ((cyc - time_cycles) & time_mask)
+        *
+        * NOTE: this form is explicitly chosen such that cap_usr_time_short
+        *       is a correction on top of cap_usr_time, and code that doesn't
+        *       know about cap_usr_time_short still works under the assumption
+        *       the counter doesn't wrap.
+        */
+       __u64   time_cycles;
+       __u64   time_mask;
  
                /*
                 * Hole for extension of the self monitor capabilities
                 */
  
-       __u8    __reserved[118*8+4];    /* align to 1k. */
+       __u8    __reserved[116*8];      /* align to 1k. */
  
        /*
         * Control data for the mmap() data buffer.
@@@ -1025,35 -1041,12 +1042,35 @@@ enum perf_event_type 
         */
        PERF_RECORD_CGROUP                      = 19,
  
 +      /*
 +       * Records changes to kernel text i.e. self-modified code. 'old_len' is
 +       * the number of old bytes, 'new_len' is the number of new bytes. Either
 +       * 'old_len' or 'new_len' may be zero to indicate, for example, the
 +       * addition or removal of a trampoline. 'bytes' contains the old bytes
 +       * followed immediately by the new bytes.
 +       *
 +       * struct {
 +       *      struct perf_event_header        header;
 +       *      u64                             addr;
 +       *      u16                             old_len;
 +       *      u16                             new_len;
 +       *      u8                              bytes[];
 +       *      struct sample_id                sample_id;
 +       * };
 +       */
 +      PERF_RECORD_TEXT_POKE                   = 20,
 +
        PERF_RECORD_MAX,                        /* non-ABI */
  };
  
  enum perf_record_ksymbol_type {
        PERF_RECORD_KSYMBOL_TYPE_UNKNOWN        = 0,
        PERF_RECORD_KSYMBOL_TYPE_BPF            = 1,
 +      /*
 +       * Out of line code such as kprobe-replaced instructions or optimized
 +       * kprobes or ftrace trampolines.
 +       */
 +      PERF_RECORD_KSYMBOL_TYPE_OOL            = 2,
        PERF_RECORD_KSYMBOL_TYPE_MAX            /* non-ABI */
  };