aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_event.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2010-03-05 07:01:18 -0500
committerIngo Molnar <mingo@elte.hu>2010-03-10 07:22:24 -0500
commit3f6da3905398826d85731247e7fbcf53400c18bd (patch)
tree3e01248974385999fb8e7f8d5daa53b46228f649 /include/linux/perf_event.h
parentdc1d628a67a8f042e711ea5accc0beedc3ef0092 (diff)
perf: Rework and fix the arch CPU-hotplug hooks
Remove the hw_perf_event_*() hotplug hooks in favour of per PMU hotplug notifiers. This has the advantage of reducing the static weak interface as well as exposing all hotplug actions to the PMU. Use this to fix x86 hotplug usage where we did things in ONLINE which should have been done in UP_PREPARE or STARTING. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mundt <lethal@linux-sh.org> Cc: paulus@samba.org Cc: eranian@google.com Cc: robert.richter@amd.com Cc: fweisbec@gmail.com Cc: Arnaldo Carvalho de Melo <acme@infradead.org> LKML-Reference: <20100305154128.736225361@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r--include/linux/perf_event.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 6f8cd7da1a01..80acbf3d5de1 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -936,5 +936,21 @@ static inline void perf_event_disable(struct perf_event *event) { }
936#define perf_output_put(handle, x) \ 936#define perf_output_put(handle, x) \
937 perf_output_copy((handle), &(x), sizeof(x)) 937 perf_output_copy((handle), &(x), sizeof(x))
938 938
939/*
940 * This has to have a higher priority than migration_notifier in sched.c.
941 */
942#define perf_cpu_notifier(fn) \
943do { \
944 static struct notifier_block fn##_nb __cpuinitdata = \
945 { .notifier_call = fn, .priority = 20 }; \
946 fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE, \
947 (void *)(unsigned long)smp_processor_id()); \
948 fn(&fn##_nb, (unsigned long)CPU_STARTING, \
949 (void *)(unsigned long)smp_processor_id()); \
950 fn(&fn##_nb, (unsigned long)CPU_ONLINE, \
951 (void *)(unsigned long)smp_processor_id()); \
952 register_cpu_notifier(&fn##_nb); \
953} while (0)
954
939#endif /* __KERNEL__ */ 955#endif /* __KERNEL__ */
940#endif /* _LINUX_PERF_EVENT_H */ 956#endif /* _LINUX_PERF_EVENT_H */