aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_counter.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-12-11 07:21:10 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-11 09:45:52 -0500
commit5c92d12411dfe5f0f3d1b1c1e2f756245e6f7249 (patch)
tree498b78f995d917aa513cf15ada480327224c0277 /include/linux/perf_counter.h
parent621a01eac89b5e2f81a4cf576568b31f40a02724 (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.h9
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 {
197extern int perf_max_counters; 197extern int perf_max_counters;
198 198
199#ifdef CONFIG_PERF_COUNTERS 199#ifdef CONFIG_PERF_COUNTERS
200extern struct hw_perf_counter_ops * 200extern const struct hw_perf_counter_ops *
201hw_perf_counter_init(struct perf_counter *counter); 201hw_perf_counter_init(struct perf_counter *counter);
202 202
203extern void perf_counter_task_sched_in(struct task_struct *task, int cpu); 203extern 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);
208extern void perf_counter_print_debug(void); 208extern void perf_counter_print_debug(void);
209extern void hw_perf_restore_ctrl(u64 ctrl); 209extern void hw_perf_restore_ctrl(u64 ctrl);
210extern u64 hw_perf_disable_all(void); 210extern u64 hw_perf_disable_all(void);
211extern void atomic64_counter_set(struct perf_counter *counter, u64 val64);
212extern u64 atomic64_counter_read(struct perf_counter *counter);
213
211#else 214#else
212static inline void 215static inline void
213perf_counter_task_sched_in(struct task_struct *task, int cpu) { } 216perf_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) { }
219static inline void perf_counter_notify(struct pt_regs *regs) { } 222static inline void perf_counter_notify(struct pt_regs *regs) { }
220static inline void perf_counter_print_debug(void) { } 223static inline void perf_counter_print_debug(void) { }
221static inline void hw_perf_restore_ctrl(u64 ctrl) { } 224static inline void hw_perf_restore_ctrl(u64 ctrl) { }
222static inline u64 hw_perf_disable_all(void) { return 0; } 225static 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 */