diff options
Diffstat (limited to 'include/linux/perf_event.h')
| -rw-r--r-- | include/linux/perf_event.h | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index ddbb6a901f65..8adf70e9e3cc 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -1084,10 +1084,8 @@ extern void perf_pmu_unregister(struct pmu *pmu); | |||
| 1084 | 1084 | ||
| 1085 | extern int perf_num_counters(void); | 1085 | extern int perf_num_counters(void); |
| 1086 | extern const char *perf_pmu_name(void); | 1086 | extern const char *perf_pmu_name(void); |
| 1087 | extern void __perf_event_task_sched_in(struct task_struct *prev, | 1087 | extern void __perf_event_task_sched(struct task_struct *prev, |
| 1088 | struct task_struct *task); | 1088 | struct task_struct *next); |
| 1089 | extern void __perf_event_task_sched_out(struct task_struct *prev, | ||
| 1090 | struct task_struct *next); | ||
| 1091 | extern int perf_event_init_task(struct task_struct *child); | 1089 | extern int perf_event_init_task(struct task_struct *child); |
| 1092 | extern void perf_event_exit_task(struct task_struct *child); | 1090 | extern void perf_event_exit_task(struct task_struct *child); |
| 1093 | extern void perf_event_free_task(struct task_struct *task); | 1091 | extern void perf_event_free_task(struct task_struct *task); |
| @@ -1132,11 +1130,14 @@ struct perf_sample_data { | |||
| 1132 | struct perf_branch_stack *br_stack; | 1130 | struct perf_branch_stack *br_stack; |
| 1133 | }; | 1131 | }; |
| 1134 | 1132 | ||
| 1135 | static inline void perf_sample_data_init(struct perf_sample_data *data, u64 addr) | 1133 | static inline void perf_sample_data_init(struct perf_sample_data *data, |
| 1134 | u64 addr, u64 period) | ||
| 1136 | { | 1135 | { |
| 1136 | /* remaining struct members initialized in perf_prepare_sample() */ | ||
| 1137 | data->addr = addr; | 1137 | data->addr = addr; |
| 1138 | data->raw = NULL; | 1138 | data->raw = NULL; |
| 1139 | data->br_stack = NULL; | 1139 | data->br_stack = NULL; |
| 1140 | data->period = period; | ||
| 1140 | } | 1141 | } |
| 1141 | 1142 | ||
| 1142 | extern void perf_output_sample(struct perf_output_handle *handle, | 1143 | extern void perf_output_sample(struct perf_output_handle *handle, |
| @@ -1204,20 +1205,13 @@ perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) | |||
| 1204 | 1205 | ||
| 1205 | extern struct static_key_deferred perf_sched_events; | 1206 | extern struct static_key_deferred perf_sched_events; |
| 1206 | 1207 | ||
| 1207 | static inline void perf_event_task_sched_in(struct task_struct *prev, | 1208 | static inline void perf_event_task_sched(struct task_struct *prev, |
| 1208 | struct task_struct *task) | 1209 | struct task_struct *task) |
| 1209 | { | 1210 | { |
| 1210 | if (static_key_false(&perf_sched_events.key)) | ||
| 1211 | __perf_event_task_sched_in(prev, task); | ||
| 1212 | } | ||
| 1213 | |||
| 1214 | static inline void perf_event_task_sched_out(struct task_struct *prev, | ||
| 1215 | struct task_struct *next) | ||
| 1216 | { | ||
| 1217 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0); | 1211 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0); |
| 1218 | 1212 | ||
| 1219 | if (static_key_false(&perf_sched_events.key)) | 1213 | if (static_key_false(&perf_sched_events.key)) |
| 1220 | __perf_event_task_sched_out(prev, next); | 1214 | __perf_event_task_sched(prev, task); |
| 1221 | } | 1215 | } |
| 1222 | 1216 | ||
| 1223 | extern void perf_event_mmap(struct vm_area_struct *vma); | 1217 | extern void perf_event_mmap(struct vm_area_struct *vma); |
| @@ -1292,11 +1286,8 @@ extern void perf_event_disable(struct perf_event *event); | |||
| 1292 | extern void perf_event_task_tick(void); | 1286 | extern void perf_event_task_tick(void); |
| 1293 | #else | 1287 | #else |
| 1294 | static inline void | 1288 | static inline void |
| 1295 | perf_event_task_sched_in(struct task_struct *prev, | 1289 | perf_event_task_sched(struct task_struct *prev, |
| 1296 | struct task_struct *task) { } | 1290 | struct task_struct *task) { } |
| 1297 | static inline void | ||
| 1298 | perf_event_task_sched_out(struct task_struct *prev, | ||
| 1299 | struct task_struct *next) { } | ||
| 1300 | static inline int perf_event_init_task(struct task_struct *child) { return 0; } | 1291 | static inline int perf_event_init_task(struct task_struct *child) { return 0; } |
| 1301 | static inline void perf_event_exit_task(struct task_struct *child) { } | 1292 | static inline void perf_event_exit_task(struct task_struct *child) { } |
| 1302 | static inline void perf_event_free_task(struct task_struct *task) { } | 1293 | static inline void perf_event_free_task(struct task_struct *task) { } |
