aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include/uapi/linux/perf_event.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/include/uapi/linux/perf_event.h')
-rw-r--r--tools/include/uapi/linux/perf_event.h32
1 files changed, 29 insertions, 3 deletions
diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h
index b9a4953018ed..e0739a1aa4b2 100644
--- a/tools/include/uapi/linux/perf_event.h
+++ b/tools/include/uapi/linux/perf_event.h
@@ -418,6 +418,27 @@ struct perf_event_attr {
418 __u16 __reserved_2; /* align to __u64 */ 418 __u16 __reserved_2; /* align to __u64 */
419}; 419};
420 420
421/*
422 * Structure used by below PERF_EVENT_IOC_QUERY_BPF command
423 * to query bpf programs attached to the same perf tracepoint
424 * as the given perf event.
425 */
426struct perf_event_query_bpf {
427 /*
428 * The below ids array length
429 */
430 __u32 ids_len;
431 /*
432 * Set by the kernel to indicate the number of
433 * available programs
434 */
435 __u32 prog_cnt;
436 /*
437 * User provided buffer to store program ids
438 */
439 __u32 ids[0];
440};
441
421#define perf_flags(attr) (*(&(attr)->read_format + 1)) 442#define perf_flags(attr) (*(&(attr)->read_format + 1))
422 443
423/* 444/*
@@ -433,6 +454,7 @@ struct perf_event_attr {
433#define PERF_EVENT_IOC_ID _IOR('$', 7, __u64 *) 454#define PERF_EVENT_IOC_ID _IOR('$', 7, __u64 *)
434#define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, __u32) 455#define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, __u32)
435#define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32) 456#define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32)
457#define PERF_EVENT_IOC_QUERY_BPF _IOWR('$', 10, struct perf_event_query_bpf *)
436 458
437enum perf_event_ioc_flags { 459enum perf_event_ioc_flags {
438 PERF_IOC_FLAG_GROUP = 1U << 0, 460 PERF_IOC_FLAG_GROUP = 1U << 0,
@@ -612,9 +634,12 @@ struct perf_event_mmap_page {
612 */ 634 */
613#define PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT (1 << 12) 635#define PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT (1 << 12)
614/* 636/*
615 * PERF_RECORD_MISC_MMAP_DATA and PERF_RECORD_MISC_COMM_EXEC are used on 637 * Following PERF_RECORD_MISC_* are used on different
616 * different events so can reuse the same bit position. 638 * events, so can reuse the same bit position:
617 * Ditto PERF_RECORD_MISC_SWITCH_OUT. 639 *
640 * PERF_RECORD_MISC_MMAP_DATA - PERF_RECORD_MMAP* events
641 * PERF_RECORD_MISC_COMM_EXEC - PERF_RECORD_COMM event
642 * PERF_RECORD_MISC_SWITCH_OUT - PERF_RECORD_SWITCH* events
618 */ 643 */
619#define PERF_RECORD_MISC_MMAP_DATA (1 << 13) 644#define PERF_RECORD_MISC_MMAP_DATA (1 << 13)
620#define PERF_RECORD_MISC_COMM_EXEC (1 << 13) 645#define PERF_RECORD_MISC_COMM_EXEC (1 << 13)
@@ -864,6 +889,7 @@ enum perf_event_type {
864 * struct perf_event_header header; 889 * struct perf_event_header header;
865 * u32 pid; 890 * u32 pid;
866 * u32 tid; 891 * u32 tid;
892 * struct sample_id sample_id;
867 * }; 893 * };
868 */ 894 */
869 PERF_RECORD_ITRACE_START = 12, 895 PERF_RECORD_ITRACE_START = 12,