aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_counter.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-03-13 07:21:32 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-06 03:29:36 -0400
commit15dbf27cc18559a14e99609f78678aa86b9c6ff1 (patch)
tree4b88cc01991cd994777c418c4420474588b5ce0d /include/linux/perf_counter.h
parent82bae4f8c2fd64a2bb1e2e72c508853ed2b4a299 (diff)
perf_counter: software counter event infrastructure
Provide generic software counter infrastructure that supports software events. This will be used to allow sample based profiling based on software events such as pagefaults. The current infrastructure can only provide a count of such events, no place information. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_counter.h')
-rw-r--r--include/linux/perf_counter.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index dde564517b66..3fefc3b8150d 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -126,6 +126,7 @@ struct hw_perf_counter {
126 unsigned long counter_base; 126 unsigned long counter_base;
127 int nmi; 127 int nmi;
128 unsigned int idx; 128 unsigned int idx;
129 atomic64_t count; /* software */
129 atomic64_t prev_count; 130 atomic64_t prev_count;
130 u64 irq_period; 131 u64 irq_period;
131 atomic64_t period_left; 132 atomic64_t period_left;
@@ -283,6 +284,8 @@ static inline int is_software_counter(struct perf_counter *counter)
283 return !counter->hw_event.raw && counter->hw_event.type < 0; 284 return !counter->hw_event.raw && counter->hw_event.type < 0;
284} 285}
285 286
287extern void perf_swcounter_event(enum hw_event_types, u64, int, struct pt_regs *);
288
286#else 289#else
287static inline void 290static inline void
288perf_counter_task_sched_in(struct task_struct *task, int cpu) { } 291perf_counter_task_sched_in(struct task_struct *task, int cpu) { }
@@ -295,10 +298,13 @@ static inline void perf_counter_exit_task(struct task_struct *child) { }
295static inline void perf_counter_notify(struct pt_regs *regs) { } 298static inline void perf_counter_notify(struct pt_regs *regs) { }
296static inline void perf_counter_print_debug(void) { } 299static inline void perf_counter_print_debug(void) { }
297static inline void perf_counter_unthrottle(void) { } 300static inline void perf_counter_unthrottle(void) { }
298static inline void hw_perf_restore(u64 ctrl) { } 301static inline void hw_perf_restore(u64 ctrl) { }
299static inline u64 hw_perf_save_disable(void) { return 0; } 302static inline u64 hw_perf_save_disable(void) { return 0; }
300static inline int perf_counter_task_disable(void) { return -EINVAL; } 303static inline int perf_counter_task_disable(void) { return -EINVAL; }
301static inline int perf_counter_task_enable(void) { return -EINVAL; } 304static inline int perf_counter_task_enable(void) { return -EINVAL; }
305
306static inline void perf_swcounter_event(enum hw_event_types event, u64 nr,
307 int nmi, struct pt_regs *regs) { }
302#endif 308#endif
303 309
304#endif /* __KERNEL__ */ 310#endif /* __KERNEL__ */