aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/perf_event.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/uapi/linux/perf_event.h')
-rw-r--r--include/uapi/linux/perf_event.h71
1 files changed, 70 insertions, 1 deletions
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index 9fa9c622a7f4..fb104e51496e 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -132,8 +132,10 @@ enum perf_event_sample_format {
132 PERF_SAMPLE_BRANCH_STACK = 1U << 11, 132 PERF_SAMPLE_BRANCH_STACK = 1U << 11,
133 PERF_SAMPLE_REGS_USER = 1U << 12, 133 PERF_SAMPLE_REGS_USER = 1U << 12,
134 PERF_SAMPLE_STACK_USER = 1U << 13, 134 PERF_SAMPLE_STACK_USER = 1U << 13,
135 PERF_SAMPLE_WEIGHT = 1U << 14,
136 PERF_SAMPLE_DATA_SRC = 1U << 15,
135 137
136 PERF_SAMPLE_MAX = 1U << 14, /* non-ABI */ 138 PERF_SAMPLE_MAX = 1U << 16, /* non-ABI */
137}; 139};
138 140
139/* 141/*
@@ -443,6 +445,7 @@ struct perf_event_mmap_page {
443#define PERF_RECORD_MISC_GUEST_KERNEL (4 << 0) 445#define PERF_RECORD_MISC_GUEST_KERNEL (4 << 0)
444#define PERF_RECORD_MISC_GUEST_USER (5 << 0) 446#define PERF_RECORD_MISC_GUEST_USER (5 << 0)
445 447
448#define PERF_RECORD_MISC_MMAP_DATA (1 << 13)
446/* 449/*
447 * Indicates that the content of PERF_SAMPLE_IP points to 450 * Indicates that the content of PERF_SAMPLE_IP points to
448 * the actual instruction that triggered the event. See also 451 * the actual instruction that triggered the event. See also
@@ -588,6 +591,9 @@ enum perf_event_type {
588 * { u64 size; 591 * { u64 size;
589 * char data[size]; 592 * char data[size];
590 * u64 dyn_size; } && PERF_SAMPLE_STACK_USER 593 * u64 dyn_size; } && PERF_SAMPLE_STACK_USER
594 *
595 * { u64 weight; } && PERF_SAMPLE_WEIGHT
596 * { u64 data_src; } && PERF_SAMPLE_DATA_SRC
591 * }; 597 * };
592 */ 598 */
593 PERF_RECORD_SAMPLE = 9, 599 PERF_RECORD_SAMPLE = 9,
@@ -613,4 +619,67 @@ enum perf_callchain_context {
613#define PERF_FLAG_FD_OUTPUT (1U << 1) 619#define PERF_FLAG_FD_OUTPUT (1U << 1)
614#define PERF_FLAG_PID_CGROUP (1U << 2) /* pid=cgroup id, per-cpu mode only */ 620#define PERF_FLAG_PID_CGROUP (1U << 2) /* pid=cgroup id, per-cpu mode only */
615 621
622union perf_mem_data_src {
623 __u64 val;
624 struct {
625 __u64 mem_op:5, /* type of opcode */
626 mem_lvl:14, /* memory hierarchy level */
627 mem_snoop:5, /* snoop mode */
628 mem_lock:2, /* lock instr */
629 mem_dtlb:7, /* tlb access */
630 mem_rsvd:31;
631 };
632};
633
634/* type of opcode (load/store/prefetch,code) */
635#define PERF_MEM_OP_NA 0x01 /* not available */
636#define PERF_MEM_OP_LOAD 0x02 /* load instruction */
637#define PERF_MEM_OP_STORE 0x04 /* store instruction */
638#define PERF_MEM_OP_PFETCH 0x08 /* prefetch */
639#define PERF_MEM_OP_EXEC 0x10 /* code (execution) */
640#define PERF_MEM_OP_SHIFT 0
641
642/* memory hierarchy (memory level, hit or miss) */
643#define PERF_MEM_LVL_NA 0x01 /* not available */
644#define PERF_MEM_LVL_HIT 0x02 /* hit level */
645#define PERF_MEM_LVL_MISS 0x04 /* miss level */
646#define PERF_MEM_LVL_L1 0x08 /* L1 */
647#define PERF_MEM_LVL_LFB 0x10 /* Line Fill Buffer */
648#define PERF_MEM_LVL_L2 0x20 /* L2 */
649#define PERF_MEM_LVL_L3 0x40 /* L3 */
650#define PERF_MEM_LVL_LOC_RAM 0x80 /* Local DRAM */
651#define PERF_MEM_LVL_REM_RAM1 0x100 /* Remote DRAM (1 hop) */
652#define PERF_MEM_LVL_REM_RAM2 0x200 /* Remote DRAM (2 hops) */
653#define PERF_MEM_LVL_REM_CCE1 0x400 /* Remote Cache (1 hop) */
654#define PERF_MEM_LVL_REM_CCE2 0x800 /* Remote Cache (2 hops) */
655#define PERF_MEM_LVL_IO 0x1000 /* I/O memory */
656#define PERF_MEM_LVL_UNC 0x2000 /* Uncached memory */
657#define PERF_MEM_LVL_SHIFT 5
658
659/* snoop mode */
660#define PERF_MEM_SNOOP_NA 0x01 /* not available */
661#define PERF_MEM_SNOOP_NONE 0x02 /* no snoop */
662#define PERF_MEM_SNOOP_HIT 0x04 /* snoop hit */
663#define PERF_MEM_SNOOP_MISS 0x08 /* snoop miss */
664#define PERF_MEM_SNOOP_HITM 0x10 /* snoop hit modified */
665#define PERF_MEM_SNOOP_SHIFT 19
666
667/* locked instruction */
668#define PERF_MEM_LOCK_NA 0x01 /* not available */
669#define PERF_MEM_LOCK_LOCKED 0x02 /* locked transaction */
670#define PERF_MEM_LOCK_SHIFT 24
671
672/* TLB access */
673#define PERF_MEM_TLB_NA 0x01 /* not available */
674#define PERF_MEM_TLB_HIT 0x02 /* hit level */
675#define PERF_MEM_TLB_MISS 0x04 /* miss level */
676#define PERF_MEM_TLB_L1 0x08 /* L1 */
677#define PERF_MEM_TLB_L2 0x10 /* L2 */
678#define PERF_MEM_TLB_WK 0x20 /* Hardware Walker*/
679#define PERF_MEM_TLB_OS 0x40 /* OS fault handler */
680#define PERF_MEM_TLB_SHIFT 26
681
682#define PERF_MEM_S(a, s) \
683 (((u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
684
616#endif /* _UAPI_LINUX_PERF_EVENT_H */ 685#endif /* _UAPI_LINUX_PERF_EVENT_H */