diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-12-11 07:21:10 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-11 09:45:52 -0500 |
commit | 5c92d12411dfe5f0f3d1b1c1e2f756245e6f7249 (patch) | |
tree | 498b78f995d917aa513cf15ada480327224c0277 /include/linux/perf_counter.h | |
parent | 621a01eac89b5e2f81a4cf576568b31f40a02724 (diff) |
perf counters: implement PERF_COUNT_CPU_CLOCK
Impact: add new perf-counter type
The 'CPU clock' counter counts the amount of CPU clock time that is
elapsing, in nanoseconds. (regardless of how much of it the task is
spending on a CPU executing)
This counter type is a Linux kernel based abstraction, it is available
even if the hardware does not support native hardware performance counters.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_counter.h')
-rw-r--r-- | include/linux/perf_counter.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index 27385641ecb6..9a1713a1be27 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
@@ -131,7 +131,7 @@ struct perf_counter { | |||
131 | struct list_head list_entry; | 131 | struct list_head list_entry; |
132 | struct list_head sibling_list; | 132 | struct list_head sibling_list; |
133 | struct perf_counter *group_leader; | 133 | struct perf_counter *group_leader; |
134 | struct hw_perf_counter_ops *hw_ops; | 134 | const struct hw_perf_counter_ops *hw_ops; |
135 | 135 | ||
136 | int active; | 136 | int active; |
137 | #if BITS_PER_LONG == 64 | 137 | #if BITS_PER_LONG == 64 |
@@ -197,7 +197,7 @@ struct perf_cpu_context { | |||
197 | extern int perf_max_counters; | 197 | extern int perf_max_counters; |
198 | 198 | ||
199 | #ifdef CONFIG_PERF_COUNTERS | 199 | #ifdef CONFIG_PERF_COUNTERS |
200 | extern struct hw_perf_counter_ops * | 200 | extern const struct hw_perf_counter_ops * |
201 | hw_perf_counter_init(struct perf_counter *counter); | 201 | hw_perf_counter_init(struct perf_counter *counter); |
202 | 202 | ||
203 | extern void perf_counter_task_sched_in(struct task_struct *task, int cpu); | 203 | extern void perf_counter_task_sched_in(struct task_struct *task, int cpu); |
@@ -208,6 +208,9 @@ extern void perf_counter_notify(struct pt_regs *regs); | |||
208 | extern void perf_counter_print_debug(void); | 208 | extern void perf_counter_print_debug(void); |
209 | extern void hw_perf_restore_ctrl(u64 ctrl); | 209 | extern void hw_perf_restore_ctrl(u64 ctrl); |
210 | extern u64 hw_perf_disable_all(void); | 210 | extern u64 hw_perf_disable_all(void); |
211 | extern void atomic64_counter_set(struct perf_counter *counter, u64 val64); | ||
212 | extern u64 atomic64_counter_read(struct perf_counter *counter); | ||
213 | |||
211 | #else | 214 | #else |
212 | static inline void | 215 | static inline void |
213 | perf_counter_task_sched_in(struct task_struct *task, int cpu) { } | 216 | perf_counter_task_sched_in(struct task_struct *task, int cpu) { } |
@@ -219,7 +222,7 @@ static inline void perf_counter_init_task(struct task_struct *task) { } | |||
219 | static inline void perf_counter_notify(struct pt_regs *regs) { } | 222 | static inline void perf_counter_notify(struct pt_regs *regs) { } |
220 | static inline void perf_counter_print_debug(void) { } | 223 | static inline void perf_counter_print_debug(void) { } |
221 | static inline void hw_perf_restore_ctrl(u64 ctrl) { } | 224 | static inline void hw_perf_restore_ctrl(u64 ctrl) { } |
222 | static inline u64 hw_perf_disable_all(void) { return 0; } | 225 | static inline u64 hw_perf_disable_all(void) { return 0; } |
223 | #endif | 226 | #endif |
224 | 227 | ||
225 | #endif /* _LINUX_PERF_COUNTER_H */ | 228 | #endif /* _LINUX_PERF_COUNTER_H */ |