aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/oprofile/common.c
diff options
context:
space:
mode:
authorMatt Fleming <matt@console-pimps.org>2010-09-27 15:29:58 -0400
committerRobert Richter <robert.richter@amd.com>2010-10-11 11:46:15 -0400
commit80e96b11f6cd261e1e569f3931604d656388af33 (patch)
tree9e1045534174e120d8c7fbefd558aa67097037bd /arch/arm/oprofile/common.c
parent56946331b28d53232115a155ba662ab3dc598952 (diff)
ARM: oprofile: Rename op_arm to oprofile_perf
In preparation for moving the generic functions out of this file, give the functions more general names (e.g. remove "arm" from the names). Signed-off-by: Matt Fleming <matt@console-pimps.org> Tested-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'arch/arm/oprofile/common.c')
-rw-r--r--arch/arm/oprofile/common.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index 4f67cfab2c59..d18c9f3fcffb 100644
--- a/arch/arm/oprofile/common.c
+++ b/arch/arm/oprofile/common.c
@@ -38,8 +38,8 @@ struct op_counter_config {
38 struct perf_event_attr attr; 38 struct perf_event_attr attr;
39}; 39};
40 40
41static int op_arm_enabled; 41static int oprofile_perf_enabled;
42static DEFINE_MUTEX(op_arm_mutex); 42static DEFINE_MUTEX(oprofile_perf_mutex);
43 43
44static struct op_counter_config *counter_config; 44static struct op_counter_config *counter_config;
45static struct perf_event **perf_events[nr_cpumask_bits]; 45static struct perf_event **perf_events[nr_cpumask_bits];
@@ -66,7 +66,7 @@ static void op_overflow_handler(struct perf_event *event, int unused,
66} 66}
67 67
68/* 68/*
69 * Called by op_arm_setup to create perf attributes to mirror the oprofile 69 * Called by oprofile_perf_setup to create perf attributes to mirror the oprofile
70 * settings in counter_config. Attributes are created as `pinned' events and 70 * settings in counter_config. Attributes are created as `pinned' events and
71 * so are permanently scheduled on the PMU. 71 * so are permanently scheduled on the PMU.
72 */ 72 */
@@ -123,7 +123,7 @@ static void op_destroy_counter(int cpu, int event)
123} 123}
124 124
125/* 125/*
126 * Called by op_arm_start to create active perf events based on the 126 * Called by oprofile_perf_start to create active perf events based on the
127 * perviously configured attributes. 127 * perviously configured attributes.
128 */ 128 */
129static int op_perf_start(void) 129static int op_perf_start(void)
@@ -143,7 +143,7 @@ out:
143} 143}
144 144
145/* 145/*
146 * Called by op_arm_stop at the end of a profiling run. 146 * Called by oprofile_perf_stop at the end of a profiling run.
147 */ 147 */
148static void op_perf_stop(void) 148static void op_perf_stop(void)
149{ 149{
@@ -177,7 +177,7 @@ char *op_name_from_perf_id(void)
177 } 177 }
178} 178}
179 179
180static int op_arm_create_files(struct super_block *sb, struct dentry *root) 180static int oprofile_perf_create_files(struct super_block *sb, struct dentry *root)
181{ 181{
182 unsigned int i; 182 unsigned int i;
183 183
@@ -198,7 +198,7 @@ static int op_arm_create_files(struct super_block *sb, struct dentry *root)
198 return 0; 198 return 0;
199} 199}
200 200
201static int op_arm_setup(void) 201static int oprofile_perf_setup(void)
202{ 202{
203 spin_lock(&oprofilefs_lock); 203 spin_lock(&oprofilefs_lock);
204 op_perf_setup(); 204 op_perf_setup();
@@ -206,54 +206,54 @@ static int op_arm_setup(void)
206 return 0; 206 return 0;
207} 207}
208 208
209static int op_arm_start(void) 209static int oprofile_perf_start(void)
210{ 210{
211 int ret = -EBUSY; 211 int ret = -EBUSY;
212 212
213 mutex_lock(&op_arm_mutex); 213 mutex_lock(&oprofile_perf_mutex);
214 if (!op_arm_enabled) { 214 if (!oprofile_perf_enabled) {
215 ret = 0; 215 ret = 0;
216 op_perf_start(); 216 op_perf_start();
217 op_arm_enabled = 1; 217 oprofile_perf_enabled = 1;
218 } 218 }
219 mutex_unlock(&op_arm_mutex); 219 mutex_unlock(&oprofile_perf_mutex);
220 return ret; 220 return ret;
221} 221}
222 222
223static void op_arm_stop(void) 223static void oprofile_perf_stop(void)
224{ 224{
225 mutex_lock(&op_arm_mutex); 225 mutex_lock(&oprofile_perf_mutex);
226 if (op_arm_enabled) 226 if (oprofile_perf_enabled)
227 op_perf_stop(); 227 op_perf_stop();
228 op_arm_enabled = 0; 228 oprofile_perf_enabled = 0;
229 mutex_unlock(&op_arm_mutex); 229 mutex_unlock(&oprofile_perf_mutex);
230} 230}
231 231
232#ifdef CONFIG_PM 232#ifdef CONFIG_PM
233static int op_arm_suspend(struct platform_device *dev, pm_message_t state) 233static int oprofile_perf_suspend(struct platform_device *dev, pm_message_t state)
234{ 234{
235 mutex_lock(&op_arm_mutex); 235 mutex_lock(&oprofile_perf_mutex);
236 if (op_arm_enabled) 236 if (oprofile_perf_enabled)
237 op_perf_stop(); 237 op_perf_stop();
238 mutex_unlock(&op_arm_mutex); 238 mutex_unlock(&oprofile_perf_mutex);
239 return 0; 239 return 0;
240} 240}
241 241
242static int op_arm_resume(struct platform_device *dev) 242static int oprofile_perf_resume(struct platform_device *dev)
243{ 243{
244 mutex_lock(&op_arm_mutex); 244 mutex_lock(&oprofile_perf_mutex);
245 if (op_arm_enabled && op_perf_start()) 245 if (oprofile_perf_enabled && op_perf_start())
246 op_arm_enabled = 0; 246 oprofile_perf_enabled = 0;
247 mutex_unlock(&op_arm_mutex); 247 mutex_unlock(&oprofile_perf_mutex);
248 return 0; 248 return 0;
249} 249}
250 250
251static struct platform_driver oprofile_driver = { 251static struct platform_driver oprofile_driver = {
252 .driver = { 252 .driver = {
253 .name = "arm-oprofile", 253 .name = "oprofile-perf",
254 }, 254 },
255 .resume = op_arm_resume, 255 .resume = oprofile_perf_resume,
256 .suspend = op_arm_suspend, 256 .suspend = oprofile_perf_suspend,
257}; 257};
258 258
259static struct platform_device *oprofile_pdev; 259static struct platform_device *oprofile_pdev;
@@ -388,11 +388,11 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
388 } 388 }
389 389
390 ops->backtrace = arm_backtrace; 390 ops->backtrace = arm_backtrace;
391 ops->create_files = op_arm_create_files; 391 ops->create_files = oprofile_perf_create_files;
392 ops->setup = op_arm_setup; 392 ops->setup = oprofile_perf_setup;
393 ops->start = op_arm_start; 393 ops->start = oprofile_perf_start;
394 ops->stop = op_arm_stop; 394 ops->stop = oprofile_perf_stop;
395 ops->shutdown = op_arm_stop; 395 ops->shutdown = oprofile_perf_stop;
396 ops->cpu_type = op_name_from_perf_id(); 396 ops->cpu_type = op_name_from_perf_id();
397 397
398 if (!ops->cpu_type) 398 if (!ops->cpu_type)