Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools headers uapi: Update tools's copy of linux/perf_event.h

To get the changes in these csets:

2a6c6b7d7ad346f0 ("perf/core: Add PERF_SAMPLE_WEIGHT_STRUCT")
61b985e3e775a3a7 ("perf/x86/intel: Add perf core PMU support for Sapphire Rapids")

This cures the following warning during perf's build:

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

Committer notes:

Picked by hand as I had already merged the MMAP buildid patch that also touches
perf_event.h and is also only in {acme,tip}/perf/core, not yet upstream.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/1612296553-21962-2-git-send-email-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Kan Liang and committed by
Arnaldo Carvalho de Melo
81898ef1 068aeea3

+50 -4
+50 -4
tools/include/uapi/linux/perf_event.h
··· 145 145 PERF_SAMPLE_CGROUP = 1U << 21, 146 146 PERF_SAMPLE_DATA_PAGE_SIZE = 1U << 22, 147 147 PERF_SAMPLE_CODE_PAGE_SIZE = 1U << 23, 148 + PERF_SAMPLE_WEIGHT_STRUCT = 1U << 24, 148 149 149 - PERF_SAMPLE_MAX = 1U << 24, /* non-ABI */ 150 + PERF_SAMPLE_MAX = 1U << 25, /* non-ABI */ 150 151 151 152 __PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63, /* non-ABI; internal use */ 152 153 }; 153 154 155 + #define PERF_SAMPLE_WEIGHT_TYPE (PERF_SAMPLE_WEIGHT | PERF_SAMPLE_WEIGHT_STRUCT) 154 156 /* 155 157 * values to program into branch_sample_type when PERF_SAMPLE_BRANCH is set 156 158 * ··· 914 912 * char data[size]; 915 913 * u64 dyn_size; } && PERF_SAMPLE_STACK_USER 916 914 * 917 - * { u64 weight; } && PERF_SAMPLE_WEIGHT 915 + * { union perf_sample_weight 916 + * { 917 + * u64 full; && PERF_SAMPLE_WEIGHT 918 + * #if defined(__LITTLE_ENDIAN_BITFIELD) 919 + * struct { 920 + * u32 var1_dw; 921 + * u16 var2_w; 922 + * u16 var3_w; 923 + * } && PERF_SAMPLE_WEIGHT_STRUCT 924 + * #elif defined(__BIG_ENDIAN_BITFIELD) 925 + * struct { 926 + * u16 var3_w; 927 + * u16 var2_w; 928 + * u32 var1_dw; 929 + * } && PERF_SAMPLE_WEIGHT_STRUCT 930 + * #endif 931 + * } 932 + * } 918 933 * { u64 data_src; } && PERF_SAMPLE_DATA_SRC 919 934 * { u64 transaction; } && PERF_SAMPLE_TRANSACTION 920 935 * { u64 abi; # enum perf_sample_regs_abi ··· 1178 1159 mem_lvl_num:4, /* memory hierarchy level number */ 1179 1160 mem_remote:1, /* remote */ 1180 1161 mem_snoopx:2, /* snoop mode, ext */ 1181 - mem_rsvd:24; 1162 + mem_blk:3, /* access blocked */ 1163 + mem_rsvd:21; 1182 1164 }; 1183 1165 }; 1184 1166 #elif defined(__BIG_ENDIAN_BITFIELD) 1185 1167 union perf_mem_data_src { 1186 1168 __u64 val; 1187 1169 struct { 1188 - __u64 mem_rsvd:24, 1170 + __u64 mem_rsvd:21, 1171 + mem_blk:3, /* access blocked */ 1189 1172 mem_snoopx:2, /* snoop mode, ext */ 1190 1173 mem_remote:1, /* remote */ 1191 1174 mem_lvl_num:4, /* memory hierarchy level number */ ··· 1270 1249 #define PERF_MEM_TLB_OS 0x40 /* OS fault handler */ 1271 1250 #define PERF_MEM_TLB_SHIFT 26 1272 1251 1252 + /* Access blocked */ 1253 + #define PERF_MEM_BLK_NA 0x01 /* not available */ 1254 + #define PERF_MEM_BLK_DATA 0x02 /* data could not be forwarded */ 1255 + #define PERF_MEM_BLK_ADDR 0x04 /* address conflict */ 1256 + #define PERF_MEM_BLK_SHIFT 40 1257 + 1273 1258 #define PERF_MEM_S(a, s) \ 1274 1259 (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT) 1275 1260 ··· 1305 1278 cycles:16, /* cycle count to last branch */ 1306 1279 type:4, /* branch type */ 1307 1280 reserved:40; 1281 + }; 1282 + 1283 + union perf_sample_weight { 1284 + __u64 full; 1285 + #if defined(__LITTLE_ENDIAN_BITFIELD) 1286 + struct { 1287 + __u32 var1_dw; 1288 + __u16 var2_w; 1289 + __u16 var3_w; 1290 + }; 1291 + #elif defined(__BIG_ENDIAN_BITFIELD) 1292 + struct { 1293 + __u16 var3_w; 1294 + __u16 var2_w; 1295 + __u32 var1_dw; 1296 + }; 1297 + #else 1298 + #error "Unknown endianness" 1299 + #endif 1308 1300 }; 1309 1301 1310 1302 #endif /* _UAPI_LINUX_PERF_EVENT_H */