aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_counter.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-12-13 03:00:03 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-14 14:30:48 -0500
commitee06094f8279e1312fc0a31591320cc7b6f0ab1e (patch)
treeaecf8f2177b2398e4db8df68a9705009b31a8ef7 /include/linux/perf_counter.h
parent9b194e831fb2c322ed81a373e49620f34edc2778 (diff)
perfcounters: restructure x86 counter math
Impact: restructure code Change counter math from absolute values to clear delta logic. We try to extract elapsed deltas from the raw hw counter - and put that into the generic counter. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_counter.h')
-rw-r--r--include/linux/perf_counter.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 8cb095fa442c..72460289c654 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -91,14 +91,16 @@ struct perf_counter_hw_event {
91 * struct hw_perf_counter - performance counter hardware details: 91 * struct hw_perf_counter - performance counter hardware details:
92 */ 92 */
93struct hw_perf_counter { 93struct hw_perf_counter {
94#ifdef CONFIG_PERF_COUNTERS
94 u64 config; 95 u64 config;
95 unsigned long config_base; 96 unsigned long config_base;
96 unsigned long counter_base; 97 unsigned long counter_base;
97 int nmi; 98 int nmi;
98 unsigned int idx; 99 unsigned int idx;
99 u64 prev_count; 100 atomic64_t prev_count;
100 u64 irq_period; 101 u64 irq_period;
101 s32 next_count; 102 atomic64_t period_left;
103#endif
102}; 104};
103 105
104/* 106/*
@@ -140,17 +142,15 @@ enum perf_counter_active_state {
140 * struct perf_counter - performance counter kernel representation: 142 * struct perf_counter - performance counter kernel representation:
141 */ 143 */
142struct perf_counter { 144struct perf_counter {
145#ifdef CONFIG_PERF_COUNTERS
143 struct list_head list_entry; 146 struct list_head list_entry;
144 struct list_head sibling_list; 147 struct list_head sibling_list;
145 struct perf_counter *group_leader; 148 struct perf_counter *group_leader;
146 const struct hw_perf_counter_ops *hw_ops; 149 const struct hw_perf_counter_ops *hw_ops;
147 150
148 enum perf_counter_active_state state; 151 enum perf_counter_active_state state;
149#if BITS_PER_LONG == 64
150 atomic64_t count; 152 atomic64_t count;
151#else 153
152 atomic_t count32[2];
153#endif
154 struct perf_counter_hw_event hw_event; 154 struct perf_counter_hw_event hw_event;
155 struct hw_perf_counter hw; 155 struct hw_perf_counter hw;
156 156
@@ -172,6 +172,7 @@ struct perf_counter {
172 struct perf_data *irqdata; 172 struct perf_data *irqdata;
173 struct perf_data *usrdata; 173 struct perf_data *usrdata;
174 struct perf_data data[2]; 174 struct perf_data data[2];
175#endif
175}; 176};
176 177
177/** 178/**
@@ -220,8 +221,6 @@ extern void perf_counter_notify(struct pt_regs *regs);
220extern void perf_counter_print_debug(void); 221extern void perf_counter_print_debug(void);
221extern u64 hw_perf_save_disable(void); 222extern u64 hw_perf_save_disable(void);
222extern void hw_perf_restore(u64 ctrl); 223extern void hw_perf_restore(u64 ctrl);
223extern void atomic64_counter_set(struct perf_counter *counter, u64 val64);
224extern u64 atomic64_counter_read(struct perf_counter *counter);
225extern int perf_counter_task_disable(void); 224extern int perf_counter_task_disable(void);
226extern int perf_counter_task_enable(void); 225extern int perf_counter_task_enable(void);
227 226