aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_counter.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2008-12-09 15:43:39 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-11 09:45:45 -0500
commit4ac13294e44664bb7edf4daf52edb71e7c6bbe84 (patch)
treeaccb533350a655e39a8ab846abc37018b2f87ccf /include/linux/perf_counter.h
parent43874d238d5f208854a73c3225ca2a22833eec8b (diff)
perf counters: protect them against CSTATE transitions
Impact: fix rare lost events problem There are CPUs whose performance counters misbehave on CSTATE transitions, so provide a way to just disable/enable them around deep idle methods. (hw_perf_enable_all() is cheap on x86.) Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_counter.h')
-rw-r--r--include/linux/perf_counter.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 22c4469abf44..5031b5614f25 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -156,6 +156,8 @@ extern void perf_counter_task_tick(struct task_struct *task, int cpu);
156extern void perf_counter_init_task(struct task_struct *task); 156extern void perf_counter_init_task(struct task_struct *task);
157extern void perf_counter_notify(struct pt_regs *regs); 157extern void perf_counter_notify(struct pt_regs *regs);
158extern void perf_counter_print_debug(void); 158extern void perf_counter_print_debug(void);
159extern void hw_perf_restore_ctrl(u64 ctrl);
160extern u64 hw_perf_disable_all(void);
159#else 161#else
160static inline void 162static inline void
161perf_counter_task_sched_in(struct task_struct *task, int cpu) { } 163perf_counter_task_sched_in(struct task_struct *task, int cpu) { }
@@ -166,6 +168,8 @@ perf_counter_task_tick(struct task_struct *task, int cpu) { }
166static inline void perf_counter_init_task(struct task_struct *task) { } 168static inline void perf_counter_init_task(struct task_struct *task) { }
167static inline void perf_counter_notify(struct pt_regs *regs) { } 169static inline void perf_counter_notify(struct pt_regs *regs) { }
168static inline void perf_counter_print_debug(void) { } 170static inline void perf_counter_print_debug(void) { }
171static inline void hw_perf_restore_ctrl(u64 ctrl) { }
172static inline u64 hw_perf_disable_all(void) { return 0; }
169#endif 173#endif
170 174
171#endif /* _LINUX_PERF_COUNTER_H */ 175#endif /* _LINUX_PERF_COUNTER_H */