aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-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 */