diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-28 15:25:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-28 15:25:02 -0500 |
commit | a9e40a2493d805224f900d839b06188639b7ccd6 (patch) | |
tree | b33c9477a0728f6299a00a3e817aa26872019576 /include/linux | |
parent | 75f5d2c9bd36047364d1fb35c0720ab37df3be02 (diff) | |
parent | ee6dcfa40a50fe12a3ae0fb4d2653c66c3ed6556 (diff) |
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
perf: Fix the software context switch counter
perf, x86: Fixup Kconfig deps
x86, perf, nmi: Disable perf if counters are not accessible
perf: Fix inherit vs. context rotation bug
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/perf_event.h | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 40150f345982..de2c41758e29 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 | ||
@@ -908,20 +909,6 @@ extern int perf_num_counters(void); | |||
908 | extern const char *perf_pmu_name(void); | 909 | extern const char *perf_pmu_name(void); |
909 | extern void __perf_event_task_sched_in(struct task_struct *task); | 910 | 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); | 911 | 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); | 912 | extern int perf_event_init_task(struct task_struct *child); |
926 | extern void perf_event_exit_task(struct task_struct *child); | 913 | extern void perf_event_exit_task(struct task_struct *child); |
927 | extern void perf_event_free_task(struct task_struct *task); | 914 | extern void perf_event_free_task(struct task_struct *task); |
@@ -1030,6 +1017,21 @@ have_event: | |||
1030 | __perf_sw_event(event_id, nr, nmi, regs, addr); | 1017 | __perf_sw_event(event_id, nr, nmi, regs, addr); |
1031 | } | 1018 | } |
1032 | 1019 | ||
1020 | extern atomic_t perf_task_events; | ||
1021 | |||
1022 | static 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 | |||
1027 | static inline | ||
1028 | void 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 | |||
1033 | extern void perf_event_mmap(struct vm_area_struct *vma); | 1035 | extern void perf_event_mmap(struct vm_area_struct *vma); |
1034 | extern struct perf_guest_info_callbacks *perf_guest_cbs; | 1036 | extern struct perf_guest_info_callbacks *perf_guest_cbs; |
1035 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); | 1037 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); |