aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_event.h
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-12-05 03:44:31 -0500
committerFrederic Weisbecker <fweisbec@gmail.com>2009-12-06 02:27:18 -0500
commitb326e9560a28fc3e950637ef51847ed8f05c1335 (patch)
tree0804c8c4f28d4ae152d5e9205ce5a958f0d26b79 /include/linux/perf_event.h
parent2f0993e0fb663c49e4d1e02654f6203246be4817 (diff)
hw-breakpoints: Use overflow handler instead of the event callback
struct perf_event::event callback was called when a breakpoint triggers. But this is a rather opaque callback, pretty tied-only to the breakpoint API and not really integrated into perf as it triggers even when we don't overflow. We prefer to use overflow_handler() as it fits into the perf events rules, being called only when we overflow. Reported-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: "K. Prasad" <prasad@linux.vnet.ibm.com>
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r--include/linux/perf_event.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 84bd28a0ffab..d2f2667430da 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -565,10 +565,13 @@ 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_callback_t)(struct perf_event *, void *);
571typedef void (*perf_overflow_handler_t)(struct perf_event *, int,
572 struct perf_sample_data *,
573 struct pt_regs *regs);
574
572/** 575/**
573 * struct perf_event - performance event kernel representation: 576 * struct perf_event - performance event kernel representation:
574 */ 577 */
@@ -660,9 +663,7 @@ struct perf_event {
660 struct pid_namespace *ns; 663 struct pid_namespace *ns;
661 u64 id; 664 u64 id;
662 665
663 void (*overflow_handler)(struct perf_event *event, 666 perf_overflow_handler_t overflow_handler;
664 int nmi, struct perf_sample_data *data,
665 struct pt_regs *regs);
666 667
667#ifdef CONFIG_EVENT_PROFILE 668#ifdef CONFIG_EVENT_PROFILE
668 struct event_filter *filter; 669 struct event_filter *filter;
@@ -779,7 +780,7 @@ extern struct perf_event *
779perf_event_create_kernel_counter(struct perf_event_attr *attr, 780perf_event_create_kernel_counter(struct perf_event_attr *attr,
780 int cpu, 781 int cpu,
781 pid_t pid, 782 pid_t pid,
782 perf_callback_t callback); 783 perf_overflow_handler_t callback);
783extern u64 perf_event_read_value(struct perf_event *event, 784extern u64 perf_event_read_value(struct perf_event *event,
784 u64 *enabled, u64 *running); 785 u64 *enabled, u64 *running);
785 786