aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/oprofile.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/oprofile.h')
-rw-r--r--include/linux/oprofile.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index 5171639ecf0f..7f5cfd3b37dd 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -15,6 +15,9 @@
15 15
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18#include <linux/init.h>
19#include <linux/errno.h>
20#include <linux/printk.h>
18#include <asm/atomic.h> 21#include <asm/atomic.h>
19 22
20/* Each escaped entry is prefixed by ESCAPE_CODE 23/* Each escaped entry is prefixed by ESCAPE_CODE
@@ -103,6 +106,13 @@ void oprofile_add_sample(struct pt_regs * const regs, unsigned long event);
103void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs, 106void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs,
104 unsigned long event, int is_kernel); 107 unsigned long event, int is_kernel);
105 108
109/**
110 * Add an hardware sample.
111 */
112void oprofile_add_ext_hw_sample(unsigned long pc, struct pt_regs * const regs,
113 unsigned long event, int is_kernel,
114 struct task_struct *task);
115
106/* Use this instead when the PC value is not from the regs. Doesn't 116/* Use this instead when the PC value is not from the regs. Doesn't
107 * backtrace. */ 117 * backtrace. */
108void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event); 118void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event);
@@ -185,4 +195,17 @@ int oprofile_add_data(struct op_entry *entry, unsigned long val);
185int oprofile_add_data64(struct op_entry *entry, u64 val); 195int oprofile_add_data64(struct op_entry *entry, u64 val);
186int oprofile_write_commit(struct op_entry *entry); 196int oprofile_write_commit(struct op_entry *entry);
187 197
198#ifdef CONFIG_HW_PERF_EVENTS
199int __init oprofile_perf_init(struct oprofile_operations *ops);
200void oprofile_perf_exit(void);
201char *op_name_from_perf_id(void);
202#else
203static inline int __init oprofile_perf_init(struct oprofile_operations *ops)
204{
205 pr_info("oprofile: hardware counters not available\n");
206 return -ENODEV;
207}
208static inline void oprofile_perf_exit(void) { }
209#endif /* CONFIG_HW_PERF_EVENTS */
210
188#endif /* OPROFILE_H */ 211#endif /* OPROFILE_H */