diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/perf_event.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index bf896d0b2e9c..24de5f181a41 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -288,11 +288,13 @@ struct perf_event_mmap_page { | |||
| 288 | __u64 data_tail; /* user-space written tail */ | 288 | __u64 data_tail; /* user-space written tail */ |
| 289 | }; | 289 | }; |
| 290 | 290 | ||
| 291 | #define PERF_RECORD_MISC_CPUMODE_MASK (3 << 0) | 291 | #define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0) |
| 292 | #define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0) | 292 | #define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0) |
| 293 | #define PERF_RECORD_MISC_KERNEL (1 << 0) | 293 | #define PERF_RECORD_MISC_KERNEL (1 << 0) |
| 294 | #define PERF_RECORD_MISC_USER (2 << 0) | 294 | #define PERF_RECORD_MISC_USER (2 << 0) |
| 295 | #define PERF_RECORD_MISC_HYPERVISOR (3 << 0) | 295 | #define PERF_RECORD_MISC_HYPERVISOR (3 << 0) |
| 296 | #define PERF_RECORD_MISC_GUEST_KERNEL (4 << 0) | ||
| 297 | #define PERF_RECORD_MISC_GUEST_USER (5 << 0) | ||
| 296 | 298 | ||
| 297 | #define PERF_RECORD_MISC_EXACT (1 << 14) | 299 | #define PERF_RECORD_MISC_EXACT (1 << 14) |
| 298 | /* | 300 | /* |
| @@ -446,6 +448,12 @@ enum perf_callchain_context { | |||
| 446 | # include <asm/perf_event.h> | 448 | # include <asm/perf_event.h> |
| 447 | #endif | 449 | #endif |
| 448 | 450 | ||
| 451 | struct perf_guest_info_callbacks { | ||
| 452 | int (*is_in_guest) (void); | ||
| 453 | int (*is_user_mode) (void); | ||
| 454 | unsigned long (*get_guest_ip) (void); | ||
| 455 | }; | ||
| 456 | |||
| 449 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | 457 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
| 450 | #include <asm/hw_breakpoint.h> | 458 | #include <asm/hw_breakpoint.h> |
| 451 | #endif | 459 | #endif |
| @@ -932,6 +940,12 @@ static inline void perf_event_mmap(struct vm_area_struct *vma) | |||
| 932 | __perf_event_mmap(vma); | 940 | __perf_event_mmap(vma); |
| 933 | } | 941 | } |
| 934 | 942 | ||
| 943 | extern struct perf_guest_info_callbacks *perf_guest_cbs; | ||
| 944 | extern int perf_register_guest_info_callbacks( | ||
| 945 | struct perf_guest_info_callbacks *); | ||
| 946 | extern int perf_unregister_guest_info_callbacks( | ||
| 947 | struct perf_guest_info_callbacks *); | ||
| 948 | |||
| 935 | extern void perf_event_comm(struct task_struct *tsk); | 949 | extern void perf_event_comm(struct task_struct *tsk); |
| 936 | extern void perf_event_fork(struct task_struct *tsk); | 950 | extern void perf_event_fork(struct task_struct *tsk); |
| 937 | 951 | ||
| @@ -1001,6 +1015,11 @@ perf_sw_event(u32 event_id, u64 nr, int nmi, | |||
| 1001 | static inline void | 1015 | static inline void |
| 1002 | perf_bp_event(struct perf_event *event, void *data) { } | 1016 | perf_bp_event(struct perf_event *event, void *data) { } |
| 1003 | 1017 | ||
| 1018 | static inline int perf_register_guest_info_callbacks | ||
| 1019 | (struct perf_guest_info_callbacks *) {return 0; } | ||
| 1020 | static inline int perf_unregister_guest_info_callbacks | ||
| 1021 | (struct perf_guest_info_callbacks *) {return 0; } | ||
| 1022 | |||
| 1004 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } | 1023 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } |
| 1005 | static inline void perf_event_comm(struct task_struct *tsk) { } | 1024 | static inline void perf_event_comm(struct task_struct *tsk) { } |
| 1006 | static inline void perf_event_fork(struct task_struct *tsk) { } | 1025 | static inline void perf_event_fork(struct task_struct *tsk) { } |
