* Move prototypes of perf_event_task_{migrate|sched_in|sched_out|tick}()
into a separate #ifdef block and append _fn to function names and
define macros to redirect calls.
* Define PE_STATIC which currently is empty so that these functions
can be made static depending on config option.
* Define no-op perf_task_sched_out_done() and call it from the end of
perf_task_sched_out().
Other than renaming the functions, this function doesn't introduce any
visible change. This is to prepare for moving these functions on top
of tracepoints.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
---
include/linux/perf_event.h | 43 +++++++++++++++++++++++++++++--------------
kernel/perf_event.c | 30 ++++++++++++++++++++----------
2 files changed, 49 insertions(+), 24 deletions(-)
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 1e3c6c3..0ad898b 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -747,6 +747,35 @@ struct perf_output_handle {
#ifdef CONFIG_PERF_EVENTS
+extern void perf_event_task_migrate_fn(struct task_struct *task, int new_cpu);
+extern void perf_event_task_sched_in_fn(struct task_struct *task);
+extern void perf_event_task_sched_out_fn(struct rq *rq,
+ struct task_struct *task,
+ struct task_struct *next);
+extern void perf_event_task_tick_fn(struct task_struct *task);
+
+#define perf_event_task_migrate(t, c) perf_event_task_migrate_fn((t), (c))
+#define perf_event_task_sched_in(t) perf_event_task_sched_in_fn((t))
+#define perf_event_task_sched_out(r, t, n) \
+ perf_event_task_sched_out_fn((r), (t), (n))
+#define perf_event_task_tick(t) perf_event_task_tick_fn((t))
+
+#else
+
+static inline void
+perf_event_task_migrate(struct task_struct *task, int new_cpu) { }
+static inline void
+perf_event_task_sched_in(struct ...