diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-12-11 08:59:31 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-11 09:45:55 -0500 |
commit | 1d1c7ddbfab358445a542715551301b7fc363e28 (patch) | |
tree | d4421834d109b206f39c2019ea039fd42ed22e1d /include/linux/perf_counter.h | |
parent | bae43c9945ebeef15e7952e317efb02393d3bfc7 (diff) |
perf counters: add prctl interface to disable/enable counters
Add a way for self-monitoring tasks to disable/enable counters summarily,
via a prctl:
PR_TASK_PERF_COUNTERS_DISABLE 31
PR_TASK_PERF_COUNTERS_ENABLE 32
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_counter.h')
-rw-r--r-- | include/linux/perf_counter.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index 30c0ec8c1ee3..97d86c293ee8 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
@@ -213,6 +213,8 @@ extern u64 hw_perf_save_disable(void); | |||
213 | extern void hw_perf_restore(u64 ctrl); | 213 | extern void hw_perf_restore(u64 ctrl); |
214 | extern void atomic64_counter_set(struct perf_counter *counter, u64 val64); | 214 | extern void atomic64_counter_set(struct perf_counter *counter, u64 val64); |
215 | extern u64 atomic64_counter_read(struct perf_counter *counter); | 215 | extern u64 atomic64_counter_read(struct perf_counter *counter); |
216 | extern int perf_counter_task_disable(void); | ||
217 | extern int perf_counter_task_enable(void); | ||
216 | 218 | ||
217 | #else | 219 | #else |
218 | static inline void | 220 | static inline void |
@@ -226,6 +228,8 @@ static inline void perf_counter_notify(struct pt_regs *regs) { } | |||
226 | static inline void perf_counter_print_debug(void) { } | 228 | static inline void perf_counter_print_debug(void) { } |
227 | static inline void hw_perf_restore(u64 ctrl) { } | 229 | static inline void hw_perf_restore(u64 ctrl) { } |
228 | static inline u64 hw_perf_save_disable(void) { return 0; } | 230 | static inline u64 hw_perf_save_disable(void) { return 0; } |
231 | static inline int perf_counter_task_disable(void) { return -EINVAL; } | ||
232 | static inline int perf_counter_task_enable(void) { return -EINVAL; } | ||
229 | #endif | 233 | #endif |
230 | 234 | ||
231 | #endif /* _LINUX_PERF_COUNTER_H */ | 235 | #endif /* _LINUX_PERF_COUNTER_H */ |