aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/oprofile/op_impl.h
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2008-12-16 09:33:53 +0900
committerPaul Mundt <lethal@linux-sh.org>2008-12-22 18:44:43 +0900
commit60a51fbe5dd2baef0f35bcf79f25ac1ee239a660 (patch)
tree5183e3e22c526129f6fa9ddbe973116f2bed08b1 /arch/sh/oprofile/op_impl.h
parentsh: Enable GENERIC_HARDIRQS_NO__DO_IRQ for all SuperH machines (diff)
downloadlinux-dev-60a51fbe5dd2baef0f35bcf79f25ac1ee239a660.tar.xz
linux-dev-60a51fbe5dd2baef0f35bcf79f25ac1ee239a660.zip
sh: oprofile: Refactor common setup code for multiple driver support.
This re-implements the old op_model_null code in to something more generic, where multiple drivers, backtrace, etc. can all be interfaced. Based largely on arch/mips/oprofile/common.c. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/oprofile/op_impl.h')
-rw-r--r--arch/sh/oprofile/op_impl.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/sh/oprofile/op_impl.h b/arch/sh/oprofile/op_impl.h
new file mode 100644
index 000000000000..4d509975eba6
--- /dev/null
+++ b/arch/sh/oprofile/op_impl.h
@@ -0,0 +1,33 @@
+#ifndef __OP_IMPL_H
+#define __OP_IMPL_H
+
+/* Per-counter configuration as set via oprofilefs. */
+struct op_counter_config {
+ unsigned long enabled;
+ unsigned long event;
+
+ unsigned long long count;
+
+ /* Dummy values for userspace tool compliance */
+ unsigned long kernel;
+ unsigned long user;
+ unsigned long unit_mask;
+};
+
+/* Per-architecture configury and hooks. */
+struct op_sh_model {
+ void (*reg_setup)(struct op_counter_config *);
+ int (*create_files)(struct super_block *sb, struct dentry *dir);
+ void (*cpu_setup)(void *dummy);
+ int (*init)(void);
+ void (*exit)(void);
+ void (*cpu_start)(void *args);
+ void (*cpu_stop)(void *args);
+ char *cpu_type;
+ unsigned char num_counters;
+};
+
+/* arch/sh/oprofile/common.c */
+extern void sh_backtrace(struct pt_regs * const regs, unsigned int depth);
+
+#endif /* __OP_IMPL_H */