aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-03-13 12:21:35 +0100
committerIngo Molnar <mingo@elte.hu>2009-04-06 09:29:41 +0200
commitd6d020e9957745c61285ef3da9f294c5e6801f0f (patch)
treeefbd81871b58dbb026f19e812b224e1add2f3b76 /include
parentac17dc8e58f3069ea895cfff963adf98ff3cf6b2 (diff)
perf_counter: hrtimer based sampling for software time events
Use hrtimers to profile timer based sampling for the software time counters. This allows platforms without hardware counter support to still perform sample based profiling. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r--include/linux/perf_counter.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 4b14a8e9dbf..dfb4c7ce18b 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -114,6 +114,7 @@ struct perf_counter_hw_event {
#include <linux/rculist.h>
#include <linux/rcupdate.h>
#include <linux/spinlock.h>
+#include <linux/hrtimer.h>
#include <asm/atomic.h>
struct task_struct;
@@ -123,12 +124,19 @@ struct task_struct;
*/
struct hw_perf_counter {
#ifdef CONFIG_PERF_COUNTERS
- u64 config;
- unsigned long config_base;
- unsigned long counter_base;
- int nmi;
- unsigned int idx;
- atomic64_t count; /* software */
+ union {
+ struct { /* hardware */
+ u64 config;
+ unsigned long config_base;
+ unsigned long counter_base;
+ int nmi;
+ unsigned int idx;
+ };
+ union { /* software */
+ atomic64_t count;
+ struct hrtimer hrtimer;
+ };
+ };
atomic64_t prev_count;
u64 irq_period;
atomic64_t period_left;