]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/linux/perf_event.h
include/linux/syscalls.h: add sys_renameat2() prototype
[karo-tx-linux.git] / include / linux / perf_event.h
index e56b07f5c9b67f0119d874b60a8a6bed9fda7e99..3356abcfff184e707eccb08d6f99042a8fd51acc 100644 (file)
@@ -835,6 +835,8 @@ do {                                                                        \
                { .notifier_call = fn, .priority = CPU_PRI_PERF };      \
        unsigned long cpu = smp_processor_id();                         \
        unsigned long flags;                                            \
+                                                                       \
+       cpu_notifier_register_begin();                                  \
        fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE,                     \
                (void *)(unsigned long)cpu);                            \
        local_irq_save(flags);                                          \
@@ -843,9 +845,21 @@ do {                                                                       \
        local_irq_restore(flags);                                       \
        fn(&fn##_nb, (unsigned long)CPU_ONLINE,                         \
                (void *)(unsigned long)cpu);                            \
-       register_cpu_notifier(&fn##_nb);                                \
+       __register_cpu_notifier(&fn##_nb);                              \
+       cpu_notifier_register_done();                                   \
 } while (0)
 
+/*
+ * Bare-bones version of perf_cpu_notifier(), which doesn't invoke the
+ * callback for already online CPUs.
+ */
+#define __perf_cpu_notifier(fn)                                                \
+do {                                                                   \
+       static struct notifier_block fn##_nb =                          \
+               { .notifier_call = fn, .priority = CPU_PRI_PERF };      \
+                                                                       \
+       __register_cpu_notifier(&fn##_nb);                              \
+} while (0)
 
 struct perf_pmu_events_attr {
        struct device_attribute attr;