Skip to content

Commit 81898ef

Browse files
Kan Liangacmel
authored andcommitted
tools headers uapi: Update tools's copy of linux/perf_event.h
To get the changes in these csets: 2a6c6b7 ("perf/core: Add PERF_SAMPLE_WEIGHT_STRUCT") 61b985e ("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>
1 parent 068aeea commit 81898ef

1 file changed

Lines changed: 50 additions & 4 deletions

File tree

‎tools/include/uapi/linux/perf_event.h‎

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,14 @@ enum perf_event_sample_format {
145145
PERF_SAMPLE_CGROUP = 1U << 21,
146146
PERF_SAMPLE_DATA_PAGE_SIZE = 1U << 22,
147147
PERF_SAMPLE_CODE_PAGE_SIZE = 1U << 23,
148+
PERF_SAMPLE_WEIGHT_STRUCT = 1U << 24,
148149

149-
PERF_SAMPLE_MAX = 1U << 24, /* non-ABI */
150+
PERF_SAMPLE_MAX = 1U << 25, /* non-ABI */
150151

151152
__PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63, /* non-ABI; internal use */
152153
};
153154

155+
#define PERF_SAMPLE_WEIGHT_TYPE (PERF_SAMPLE_WEIGHT | PERF_SAMPLE_WEIGHT_STRUCT)
154156
/*
155157
* values to program into branch_sample_type when PERF_SAMPLE_BRANCH is set
156158
*
@@ -912,7 +914,24 @@ enum perf_event_type {
912914
* char data[size];
913915
* u64 dyn_size; } && PERF_SAMPLE_STACK_USER
914916
*
915-
* { u64 weight; } && PERF_SAMPLE_WEIGHT
917+
* { union perf_sample_weight
918+
* {
919+
* u64 full; && PERF_SAMPLE_WEIGHT
920+
* #if defined(__LITTLE_ENDIAN_BITFIELD)
921+
* struct {
922+
* u32 var1_dw;
923+
* u16 var2_w;
924+
* u16 var3_w;
925+
* } && PERF_SAMPLE_WEIGHT_STRUCT
926+
* #elif defined(__BIG_ENDIAN_BITFIELD)
927+
* struct {
928+
* u16 var3_w;
929+
* u16 var2_w;
930+
* u32 var1_dw;
931+
* } && PERF_SAMPLE_WEIGHT_STRUCT
932+
* #endif
933+
* }
934+
* }
916935
* { u64 data_src; } && PERF_SAMPLE_DATA_SRC
917936
* { u64 transaction; } && PERF_SAMPLE_TRANSACTION
918937
* { u64 abi; # enum perf_sample_regs_abi
@@ -1159,14 +1178,16 @@ union perf_mem_data_src {
11591178
mem_lvl_num:4, /* memory hierarchy level number */
11601179
mem_remote:1, /* remote */
11611180
mem_snoopx:2, /* snoop mode, ext */
1162-
mem_rsvd:24;
1181+
mem_blk:3, /* access blocked */
1182+
mem_rsvd:21;
11631183
};
11641184
};
11651185
#elif defined(__BIG_ENDIAN_BITFIELD)
11661186
union perf_mem_data_src {
11671187
__u64 val;
11681188
struct {
1169-
__u64 mem_rsvd:24,
1189+
__u64 mem_rsvd:21,
1190+
mem_blk:3, /* access blocked */
11701191
mem_snoopx:2, /* snoop mode, ext */
11711192
mem_remote:1, /* remote */
11721193
mem_lvl_num:4, /* memory hierarchy level number */
@@ -1249,6 +1270,12 @@ union perf_mem_data_src {
12491270
#define PERF_MEM_TLB_OS 0x40 /* OS fault handler */
12501271
#define PERF_MEM_TLB_SHIFT 26
12511272

1273+
/* Access blocked */
1274+
#define PERF_MEM_BLK_NA 0x01 /* not available */
1275+
#define PERF_MEM_BLK_DATA 0x02 /* data could not be forwarded */
1276+
#define PERF_MEM_BLK_ADDR 0x04 /* address conflict */
1277+
#define PERF_MEM_BLK_SHIFT 40
1278+
12521279
#define PERF_MEM_S(a, s) \
12531280
(((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
12541281

@@ -1280,4 +1307,23 @@ struct perf_branch_entry {
12801307
reserved:40;
12811308
};
12821309

1310+
union perf_sample_weight {
1311+
__u64 full;
1312+
#if defined(__LITTLE_ENDIAN_BITFIELD)
1313+
struct {
1314+
__u32 var1_dw;
1315+
__u16 var2_w;
1316+
__u16 var3_w;
1317+
};
1318+
#elif defined(__BIG_ENDIAN_BITFIELD)
1319+
struct {
1320+
__u16 var3_w;
1321+
__u16 var2_w;
1322+
__u32 var1_dw;
1323+
};
1324+
#else
1325+
#error "Unknown endianness"
1326+
#endif
1327+
};
1328+
12831329
#endif /* _UAPI_LINUX_PERF_EVENT_H */

0 commit comments

Comments
 (0)