summaryrefslogtreecommitdiffstats
path: root/include/linux/perf_counter.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-12-13 09:00:03 +0100
committerIngo Molnar <mingo@elte.hu>2008-12-14 20:30:48 +0100
commitee06094f8279e1312fc0a31591320cc7b6f0ab1e (patch)
treeaecf8f2177b2398e4db8df68a9705009b31a8ef7 /include/linux/perf_counter.h
parent9b194e831fb2c322ed81a373e49620f34edc2778 (diff)
downloadlinux-stable-ee06094f8279e1312fc0a31591320cc7b6f0ab1e.tar.gz
linux-stable-ee06094f8279e1312fc0a31591320cc7b6f0ab1e.tar.bz2
linux-stable-ee06094f8279e1312fc0a31591320cc7b6f0ab1e.zip
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 {
* struct hw_perf_counter - performance counter hardware details:
*/
struct hw_perf_counter {
+#ifdef CONFIG_PERF_COUNTERS
u64 config;
unsigned long config_base;
unsigned long counter_base;
int nmi;
unsigned int idx;
- u64 prev_count;
+ atomic64_t prev_count;
u64 irq_period;
- s32 next_count;
+ atomic64_t period_left;
+#endif
};
/*
@@ -140,17 +142,15 @@ enum perf_counter_active_state {
* struct perf_counter - performance counter kernel representation:
*/
struct perf_counter {
+#ifdef CONFIG_PERF_COUNTERS
struct list_head list_entry;
struct list_head sibling_list;
struct perf_counter *group_leader;
const struct hw_perf_counter_ops *hw_ops;
enum perf_counter_active_state state;
-#if BITS_PER_LONG == 64
atomic64_t count;
-#else
- atomic_t count32[2];
-#endif
+
struct perf_counter_hw_event hw_event;
struct hw_perf_counter hw;
@@ -172,6 +172,7 @@ struct perf_counter {
struct perf_data *irqdata;
struct perf_data *usrdata;
struct perf_data data[2];
+#endif
};
/**
@@ -220,8 +221,6 @@ extern void perf_counter_notify(struct pt_regs *regs);
extern void perf_counter_print_debug(void);
extern u64 hw_perf_save_disable(void);
extern void hw_perf_restore(u64 ctrl);
-extern void atomic64_counter_set(struct perf_counter *counter, u64 val64);
-extern u64 atomic64_counter_read(struct perf_counter *counter);
extern int perf_counter_task_disable(void);
extern int perf_counter_task_enable(void);