diff options
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r-- | include/linux/perf_event.h | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 245bafdafd5e..c816075c01ce 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -944,8 +944,10 @@ extern void perf_pmu_unregister(struct pmu *pmu); | |||
944 | 944 | ||
945 | extern int perf_num_counters(void); | 945 | extern int perf_num_counters(void); |
946 | extern const char *perf_pmu_name(void); | 946 | extern const char *perf_pmu_name(void); |
947 | extern void __perf_event_task_sched_in(struct task_struct *task); | 947 | extern void __perf_event_task_sched_in(struct task_struct *prev, |
948 | extern void __perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); | 948 | struct task_struct *task); |
949 | extern void __perf_event_task_sched_out(struct task_struct *prev, | ||
950 | struct task_struct *next); | ||
949 | extern int perf_event_init_task(struct task_struct *child); | 951 | extern int perf_event_init_task(struct task_struct *child); |
950 | extern void perf_event_exit_task(struct task_struct *child); | 952 | extern void perf_event_exit_task(struct task_struct *child); |
951 | extern void perf_event_free_task(struct task_struct *task); | 953 | extern void perf_event_free_task(struct task_struct *task); |
@@ -1059,17 +1061,20 @@ perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) | |||
1059 | 1061 | ||
1060 | extern struct jump_label_key perf_sched_events; | 1062 | extern struct jump_label_key perf_sched_events; |
1061 | 1063 | ||
1062 | static inline void perf_event_task_sched_in(struct task_struct *task) | 1064 | static inline void perf_event_task_sched_in(struct task_struct *prev, |
1065 | struct task_struct *task) | ||
1063 | { | 1066 | { |
1064 | if (static_branch(&perf_sched_events)) | 1067 | if (static_branch(&perf_sched_events)) |
1065 | __perf_event_task_sched_in(task); | 1068 | __perf_event_task_sched_in(prev, task); |
1066 | } | 1069 | } |
1067 | 1070 | ||
1068 | static inline void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) | 1071 | static inline void perf_event_task_sched_out(struct task_struct *prev, |
1072 | struct task_struct *next) | ||
1069 | { | 1073 | { |
1070 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0); | 1074 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0); |
1071 | 1075 | ||
1072 | __perf_event_task_sched_out(task, next); | 1076 | if (static_branch(&perf_sched_events)) |
1077 | __perf_event_task_sched_out(prev, next); | ||
1073 | } | 1078 | } |
1074 | 1079 | ||
1075 | extern void perf_event_mmap(struct vm_area_struct *vma); | 1080 | extern void perf_event_mmap(struct vm_area_struct *vma); |
@@ -1139,10 +1144,11 @@ extern void perf_event_disable(struct perf_event *event); | |||
1139 | extern void perf_event_task_tick(void); | 1144 | extern void perf_event_task_tick(void); |
1140 | #else | 1145 | #else |
1141 | static inline void | 1146 | static inline void |
1142 | perf_event_task_sched_in(struct task_struct *task) { } | 1147 | perf_event_task_sched_in(struct task_struct *prev, |
1148 | struct task_struct *task) { } | ||
1143 | static inline void | 1149 | static inline void |
1144 | perf_event_task_sched_out(struct task_struct *task, | 1150 | perf_event_task_sched_out(struct task_struct *prev, |
1145 | struct task_struct *next) { } | 1151 | struct task_struct *next) { } |
1146 | static inline int perf_event_init_task(struct task_struct *child) { return 0; } | 1152 | static inline int perf_event_init_task(struct task_struct *child) { return 0; } |
1147 | static inline void perf_event_exit_task(struct task_struct *child) { } | 1153 | static inline void perf_event_exit_task(struct task_struct *child) { } |
1148 | static inline void perf_event_free_task(struct task_struct *task) { } | 1154 | static inline void perf_event_free_task(struct task_struct *task) { } |