diff options
Diffstat (limited to 'include/linux/oprofile.h')
-rw-r--r-- | include/linux/oprofile.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h index 32fb81212fd1..7f5cfd3b37dd 100644 --- a/include/linux/oprofile.h +++ b/include/linux/oprofile.h | |||
@@ -16,6 +16,8 @@ | |||
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> | 18 | #include <linux/init.h> |
19 | #include <linux/errno.h> | ||
20 | #include <linux/printk.h> | ||
19 | #include <asm/atomic.h> | 21 | #include <asm/atomic.h> |
20 | 22 | ||
21 | /* Each escaped entry is prefixed by ESCAPE_CODE | 23 | /* Each escaped entry is prefixed by ESCAPE_CODE |
@@ -104,6 +106,13 @@ void oprofile_add_sample(struct pt_regs * const regs, unsigned long event); | |||
104 | void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs, | 106 | void oprofile_add_ext_sample(unsigned long pc, struct pt_regs * const regs, |
105 | unsigned long event, int is_kernel); | 107 | unsigned long event, int is_kernel); |
106 | 108 | ||
109 | /** | ||
110 | * Add an hardware sample. | ||
111 | */ | ||
112 | void 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 | |||
107 | /* 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 |
108 | * backtrace. */ | 117 | * backtrace. */ |
109 | void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event); | 118 | void oprofile_add_pc(unsigned long pc, int is_kernel, unsigned long event); |
@@ -186,10 +195,17 @@ int oprofile_add_data(struct op_entry *entry, unsigned long val); | |||
186 | int oprofile_add_data64(struct op_entry *entry, u64 val); | 195 | int oprofile_add_data64(struct op_entry *entry, u64 val); |
187 | int oprofile_write_commit(struct op_entry *entry); | 196 | int oprofile_write_commit(struct op_entry *entry); |
188 | 197 | ||
189 | #ifdef CONFIG_PERF_EVENTS | 198 | #ifdef CONFIG_HW_PERF_EVENTS |
190 | int __init oprofile_perf_init(struct oprofile_operations *ops); | 199 | int __init oprofile_perf_init(struct oprofile_operations *ops); |
191 | void oprofile_perf_exit(void); | 200 | void oprofile_perf_exit(void); |
192 | char *op_name_from_perf_id(void); | 201 | char *op_name_from_perf_id(void); |
193 | #endif /* CONFIG_PERF_EVENTS */ | 202 | #else |
203 | static inline int __init oprofile_perf_init(struct oprofile_operations *ops) | ||
204 | { | ||
205 | pr_info("oprofile: hardware counters not available\n"); | ||
206 | return -ENODEV; | ||
207 | } | ||
208 | static inline void oprofile_perf_exit(void) { } | ||
209 | #endif /* CONFIG_HW_PERF_EVENTS */ | ||
194 | 210 | ||
195 | #endif /* OPROFILE_H */ | 211 | #endif /* OPROFILE_H */ |