aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/oprofile/common.c88
-rw-r--r--arch/arm/oprofile/init.c4
-rw-r--r--arch/arm/oprofile/op_arm_model.h4
3 files changed, 48 insertions, 48 deletions
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index 02e5d6f45166..7ce6dfa06c85 100644
--- a/arch/arm/oprofile/common.c
+++ b/arch/arm/oprofile/common.c
@@ -16,17 +16,17 @@
16#include "op_counter.h" 16#include "op_counter.h"
17#include "op_arm_model.h" 17#include "op_arm_model.h"
18 18
19static struct op_arm_model_spec *pmu_model; 19static struct op_arm_model_spec *op_arm_model;
20static int pmu_enabled; 20static int op_arm_enabled;
21static struct semaphore pmu_sem; 21static struct semaphore op_arm_sem;
22 22
23struct op_counter_config counter_config[OP_MAX_COUNTER]; 23struct op_counter_config counter_config[OP_MAX_COUNTER];
24 24
25static int pmu_create_files(struct super_block *sb, struct dentry *root) 25static int op_arm_create_files(struct super_block *sb, struct dentry *root)
26{ 26{
27 unsigned int i; 27 unsigned int i;
28 28
29 for (i = 0; i < pmu_model->num_counters; i++) { 29 for (i = 0; i < op_arm_model->num_counters; i++) {
30 struct dentry *dir; 30 struct dentry *dir;
31 char buf[2]; 31 char buf[2];
32 32
@@ -43,61 +43,61 @@ static int pmu_create_files(struct super_block *sb, struct dentry *root)
43 return 0; 43 return 0;
44} 44}
45 45
46static int pmu_setup(void) 46static int op_arm_setup(void)
47{ 47{
48 int ret; 48 int ret;
49 49
50 spin_lock(&oprofilefs_lock); 50 spin_lock(&oprofilefs_lock);
51 ret = pmu_model->setup_ctrs(); 51 ret = op_arm_model->setup_ctrs();
52 spin_unlock(&oprofilefs_lock); 52 spin_unlock(&oprofilefs_lock);
53 return ret; 53 return ret;
54} 54}
55 55
56static int pmu_start(void) 56static int op_arm_start(void)
57{ 57{
58 int ret = -EBUSY; 58 int ret = -EBUSY;
59 59
60 down(&pmu_sem); 60 down(&op_arm_sem);
61 if (!pmu_enabled) { 61 if (!op_arm_enabled) {
62 ret = pmu_model->start(); 62 ret = op_arm_model->start();
63 pmu_enabled = !ret; 63 op_arm_enabled = !ret;
64 } 64 }
65 up(&pmu_sem); 65 up(&op_arm_sem);
66 return ret; 66 return ret;
67} 67}
68 68
69static void pmu_stop(void) 69static void op_arm_stop(void)
70{ 70{
71 down(&pmu_sem); 71 down(&op_arm_sem);
72 if (pmu_enabled) 72 if (op_arm_enabled)
73 pmu_model->stop(); 73 op_arm_model->stop();
74 pmu_enabled = 0; 74 op_arm_enabled = 0;
75 up(&pmu_sem); 75 up(&op_arm_sem);
76} 76}
77 77
78#ifdef CONFIG_PM 78#ifdef CONFIG_PM
79static int pmu_suspend(struct sys_device *dev, pm_message_t state) 79static int op_arm_suspend(struct sys_device *dev, pm_message_t state)
80{ 80{
81 down(&pmu_sem); 81 down(&op_arm_sem);
82 if (pmu_enabled) 82 if (op_arm_enabled)
83 pmu_model->stop(); 83 op_arm_model->stop();
84 up(&pmu_sem); 84 up(&op_arm_sem);
85 return 0; 85 return 0;
86} 86}
87 87
88static int pmu_resume(struct sys_device *dev) 88static int op_arm_resume(struct sys_device *dev)
89{ 89{
90 down(&pmu_sem); 90 down(&op_arm_sem);
91 if (pmu_enabled && pmu_model->start()) 91 if (op_arm_enabled && op_arm_model->start())
92 pmu_enabled = 0; 92 op_arm_enabled = 0;
93 up(&pmu_sem); 93 up(&op_arm_sem);
94 return 0; 94 return 0;
95} 95}
96 96
97static struct sysdev_class oprofile_sysclass = { 97static struct sysdev_class oprofile_sysclass = {
98 set_kset_name("oprofile"), 98 set_kset_name("oprofile"),
99 .resume = pmu_resume, 99 .resume = op_arm_resume,
100 .suspend = pmu_suspend, 100 .suspend = op_arm_suspend,
101}; 101};
102 102
103static struct sys_device device_oprofile = { 103static struct sys_device device_oprofile = {
@@ -125,31 +125,31 @@ static void exit_driverfs(void)
125#define exit_driverfs() do { } while (0) 125#define exit_driverfs() do { } while (0)
126#endif /* CONFIG_PM */ 126#endif /* CONFIG_PM */
127 127
128int __init pmu_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec) 128int __init op_arm_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec)
129{ 129{
130 init_MUTEX(&pmu_sem); 130 init_MUTEX(&op_arm_sem);
131 131
132 if (spec->init() < 0) 132 if (spec->init() < 0)
133 return -ENODEV; 133 return -ENODEV;
134 134
135 pmu_model = spec; 135 op_arm_model = spec;
136 init_driverfs(); 136 init_driverfs();
137 ops->create_files = pmu_create_files; 137 ops->create_files = op_arm_create_files;
138 ops->setup = pmu_setup; 138 ops->setup = op_arm_setup;
139 ops->shutdown = pmu_stop; 139 ops->shutdown = op_arm_stop;
140 ops->start = pmu_start; 140 ops->start = op_arm_start;
141 ops->stop = pmu_stop; 141 ops->stop = op_arm_stop;
142 ops->cpu_type = pmu_model->name; 142 ops->cpu_type = op_arm_model->name;
143 printk(KERN_INFO "oprofile: using %s PMU\n", spec->name); 143 printk(KERN_INFO "oprofile: using %s\n", spec->name);
144 144
145 return 0; 145 return 0;
146} 146}
147 147
148void pmu_exit(void) 148void op_arm_exit(void)
149{ 149{
150 if (pmu_model) { 150 if (op_arm_model) {
151 exit_driverfs(); 151 exit_driverfs();
152 pmu_model = NULL; 152 op_arm_model = NULL;
153 } 153 }
154} 154}
155 155
diff --git a/arch/arm/oprofile/init.c b/arch/arm/oprofile/init.c
index d315a3a86c86..ccd8c54934a2 100644
--- a/arch/arm/oprofile/init.c
+++ b/arch/arm/oprofile/init.c
@@ -17,7 +17,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
17 int ret = -ENODEV; 17 int ret = -ENODEV;
18 18
19#ifdef CONFIG_CPU_XSCALE 19#ifdef CONFIG_CPU_XSCALE
20 ret = pmu_init(ops, &op_xscale_spec); 20 ret = op_arm_init(ops, &op_xscale_spec);
21#endif 21#endif
22 22
23 ops->backtrace = arm_backtrace; 23 ops->backtrace = arm_backtrace;
@@ -28,6 +28,6 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
28void oprofile_arch_exit(void) 28void oprofile_arch_exit(void)
29{ 29{
30#ifdef CONFIG_CPU_XSCALE 30#ifdef CONFIG_CPU_XSCALE
31 pmu_exit(); 31 op_arm_exit();
32#endif 32#endif
33} 33}
diff --git a/arch/arm/oprofile/op_arm_model.h b/arch/arm/oprofile/op_arm_model.h
index 2148d07484b7..38c6ad158547 100644
--- a/arch/arm/oprofile/op_arm_model.h
+++ b/arch/arm/oprofile/op_arm_model.h
@@ -26,6 +26,6 @@ extern struct op_arm_model_spec op_xscale_spec;
26 26
27extern void arm_backtrace(struct pt_regs * const regs, unsigned int depth); 27extern void arm_backtrace(struct pt_regs * const regs, unsigned int depth);
28 28
29extern int __init pmu_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec); 29extern int __init op_arm_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec);
30extern void pmu_exit(void); 30extern void op_arm_exit(void);
31#endif /* OP_ARM_MODEL_H */ 31#endif /* OP_ARM_MODEL_H */