History

perf/headers: Clean up <linux/perf_event.h> a bit

Do a bit of readability spring cleaning: - Fix misaligned structure member in perf_addr_filter: the new struct perf_addr_filter::action member was too long, but when it was added it was not aligned properly. Align all fields to the customary column 41 alignment of most of the rest of the header. - Adjust the vertical alignment of the definition of other structures and definitions as well, so that the 'most of' in the previous paragraph changes to 'all of'. ;-) - Prettify the assignments in perf_clear_branch_entry_bitfields() - Move comments from CPP definitions to outside the macro - Move perf_guest_info_callbacks and related defines from the front of the header closer to where it's used within the header. - And more #endif markers for larger CPP blocks and standardize #if/#else/#endif blocks to the following nomenclature: #ifdef CONFIG_FOO ... #else /* !CONFIG_FOO: */ ... #endif /* !CONFIG_FOO */ - Standardize on consistently using the 'extern' storage class where appropriate, we had cases where method prototypes sometimes omitted the storage class: extern void perf_pmu_migrate_context(struct pmu *pmu, int src_cpu, int dst_cpu); int perf_event_read_local(struct perf_event *event, u64 *value, u64 *enabled, u64 *running); extern u64 perf_event_read_value(struct perf_event *event, u64 *enabled, u64 *running); Which is obviously a bit confusing and adds unnecessary noise. - s/__u64/u64 and similar cleanups: there's no point in using __u64 in non-UAPI headers, and doing so only adds unnecessary visual noise. - Harmonize all multi-parameter function prototypes along the following style: extern struct perf_event * perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu, struct task_struct *task, perf_overflow_handler_t callback, void *context); - etc.

Ingo Molnar committed 1 year ago

Commit e7d952c1 parent 44889ff1 file · +155 −127Browse files

Unified · Split

