diff options
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r-- | include/linux/perf_event.h | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 40150f345982..4f1279e105ee 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -850,6 +850,7 @@ struct perf_event_context { | |||
850 | int nr_active; | 850 | int nr_active; |
851 | int is_active; | 851 | int is_active; |
852 | int nr_stat; | 852 | int nr_stat; |
853 | int rotate_disable; | ||
853 | atomic_t refcount; | 854 | atomic_t refcount; |
854 | struct task_struct *task; | 855 | struct task_struct *task; |
855 | 856 | ||
@@ -886,6 +887,7 @@ struct perf_cpu_context { | |||
886 | int exclusive; | 887 | int exclusive; |
887 | struct list_head rotation_list; | 888 | struct list_head rotation_list; |
888 | int jiffies_interval; | 889 | int jiffies_interval; |
890 | struct pmu *active_pmu; | ||
889 | }; | 891 | }; |
890 | 892 | ||
891 | struct perf_output_handle { | 893 | struct perf_output_handle { |
@@ -908,20 +910,6 @@ extern int perf_num_counters(void); | |||
908 | extern const char *perf_pmu_name(void); | 910 | extern const char *perf_pmu_name(void); |
909 | extern void __perf_event_task_sched_in(struct task_struct *task); | 911 | extern void __perf_event_task_sched_in(struct task_struct *task); |
910 | extern void __perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); | 912 | extern void __perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); |
911 | |||
912 | extern atomic_t perf_task_events; | ||
913 | |||
914 | static inline void perf_event_task_sched_in(struct task_struct *task) | ||
915 | { | ||
916 | COND_STMT(&perf_task_events, __perf_event_task_sched_in(task)); | ||
917 | } | ||
918 | |||
919 | static inline | ||
920 | void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) | ||
921 | { | ||
922 | COND_STMT(&perf_task_events, __perf_event_task_sched_out(task, next)); | ||
923 | } | ||
924 | |||
925 | extern int perf_event_init_task(struct task_struct *child); | 913 | extern int perf_event_init_task(struct task_struct *child); |
926 | extern void perf_event_exit_task(struct task_struct *child); | 914 | extern void perf_event_exit_task(struct task_struct *child); |
927 | extern void perf_event_free_task(struct task_struct *task); | 915 | extern void perf_event_free_task(struct task_struct *task); |
@@ -1030,6 +1018,21 @@ have_event: | |||
1030 | __perf_sw_event(event_id, nr, nmi, regs, addr); | 1018 | __perf_sw_event(event_id, nr, nmi, regs, addr); |
1031 | } | 1019 | } |
1032 | 1020 | ||
1021 | extern atomic_t perf_task_events; | ||
1022 | |||
1023 | static inline void perf_event_task_sched_in(struct task_struct *task) | ||
1024 | { | ||
1025 | COND_STMT(&perf_task_events, __perf_event_task_sched_in(task)); | ||
1026 | } | ||
1027 | |||
1028 | static inline | ||
1029 | void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) | ||
1030 | { | ||
1031 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 1, NULL, 0); | ||
1032 | |||
1033 | COND_STMT(&perf_task_events, __perf_event_task_sched_out(task, next)); | ||
1034 | } | ||
1035 | |||
1033 | extern void perf_event_mmap(struct vm_area_struct *vma); | 1036 | extern void perf_event_mmap(struct vm_area_struct *vma); |
1034 | extern struct perf_guest_info_callbacks *perf_guest_cbs; | 1037 | extern struct perf_guest_info_callbacks *perf_guest_cbs; |
1035 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); | 1038 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); |