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:35 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-06 03:29:41 -0400
commitd6d020e9957745c61285ef3da9f294c5e6801f0f (patch)
treeefbd81871b58dbb026f19e812b224e1add2f3b76 /include/linux/perf_counter.h
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/linux/perf_counter.h')
-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 4b14a8e9dbf5..dfb4c7ce18b3 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -114,6 +114,7 @@ struct perf_counter_hw_event {
114#include <linux/rculist.h> 114#include <linux/rculist.h>
115#include <linux/rcupdate.h> 115#include <linux/rcupdate.h>
116#include <linux/spinlock.h> 116#include <linux/spinlock.h>
117#include <linux/hrtimer.h>
117#include <asm/atomic.h> 118#include <asm/atomic.h>
118 119
119struct task_struct; 120struct task_struct;
@@ -123,12 +124,19 @@ struct task_struct;
123 */ 124 */
124struct hw_perf_counter { 125struct hw_perf_counter {
125#ifdef CONFIG_PERF_COUNTERS 126#ifdef CONFIG_PERF_COUNTERS
126 u64 config; 127 union {
127 unsigned long config_base; 128 struct { /* hardware */
128 unsigned long counter_base; 129 u64 config;
129 int nmi; 130 unsigned long config_base;
130 unsigned int idx; 131 unsigned long counter_base;
131 atomic64_t count; /* software */ 132 int nmi;
133 unsigned int idx;
134 };
135 union { /* software */
136 atomic64_t count;
137 struct hrtimer hrtimer;
138 };
139 };
132 atomic64_t prev_count; 140 atomic64_t prev_count;
133 u64 irq_period; 141 u64 irq_period;
134 atomic64_t period_left; 142 atomic64_t period_left;