Skip to content

Commit 71d7924

Browse files
committed
tools headers UAPI: Sync perf_event.h with the kernel sources
To pick up the changes in: 2b26f0a ("perf: Support only inheriting events if cloned with CLONE_THREAD") 2e498d0 ("perf: Add support for event removal on exec") 547b609 ("perf: aux: Add flags for the buffer format") 55bcf6e ("perf: Extend PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE") 7dde517 ("perf: aux: Add CoreSight PMU buffer formats") 97ba62b ("perf: Add support for SIGTRAP on perf events") d0d1dd6 ("perf core: Add PERF_COUNT_SW_CGROUP_SWITCHES event") Also change the expected sizeof(struct perf_event_attr) from 120 to 128 due to fields being added for the SIGTRAP changes. Addressing this perf build warning: 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 Cc: Kan Liang <[email protected]> Cc: Marco Elver <[email protected]> Cc: Mathieu Poirier <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Suzuki K Poulose <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 6faf64f commit 71d7924

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

tools/include/uapi/linux/perf_event.h

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ enum perf_sw_ids {
127127
PERF_COUNT_SW_EMULATION_FAULTS = 8,
128128
PERF_COUNT_SW_DUMMY = 9,
129129
PERF_COUNT_SW_BPF_OUTPUT = 10,
130+
PERF_COUNT_SW_CGROUP_SWITCHES = 11,
130131

131132
PERF_COUNT_SW_MAX, /* non-ABI */
132133
};
@@ -326,6 +327,7 @@ enum perf_event_read_format {
326327
#define PERF_ATTR_SIZE_VER4 104 /* add: sample_regs_intr */
327328
#define PERF_ATTR_SIZE_VER5 112 /* add: aux_watermark */
328329
#define PERF_ATTR_SIZE_VER6 120 /* add: aux_sample_size */
330+
#define PERF_ATTR_SIZE_VER7 128 /* add: sig_data */
329331

330332
/*
331333
* Hardware event_id to monitor via a performance monitoring event:
@@ -404,7 +406,10 @@ struct perf_event_attr {
404406
cgroup : 1, /* include cgroup events */
405407
text_poke : 1, /* include text poke events */
406408
build_id : 1, /* use build id in mmap2 events */
407-
__reserved_1 : 29;
409+
inherit_thread : 1, /* children only inherit if cloned with CLONE_THREAD */
410+
remove_on_exec : 1, /* event is removed from task on exec */
411+
sigtrap : 1, /* send synchronous SIGTRAP on event */
412+
__reserved_1 : 26;
408413

409414
union {
410415
__u32 wakeup_events; /* wakeup every n events */
@@ -456,6 +461,12 @@ struct perf_event_attr {
456461
__u16 __reserved_2;
457462
__u32 aux_sample_size;
458463
__u32 __reserved_3;
464+
465+
/*
466+
* User provided data if sigtrap=1, passed back to user via
467+
* siginfo_t::si_perf, e.g. to permit user to identify the event.
468+
*/
469+
__u64 sig_data;
459470
};
460471

461472
/*
@@ -1171,10 +1182,15 @@ enum perf_callchain_context {
11711182
/**
11721183
* PERF_RECORD_AUX::flags bits
11731184
*/
1174-
#define PERF_AUX_FLAG_TRUNCATED 0x01 /* record was truncated to fit */
1175-
#define PERF_AUX_FLAG_OVERWRITE 0x02 /* snapshot from overwrite mode */
1176-
#define PERF_AUX_FLAG_PARTIAL 0x04 /* record contains gaps */
1177-
#define PERF_AUX_FLAG_COLLISION 0x08 /* sample collided with another */
1185+
#define PERF_AUX_FLAG_TRUNCATED 0x01 /* record was truncated to fit */
1186+
#define PERF_AUX_FLAG_OVERWRITE 0x02 /* snapshot from overwrite mode */
1187+
#define PERF_AUX_FLAG_PARTIAL 0x04 /* record contains gaps */
1188+
#define PERF_AUX_FLAG_COLLISION 0x08 /* sample collided with another */
1189+
#define PERF_AUX_FLAG_PMU_FORMAT_TYPE_MASK 0xff00 /* PMU specific trace format type */
1190+
1191+
/* CoreSight PMU AUX buffer formats */
1192+
#define PERF_AUX_FLAG_CORESIGHT_FORMAT_CORESIGHT 0x0000 /* Default for backward compatibility */
1193+
#define PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW 0x0100 /* Raw format of the source */
11781194

11791195
#define PERF_FLAG_FD_NO_GROUP (1UL << 0)
11801196
#define PERF_FLAG_FD_OUTPUT (1UL << 1)

tools/perf/tests/attr/base-record

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ group_fd=-1
55
flags=0|8
66
cpu=*
77
type=0|1
8-
size=120
8+
size=128
99
config=0
1010
sample_period=*
1111
sample_type=263

tools/perf/tests/attr/base-stat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ group_fd=-1
55
flags=0|8
66
cpu=*
77
type=0
8-
size=120
8+
size=128
99
config=0
1010
sample_period=0
1111
sample_type=65536

tools/perf/tests/attr/system-wide-dummy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cpu=*
77
pid=-1
88
flags=8
99
type=1
10-
size=120
10+
size=128
1111
config=9
1212
sample_period=4000
1313
sample_type=455

0 commit comments

Comments
 (0)