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.h44
1 files changed, 9 insertions, 35 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index e1f921c2e4e0..8ed4326164cc 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -1309,41 +1309,6 @@ static __always_inline bool perf_raw_frag_last(const struct perf_raw_frag *frag)
1309 1309
1310#define perf_output_put(handle, x) perf_output_copy((handle), &(x), sizeof(x)) 1310#define perf_output_put(handle, x) perf_output_copy((handle), &(x), sizeof(x))
1311 1311
1312/*
1313 * This has to have a higher priority than migration_notifier in sched/core.c.
1314 */
1315#define perf_cpu_notifier(fn) \
1316do { \
1317 static struct notifier_block fn##_nb = \
1318 { .notifier_call = fn, .priority = CPU_PRI_PERF }; \
1319 unsigned long cpu = smp_processor_id(); \
1320 unsigned long flags; \
1321 \
1322 cpu_notifier_register_begin(); \
1323 fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE, \
1324 (void *)(unsigned long)cpu); \
1325 local_irq_save(flags); \
1326 fn(&fn##_nb, (unsigned long)CPU_STARTING, \
1327 (void *)(unsigned long)cpu); \
1328 local_irq_restore(flags); \
1329 fn(&fn##_nb, (unsigned long)CPU_ONLINE, \
1330 (void *)(unsigned long)cpu); \
1331 __register_cpu_notifier(&fn##_nb); \
1332 cpu_notifier_register_done(); \
1333} while (0)
1334
1335/*
1336 * Bare-bones version of perf_cpu_notifier(), which doesn't invoke the
1337 * callback for already online CPUs.
1338 */
1339#define __perf_cpu_notifier(fn) \
1340do { \
1341 static struct notifier_block fn##_nb = \
1342 { .notifier_call = fn, .priority = CPU_PRI_PERF }; \
1343 \
1344 __register_cpu_notifier(&fn##_nb); \
1345} while (0)
1346
1347struct perf_pmu_events_attr { 1312struct perf_pmu_events_attr {
1348 struct device_attribute attr; 1313 struct device_attribute attr;
1349 u64 id; 1314 u64 id;
@@ -1385,4 +1350,13 @@ _name##_show(struct device *dev, \
1385 \ 1350 \
1386static struct device_attribute format_attr_##_name = __ATTR_RO(_name) 1351static struct device_attribute format_attr_##_name = __ATTR_RO(_name)
1387 1352
1353/* Performance counter hotplug functions */
1354#ifdef CONFIG_PERF_EVENTS
1355int perf_event_init_cpu(unsigned int cpu);
1356int perf_event_exit_cpu(unsigned int cpu);
1357#else
1358#define perf_event_init_cpu NULL
1359#define perf_event_exit_cpu NULL
1360#endif
1361
1388#endif /* _LINUX_PERF_EVENT_H */ 1362#endif /* _LINUX_PERF_EVENT_H */