diff options
Diffstat (limited to 'include/linux/perf_event.h')
| -rw-r--r-- | include/linux/perf_event.h | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 97965fac55fe..7f0e7f52af8b 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -487,6 +487,7 @@ struct perf_guest_info_callbacks { | |||
| 487 | #include <linux/ftrace.h> | 487 | #include <linux/ftrace.h> |
| 488 | #include <linux/cpu.h> | 488 | #include <linux/cpu.h> |
| 489 | #include <linux/irq_work.h> | 489 | #include <linux/irq_work.h> |
| 490 | #include <linux/jump_label_ref.h> | ||
| 490 | #include <asm/atomic.h> | 491 | #include <asm/atomic.h> |
| 491 | #include <asm/local.h> | 492 | #include <asm/local.h> |
| 492 | 493 | ||
| @@ -895,8 +896,30 @@ extern void perf_pmu_unregister(struct pmu *pmu); | |||
| 895 | 896 | ||
| 896 | extern int perf_num_counters(void); | 897 | extern int perf_num_counters(void); |
| 897 | extern const char *perf_pmu_name(void); | 898 | extern const char *perf_pmu_name(void); |
| 898 | extern void perf_event_task_sched_in(struct task_struct *task); | 899 | extern void __perf_event_task_sched_in(struct task_struct *task); |
| 899 | extern void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); | 900 | extern void __perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); |
| 901 | |||
| 902 | extern atomic_t perf_task_events; | ||
| 903 | |||
| 904 | static inline void perf_event_task_sched_in(struct task_struct *task) | ||
| 905 | { | ||
| 906 | JUMP_LABEL(&perf_task_events, have_events); | ||
| 907 | return; | ||
| 908 | |||
| 909 | have_events: | ||
| 910 | __perf_event_task_sched_in(task); | ||
| 911 | } | ||
| 912 | |||
| 913 | static inline | ||
| 914 | void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) | ||
| 915 | { | ||
| 916 | JUMP_LABEL(&perf_task_events, have_events); | ||
| 917 | return; | ||
| 918 | |||
| 919 | have_events: | ||
| 920 | __perf_event_task_sched_out(task, next); | ||
| 921 | } | ||
| 922 | |||
| 900 | extern int perf_event_init_task(struct task_struct *child); | 923 | extern int perf_event_init_task(struct task_struct *child); |
| 901 | extern void perf_event_exit_task(struct task_struct *child); | 924 | extern void perf_event_exit_task(struct task_struct *child); |
| 902 | extern void perf_event_free_task(struct task_struct *task); | 925 | extern void perf_event_free_task(struct task_struct *task); |
