aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/perf_event.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 142e3d6042c7..de2c41758e29 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -909,20 +909,6 @@ extern int perf_num_counters(void);
909extern const char *perf_pmu_name(void); 909extern const char *perf_pmu_name(void);
910extern void __perf_event_task_sched_in(struct task_struct *task); 910extern void __perf_event_task_sched_in(struct task_struct *task);
911extern void __perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); 911extern void __perf_event_task_sched_out(struct task_struct *task, struct task_struct *next);
912
913extern atomic_t perf_task_events;
914
915static inline void perf_event_task_sched_in(struct task_struct *task)
916{
917 COND_STMT(&perf_task_events, __perf_event_task_sched_in(task));
918}
919
920static inline
921void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next)
922{
923 COND_STMT(&perf_task_events, __perf_event_task_sched_out(task, next));
924}
925
926extern int perf_event_init_task(struct task_struct *child); 912extern int perf_event_init_task(struct task_struct *child);
927extern void perf_event_exit_task(struct task_struct *child); 913extern void perf_event_exit_task(struct task_struct *child);
928extern void perf_event_free_task(struct task_struct *task); 914extern void perf_event_free_task(struct task_struct *task);
@@ -1031,6 +1017,21 @@ have_event:
1031 __perf_sw_event(event_id, nr, nmi, regs, addr); 1017 __perf_sw_event(event_id, nr, nmi, regs, addr);
1032} 1018}
1033 1019
1020extern atomic_t perf_task_events;
1021
1022static inline void perf_event_task_sched_in(struct task_struct *task)
1023{
1024 COND_STMT(&perf_task_events, __perf_event_task_sched_in(task));
1025}
1026
1027static inline
1028void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next)
1029{
1030 perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 1, NULL, 0);
1031
1032 COND_STMT(&perf_task_events, __perf_event_task_sched_out(task, next));
1033}
1034
1034extern void perf_event_mmap(struct vm_area_struct *vma); 1035extern void perf_event_mmap(struct vm_area_struct *vma);
1035extern struct perf_guest_info_callbacks *perf_guest_cbs; 1036extern struct perf_guest_info_callbacks *perf_guest_cbs;
1036extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); 1037extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks);