aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_event.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r--include/linux/perf_event.h41
1 files changed, 20 insertions, 21 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 43adbd7f0010..64a53f74c9a9 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -18,10 +18,6 @@
18#include <linux/ioctl.h> 18#include <linux/ioctl.h>
19#include <asm/byteorder.h> 19#include <asm/byteorder.h>
20 20
21#ifdef CONFIG_HAVE_HW_BREAKPOINT
22#include <asm/hw_breakpoint.h>
23#endif
24
25/* 21/*
26 * User-space ABI bits: 22 * User-space ABI bits:
27 */ 23 */
@@ -215,12 +211,12 @@ struct perf_event_attr {
215 __u32 wakeup_watermark; /* bytes before wakeup */ 211 __u32 wakeup_watermark; /* bytes before wakeup */
216 }; 212 };
217 213
218 union { 214 struct { /* Hardware breakpoint info */
219 struct { /* Hardware breakpoint info */ 215 __u64 bp_addr;
220 __u64 bp_addr; 216 __u32 bp_type;
221 __u32 bp_type; 217 __u32 bp_len;
222 __u32 bp_len; 218 __u64 __bp_reserved_1;
223 }; 219 __u64 __bp_reserved_2;
224 }; 220 };
225 221
226 __u32 __reserved_2; 222 __u32 __reserved_2;
@@ -451,6 +447,10 @@ enum perf_callchain_context {
451# include <asm/perf_event.h> 447# include <asm/perf_event.h>
452#endif 448#endif
453 449
450#ifdef CONFIG_HAVE_HW_BREAKPOINT
451#include <asm/hw_breakpoint.h>
452#endif
453
454#include <linux/list.h> 454#include <linux/list.h>
455#include <linux/mutex.h> 455#include <linux/mutex.h>
456#include <linux/rculist.h> 456#include <linux/rculist.h>
@@ -565,10 +565,12 @@ struct perf_pending_entry {
565 void (*func)(struct perf_pending_entry *); 565 void (*func)(struct perf_pending_entry *);
566}; 566};
567 567
568typedef void (*perf_callback_t)(struct perf_event *, void *);
569
570struct perf_sample_data; 568struct perf_sample_data;
571 569
570typedef void (*perf_overflow_handler_t)(struct perf_event *, int,
571 struct perf_sample_data *,
572 struct pt_regs *regs);
573
572/** 574/**
573 * struct perf_event - performance event kernel representation: 575 * struct perf_event - performance event kernel representation:
574 */ 576 */
@@ -660,18 +662,12 @@ struct perf_event {
660 struct pid_namespace *ns; 662 struct pid_namespace *ns;
661 u64 id; 663 u64 id;
662 664
663 void (*overflow_handler)(struct perf_event *event, 665 perf_overflow_handler_t overflow_handler;
664 int nmi, struct perf_sample_data *data,
665 struct pt_regs *regs);
666 666
667#ifdef CONFIG_EVENT_PROFILE 667#ifdef CONFIG_EVENT_PROFILE
668 struct event_filter *filter; 668 struct event_filter *filter;
669#endif 669#endif
670 670
671 perf_callback_t callback;
672
673 perf_callback_t event_callback;
674
675#endif /* CONFIG_PERF_EVENTS */ 671#endif /* CONFIG_PERF_EVENTS */
676}; 672};
677 673
@@ -781,7 +777,7 @@ extern struct perf_event *
781perf_event_create_kernel_counter(struct perf_event_attr *attr, 777perf_event_create_kernel_counter(struct perf_event_attr *attr,
782 int cpu, 778 int cpu,
783 pid_t pid, 779 pid_t pid,
784 perf_callback_t callback); 780 perf_overflow_handler_t callback);
785extern u64 perf_event_read_value(struct perf_event *event, 781extern u64 perf_event_read_value(struct perf_event *event,
786 u64 *enabled, u64 *running); 782 u64 *enabled, u64 *running);
787 783
@@ -876,6 +872,8 @@ extern void perf_output_copy(struct perf_output_handle *handle,
876 const void *buf, unsigned int len); 872 const void *buf, unsigned int len);
877extern int perf_swevent_get_recursion_context(void); 873extern int perf_swevent_get_recursion_context(void);
878extern void perf_swevent_put_recursion_context(int rctx); 874extern void perf_swevent_put_recursion_context(int rctx);
875extern void perf_event_enable(struct perf_event *event);
876extern void perf_event_disable(struct perf_event *event);
879#else 877#else
880static inline void 878static inline void
881perf_event_task_sched_in(struct task_struct *task, int cpu) { } 879perf_event_task_sched_in(struct task_struct *task, int cpu) { }
@@ -906,7 +904,8 @@ static inline void perf_event_fork(struct task_struct *tsk) { }
906static inline void perf_event_init(void) { } 904static inline void perf_event_init(void) { }
907static inline int perf_swevent_get_recursion_context(void) { return -1; } 905static inline int perf_swevent_get_recursion_context(void) { return -1; }
908static inline void perf_swevent_put_recursion_context(int rctx) { } 906static inline void perf_swevent_put_recursion_context(int rctx) { }
909 907static inline void perf_event_enable(struct perf_event *event) { }
908static inline void perf_event_disable(struct perf_event *event) { }
910#endif 909#endif
911 910
912#define perf_output_put(handle, x) \ 911#define perf_output_put(handle, x) \