include/linux/perf_event.h+155−127
@@ -26,18 +26,9 @@ · 25 unmodified lines
2626 # include <asm/local64.h>
2727 #endif
2828
29−#define PERF_GUEST_ACTIVE 0x01
30−#define PERF_GUEST_USER 0x02
31−
32−struct perf_guest_info_callbacks {
33− unsigned int (*state)(void);
34− unsigned long (*get_ip)(void);
35− unsigned int (*handle_intel_pt_intr)(void);
36−};
37−
3829 #ifdef CONFIG_HAVE_HW_BREAKPOINT
39−#include <linux/rhashtable-types.h>
40−#include <asm/hw_breakpoint.h>
30+# include <linux/rhashtable-types.h>
31+# include <asm/hw_breakpoint.h>
4132 #endif
4233
4334 #include <linux/list.h>
@@ -62,19 +53,20 @@ struct perf_guest_info_callbacks { · 18 unmodified lines
6253 #include <linux/security.h>
6354 #include <linux/static_call.h>
6455 #include <linux/lockdep.h>
56+
6557 #include <asm/local.h>
6658
6759 struct perf_callchain_entry {
68− __u64 nr;
69− __u64 ip[]; /* /proc/sys/kernel/perf_event_max_stack */
60+ u64 nr;
61+ u64 ip[]; /* /proc/sys/kernel/perf_event_max_stack */
7062 };
7163
7264 struct perf_callchain_entry_ctx {
73− struct perf_callchain_entry *entry;
74− u32 max_stack;
75− u32 nr;
76− short contexts;
77− bool contexts_maxed;
65+ struct perf_callchain_entry *entry;
66+ u32 max_stack;
67+ u32 nr;
68+ short contexts;
69+ bool contexts_maxed;
7870 };
7971
8072 typedef unsigned long (*perf_copy_f)(void *dst, const void *src,
@@ -121,8 +113,8 @@ static __always_inline bool perf_raw_frag_last(const struct perf_raw_frag *frag) · 40 unmodified lines
121113 * already stored in age order, the hw_idx should be 0.
122114 */
123115 struct perf_branch_stack {
124− __u64 nr;
125− __u64 hw_idx;
116+ u64 nr;
117+ u64 hw_idx;
126118 struct perf_branch_entry entries[];
127119 };
128120
@@ -132,10 +124,10 @@ struct task_struct; · 3 unmodified lines
132124 * extra PMU register associated with an event
133125 */
134126 struct hw_perf_event_extra {
135− u64 config; /* register value */
136− unsigned int reg; /* register address or index */
137− int alloc; /* extra register already allocated */
138− int idx; /* index in shared_regs->regs[] */
127+ u64 config; /* register value */
128+ unsigned int reg; /* register address or index */
129+ int alloc; /* extra register already allocated */
130+ int idx; /* index in shared_regs->regs[] */
139131 };
140132
141133 /**
@@ -144,8 +136,8 @@ struct hw_perf_event_extra { · 2 unmodified lines
144136 * PERF_EVENT_FLAG_ARCH bits are reserved for architecture-specific
145137 * usage.
146138 */
147−#define PERF_EVENT_FLAG_ARCH 0x0fffffff
148−#define PERF_EVENT_FLAG_USER_READ_CNT 0x80000000
139+#define PERF_EVENT_FLAG_ARCH 0x0fffffff
140+#define PERF_EVENT_FLAG_USER_READ_CNT 0x80000000
149141
150142 static_assert((PERF_EVENT_FLAG_USER_READ_CNT & PERF_EVENT_FLAG_ARCH) == 0);
151143
@@ -227,9 +219,14 @@ struct hw_perf_event { · 75 unmodified lines
227219 /*
228220 * hw_perf_event::state flags; used to track the PERF_EF_* state.
229221 */
230−#define PERF_HES_STOPPED 0x01 /* the counter is stopped */
231−#define PERF_HES_UPTODATE 0x02 /* event->count up-to-date */
232−#define PERF_HES_ARCH 0x04
222+
223+/* the counter is stopped */
224+#define PERF_HES_STOPPED 0x01
225+
226+/* event->count up-to-date */
227+#define PERF_HES_UPTODATE 0x02
228+
229+#define PERF_HES_ARCH 0x04
233230
234231 int state;
235232
@@ -278,7 +275,7 @@ struct hw_perf_event { · 42 unmodified lines
278275 */
279276 u64 freq_time_stamp;
280277 u64 freq_count_stamp;
281−#endif
278+#endif /* CONFIG_PERF_EVENTS */
282279 };
283280
284281 struct perf_event;
@@ -287,29 +284,33 @@ struct perf_event_pmu_context; · 2 unmodified lines
287284 /*
288285 * Common implementation detail of pmu::{start,commit,cancel}_txn
289286 */
290−#define PERF_PMU_TXN_ADD 0x1 /* txn to add/schedule event on PMU */
291−#define PERF_PMU_TXN_READ 0x2 /* txn to read event group from PMU */
287+
288+/* txn to add/schedule event on PMU */
289+#define PERF_PMU_TXN_ADD 0x1
290+
291+/* txn to read event group from PMU */
292+#define PERF_PMU_TXN_READ 0x2
292293
293294 /**
294295 * pmu::capabilities flags
295296 */
296−#define PERF_PMU_CAP_NO_INTERRUPT 0x0001
297−#define PERF_PMU_CAP_NO_NMI 0x0002
298−#define PERF_PMU_CAP_AUX_NO_SG 0x0004
299−#define PERF_PMU_CAP_EXTENDED_REGS 0x0008
300−#define PERF_PMU_CAP_EXCLUSIVE 0x0010
301−#define PERF_PMU_CAP_ITRACE 0x0020
302−#define PERF_PMU_CAP_NO_EXCLUDE 0x0040
303−#define PERF_PMU_CAP_AUX_OUTPUT 0x0080
304−#define PERF_PMU_CAP_EXTENDED_HW_TYPE 0x0100
305−#define PERF_PMU_CAP_AUX_PAUSE 0x0200
306−#define PERF_PMU_CAP_AUX_PREFER_LARGE 0x0400
297+#define PERF_PMU_CAP_NO_INTERRUPT 0x0001
298+#define PERF_PMU_CAP_NO_NMI 0x0002
299+#define PERF_PMU_CAP_AUX_NO_SG 0x0004
300+#define PERF_PMU_CAP_EXTENDED_REGS 0x0008
301+#define PERF_PMU_CAP_EXCLUSIVE 0x0010
302+#define PERF_PMU_CAP_ITRACE 0x0020
303+#define PERF_PMU_CAP_NO_EXCLUDE 0x0040
304+#define PERF_PMU_CAP_AUX_OUTPUT 0x0080
305+#define PERF_PMU_CAP_EXTENDED_HW_TYPE 0x0100
306+#define PERF_PMU_CAP_AUX_PAUSE 0x0200
307+#define PERF_PMU_CAP_AUX_PREFER_LARGE 0x0400
307308
308309 /**
309310 * pmu::scope
310311 */
311312 enum perf_pmu_scope {
312− PERF_PMU_SCOPE_NONE = 0,
313+ PERF_PMU_SCOPE_NONE = 0,
313314 PERF_PMU_SCOPE_CORE,
314315 PERF_PMU_SCOPE_DIE,
315316 PERF_PMU_SCOPE_CLUSTER,
@@ -393,11 +394,21 @@ struct pmu { · 77 unmodified lines
393394 * Flags for ->add()/->del()/ ->start()/->stop(). There are
394395 * matching hw_perf_event::state flags.
395396 */
396−#define PERF_EF_START 0x01 /* start the counter when adding */
397−#define PERF_EF_RELOAD 0x02 /* reload the counter when starting */
398−#define PERF_EF_UPDATE 0x04 /* update the counter when stopping */
399−#define PERF_EF_PAUSE 0x08 /* AUX area event, pause tracing */
400−#define PERF_EF_RESUME 0x10 /* AUX area event, resume tracing */
397+
398+/* start the counter when adding */
399+#define PERF_EF_START 0x01
400+
401+/* reload the counter when starting */
402+#define PERF_EF_RELOAD 0x02
403+
404+/* update the counter when stopping */
405+#define PERF_EF_UPDATE 0x04
406+
407+/* AUX area event, pause tracing */
408+#define PERF_EF_PAUSE 0x08
409+
410+/* AUX area event, resume tracing */
411+#define PERF_EF_RESUME 0x10
401412
402413 /*
403414 * Adds/Removes a counter to/from the PMU, can be done inside a
@@ -596,10 +607,10 @@ enum perf_addr_filter_action_t { · 192 unmodified lines
596607 * This is a hardware-agnostic filter configuration as specified by the user.
597608 */
598609 struct perf_addr_filter {
599− struct list_head entry;
600− struct path path;
601− unsigned long offset;
602− unsigned long size;
610+ struct list_head entry;
611+ struct path path;
612+ unsigned long offset;
613+ unsigned long size;
603614 enum perf_addr_filter_action_t action;
604615 };
605616
@@ -614,14 +625,14 @@ struct perf_addr_filter { · 8 unmodified lines
614625 * bundled together; see perf_event_addr_filters().
615626 */
616627 struct perf_addr_filters_head {
617− struct list_head list;
618− raw_spinlock_t lock;
619− unsigned int nr_file_filters;
628+ struct list_head list;
629+ raw_spinlock_t lock;
630+ unsigned int nr_file_filters;
620631 };
621632
622633 struct perf_addr_filter_range {
623− unsigned long start;
624− unsigned long size;
634+ unsigned long start;
635+ unsigned long size;
625636 };
626637
627638 /**
@@ -669,24 +680,24 @@ struct swevent_hlist { · 41 unmodified lines
669680 struct rcu_head rcu_head;
670681 };
671682
672−#define PERF_ATTACH_CONTEXT 0x0001
673−#define PERF_ATTACH_GROUP 0x0002
674−#define PERF_ATTACH_TASK 0x0004
675−#define PERF_ATTACH_TASK_DATA 0x0008
676−#define PERF_ATTACH_GLOBAL_DATA 0x0010
677−#define PERF_ATTACH_SCHED_CB 0x0020
678−#define PERF_ATTACH_CHILD 0x0040
679−#define PERF_ATTACH_EXCLUSIVE 0x0080
680−#define PERF_ATTACH_CALLCHAIN 0x0100
681−#define PERF_ATTACH_ITRACE 0x0200
683+#define PERF_ATTACH_CONTEXT 0x0001
684+#define PERF_ATTACH_GROUP 0x0002
685+#define PERF_ATTACH_TASK 0x0004
686+#define PERF_ATTACH_TASK_DATA 0x0008
687+#define PERF_ATTACH_GLOBAL_DATA 0x0010
688+#define PERF_ATTACH_SCHED_CB 0x0020
689+#define PERF_ATTACH_CHILD 0x0040
690+#define PERF_ATTACH_EXCLUSIVE 0x0080
691+#define PERF_ATTACH_CALLCHAIN 0x0100
692+#define PERF_ATTACH_ITRACE 0x0200
682693
683694 struct bpf_prog;
684695 struct perf_cgroup;
685696 struct perf_buffer;
686697
687698 struct pmu_event_list {
688− raw_spinlock_t lock;
689− struct list_head list;
699+ raw_spinlock_t lock;
700+ struct list_head list;
690701 };
691702
692703 /*
@@ -696,12 +707,12 @@ struct pmu_event_list { · 3 unmodified lines
696707 * disabled is sufficient since it will hold-off the IPIs.
697708 */
698709 #ifdef CONFIG_PROVE_LOCKING
699−#define lockdep_assert_event_ctx(event) \
710+# define lockdep_assert_event_ctx(event) \
700711 WARN_ON_ONCE(__lockdep_enabled && \
701712 (this_cpu_read(hardirqs_enabled) && \
702713 lockdep_is_held(&(event)->ctx->mutex) != LOCK_STATE_HELD))
703714 #else
704−#define lockdep_assert_event_ctx(event)
715+# define lockdep_assert_event_ctx(event)
705716 #endif
706717
707718 #define for_each_sibling_event(sibling, event) \
@@ -859,9 +870,9 @@ struct perf_event { · 151 unmodified lines
859870 #ifdef CONFIG_EVENT_TRACING
860871 struct trace_event_call *tp_event;
861872 struct event_filter *filter;
862−#ifdef CONFIG_FUNCTION_TRACER
873+# ifdef CONFIG_FUNCTION_TRACER
863874 struct ftrace_ops ftrace_ops;
864−#endif
875+# endif
865876 #endif
866877
867878 #ifdef CONFIG_CGROUP_PERF
@@ -880,7 +891,7 @@ struct perf_event { · 12 unmodified lines
880891 * of it. event->orig_type contains original 'type' requested by
881892 * user.
882893 */
883− __u32 orig_type;
894+ u32 orig_type;
884895 #endif /* CONFIG_PERF_EVENTS */
885896 };
886897
@@ -945,8 +956,8 @@ static inline bool perf_pmu_ctx_is_active(struct perf_event_pmu_context *epc) · 58 unmodified lines
945956 }
946957
947958 struct perf_event_groups {
948− struct rb_root tree;
949− u64 index;
959+ struct rb_root tree;
960+ u64 index;
950961 };
951962
952963
@@ -1189,16 +1200,18 @@ extern void perf_pmu_resched(struct pmu *pmu); · 236 unmodified lines
11891200 extern int perf_event_refresh(struct perf_event *event, int refresh);
11901201 extern void perf_event_update_userpage(struct perf_event *event);
11911202 extern int perf_event_release_kernel(struct perf_event *event);
1203+
11921204 extern struct perf_event *
11931205 perf_event_create_kernel_counter(struct perf_event_attr *attr,
1194− int cpu,
1195− struct task_struct *task,
1196− perf_overflow_handler_t callback,
1197− void *context);
1206+ int cpu,
1207+ struct task_struct *task,
1208+ perf_overflow_handler_t callback,
1209+ void *context);
1210+
11981211 extern void perf_pmu_migrate_context(struct pmu *pmu,
1199− int src_cpu, int dst_cpu);
1200−int perf_event_read_local(struct perf_event *event, u64 *value,
1201− u64 *enabled, u64 *running);
1212+ int src_cpu, int dst_cpu);
1213+extern int perf_event_read_local(struct perf_event *event, u64 *value,
1214+ u64 *enabled, u64 *running);
12021215 extern u64 perf_event_read_value(struct perf_event *event,
12031216 u64 *enabled, u64 *running);
12041217
@@ -1415,14 +1428,14 @@ static inline u32 perf_sample_data_size(struct perf_sample_data *data, · 210 unmodified lines
14151428 */
14161429 static inline void perf_clear_branch_entry_bitfields(struct perf_branch_entry *br)
14171430 {
1418− br->mispred = 0;
1419− br->predicted = 0;
1420− br->in_tx = 0;
1421− br->abort = 0;
1422− br->cycles = 0;
1423− br->type = 0;
1424− br->spec = PERF_BR_SPEC_NA;
1425− br->reserved = 0;
1431+ br->mispred = 0;
1432+ br->predicted = 0;
1433+ br->in_tx = 0;
1434+ br->abort = 0;
1435+ br->cycles = 0;
1436+ br->type = 0;
1437+ br->spec = PERF_BR_SPEC_NA;
1438+ br->reserved = 0;
14261439 }
14271440
14281441 extern void perf_output_sample(struct perf_output_handle *handle,
@@ -1611,7 +1624,17 @@ extern void perf_event_bpf_event(struct bpf_prog *prog, · 182 unmodified lines
16111624 enum perf_bpf_event_type type,
16121625 u16 flags);
16131626
1627+#define PERF_GUEST_ACTIVE 0x01
1628+#define PERF_GUEST_USER 0x02
1629+
1630+struct perf_guest_info_callbacks {
1631+ unsigned int (*state)(void);
1632+ unsigned long (*get_ip)(void);
1633+ unsigned int (*handle_intel_pt_intr)(void);
1634+};
1635+
16141636 #ifdef CONFIG_GUEST_PERF_EVENTS
1637+
16151638 extern struct perf_guest_info_callbacks __rcu *perf_guest_cbs;
16161639
16171640 DECLARE_STATIC_CALL(__perf_guest_state, *perf_guest_cbs->state);
@@ -1622,21 +1645,27 @@ static inline unsigned int perf_guest_state(void) · 4 unmodified lines
16221645 {
16231646 return static_call(__perf_guest_state)();
16241647 }
1648+
16251649 static inline unsigned long perf_guest_get_ip(void)
16261650 {
16271651 return static_call(__perf_guest_get_ip)();
16281652 }
1653+
16291654 static inline unsigned int perf_guest_handle_intel_pt_intr(void)
16301655 {
16311656 return static_call(__perf_guest_handle_intel_pt_intr)();
16321657 }
1658+
16331659 extern void perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *cbs);
16341660 extern void perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *cbs);
1635−#else
1661+
1662+#else /* !CONFIG_GUEST_PERF_EVENTS: */
1663+
16361664 static inline unsigned int perf_guest_state(void) { return 0; }
16371665 static inline unsigned long perf_guest_get_ip(void) { return 0; }
16381666 static inline unsigned int perf_guest_handle_intel_pt_intr(void) { return 0; }
1639−#endif /* CONFIG_GUEST_PERF_EVENTS */
1667+
1668+#endif /* !CONFIG_GUEST_PERF_EVENTS */
16401669
16411670 extern void perf_event_exec(void);
16421671 extern void perf_event_comm(struct task_struct *tsk, bool exec);
@@ -1666,6 +1695,7 @@ static inline int perf_callchain_store_context(struct perf_callchain_entry_ctx * · 23 unmodified lines
16661695 {
16671696 if (ctx->contexts < sysctl_perf_event_max_contexts_per_stack) {
16681697 struct perf_callchain_entry *entry = ctx->entry;
1698+
16691699 entry->ip[entry->nr++] = ip;
16701700 ++ctx->contexts;
16711701 return 0;
@@ -1679,6 +1709,7 @@ static inline int perf_callchain_store(struct perf_callchain_entry_ctx *ctx, u64 · 7 unmodified lines
16791709 {
16801710 if (ctx->nr < ctx->max_stack && !ctx->contexts_maxed) {
16811711 struct perf_callchain_entry *entry = ctx->entry;
1712+
16821713 entry->ip[entry->nr++] = ip;
16831714 ++ctx->nr;
16841715 return 0;
@@ -1705,7 +1736,7 @@ static inline int perf_is_paranoid(void) · 20 unmodified lines
17051736 return sysctl_perf_event_paranoid > -1;
17061737 }
17071738
1708−int perf_allow_kernel(void);
1739+extern int perf_allow_kernel(void);
17091740
17101741 static inline int perf_allow_cpu(void)
17111742 {
@@ -1827,7 +1858,7 @@ extern int perf_output_begin_backward(struct perf_output_handle *handle, · 115 unmodified lines
18271858
18281859 extern void perf_output_end(struct perf_output_handle *handle);
18291860 extern unsigned int perf_output_copy(struct perf_output_handle *handle,
1830− const void *buf, unsigned int len);
1861+ const void *buf, unsigned int len);
18311862 extern unsigned int perf_output_skip(struct perf_output_handle *handle,
18321863 unsigned int len);
18331864 extern long perf_output_copy_aux(struct perf_output_handle *aux_handle,
@@ -1844,7 +1875,9 @@ extern void perf_event_task_tick(void); · 10 unmodified lines
18441875 extern int perf_event_account_interrupt(struct perf_event *event);
18451876 extern int perf_event_period(struct perf_event *event, u64 value);
18461877 extern u64 perf_event_pause(struct perf_event *event, bool reset);
1878+
18471879 #else /* !CONFIG_PERF_EVENTS: */
1880+
18481881 static inline void *
18491882 perf_aux_output_begin(struct perf_output_handle *handle,
18501883 struct perf_event *event) { return NULL; }
@@ -1922,19 +1955,14 @@ static inline void perf_event_disable(struct perf_event *event) { } · 71 unmodified lines
19221955 static inline int __perf_event_disable(void *info) { return -1; }
19231956 static inline void perf_event_task_tick(void) { }
19241957 static inline int perf_event_release_kernel(struct perf_event *event) { return 0; }
1925−static inline int perf_event_period(struct perf_event *event, u64 value)
1926−{
1927− return -EINVAL;
1928−}
1929−static inline u64 perf_event_pause(struct perf_event *event, bool reset)
1930−{
1931− return 0;
1932−}
1933−static inline int perf_exclude_event(struct perf_event *event, struct pt_regs *regs)
1934−{
1935− return 0;
1936−}
1937−#endif
1958+static inline int
1959+perf_event_period(struct perf_event *event, u64 value) { return -EINVAL; }
1960+static inline u64
1961+perf_event_pause(struct perf_event *event, bool reset) { return 0; }
1962+static inline int
1963+perf_exclude_event(struct perf_event *event, struct pt_regs *regs) { return 0; }
1964+
1965+#endif /* !CONFIG_PERF_EVENTS */
19381966
19391967 #if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_INTEL)
19401968 extern void perf_restore_debug_store(void);
@@ -1942,31 +1970,31 @@ extern void perf_restore_debug_store(void); · 1 unmodified line
19421970 static inline void perf_restore_debug_store(void) { }
19431971 #endif
19441972
1945−#define perf_output_put(handle, x) perf_output_copy((handle), &(x), sizeof(x))
1973+#define perf_output_put(handle, x) perf_output_copy((handle), &(x), sizeof(x))
19461974
19471975 struct perf_pmu_events_attr {
1948− struct device_attribute attr;
1949− u64 id;
1950− const char *event_str;
1976+ struct device_attribute attr;
1977+ u64 id;
1978+ const char *event_str;
19511979 };
19521980
19531981 struct perf_pmu_events_ht_attr {
1954− struct device_attribute attr;
1955− u64 id;
1956− const char *event_str_ht;
1957− const char *event_str_noht;
1982+ struct device_attribute attr;
1983+ u64 id;
1984+ const char *event_str_ht;
1985+ const char *event_str_noht;
19581986 };
19591987
19601988 struct perf_pmu_events_hybrid_attr {
1961− struct device_attribute attr;
1962− u64 id;
1963− const char *event_str;
1964− u64 pmu_type;
1989+ struct device_attribute attr;
1990+ u64 id;
1991+ const char *event_str;
1992+ u64 pmu_type;
19651993 };
19661994
19671995 struct perf_pmu_format_hybrid_attr {
1968− struct device_attribute attr;
1969− u64 pmu_type;
1996+ struct device_attribute attr;
1997+ u64 pmu_type;
19701998 };
19711999
19722000 ssize_t perf_event_sysfs_show(struct device *dev, struct device_attribute *attr,
@@ -2008,11 +2036,11 @@ static struct device_attribute format_attr_##_name = __ATTR_RO(_name) · 35 unmodified lines
20082036
20092037 /* Performance counter hotplug functions */
20102038 #ifdef CONFIG_PERF_EVENTS
2011−int perf_event_init_cpu(unsigned int cpu);
2012−int perf_event_exit_cpu(unsigned int cpu);
2039+extern int perf_event_init_cpu(unsigned int cpu);
2040+extern int perf_event_exit_cpu(unsigned int cpu);
20132041 #else
2014−#define perf_event_init_cpu NULL
2015−#define perf_event_exit_cpu NULL
2042+# define perf_event_init_cpu NULL
2043+# define perf_event_exit_cpu NULL
20162044 #endif
20172045
20182046 extern void arch_perf_update_userpage(struct perf_event *event,