Commit 80e96b11f6cd261e1e569f3931604d656388af33
Committed by
Robert Richter
1 parent
56946331b2
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>
Showing 1 changed file with 34 additions and 34 deletions Side-by-side Diff
arch/arm/oprofile/common.c
... | ... | @@ -38,8 +38,8 @@ |
38 | 38 | struct perf_event_attr attr; |
39 | 39 | }; |
40 | 40 | |
41 | -static int op_arm_enabled; | |
42 | -static DEFINE_MUTEX(op_arm_mutex); | |
41 | +static int oprofile_perf_enabled; | |
42 | +static DEFINE_MUTEX(oprofile_perf_mutex); | |
43 | 43 | |
44 | 44 | static struct op_counter_config *counter_config; |
45 | 45 | static struct perf_event **perf_events[nr_cpumask_bits]; |
... | ... | @@ -66,7 +66,7 @@ |
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 | 70 | * settings in counter_config. Attributes are created as `pinned' events and |
71 | 71 | * so are permanently scheduled on the PMU. |
72 | 72 | */ |
... | ... | @@ -123,7 +123,7 @@ |
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 | 127 | * perviously configured attributes. |
128 | 128 | */ |
129 | 129 | static int op_perf_start(void) |
... | ... | @@ -143,7 +143,7 @@ |
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 | */ |
148 | 148 | static void op_perf_stop(void) |
149 | 149 | { |
... | ... | @@ -177,7 +177,7 @@ |
177 | 177 | } |
178 | 178 | } |
179 | 179 | |
180 | -static int op_arm_create_files(struct super_block *sb, struct dentry *root) | |
180 | +static int oprofile_perf_create_files(struct super_block *sb, struct dentry *root) | |
181 | 181 | { |
182 | 182 | unsigned int i; |
183 | 183 | |
... | ... | @@ -198,7 +198,7 @@ |
198 | 198 | return 0; |
199 | 199 | } |
200 | 200 | |
201 | -static int op_arm_setup(void) | |
201 | +static int oprofile_perf_setup(void) | |
202 | 202 | { |
203 | 203 | spin_lock(&oprofilefs_lock); |
204 | 204 | op_perf_setup(); |
205 | 205 | |
206 | 206 | |
207 | 207 | |
208 | 208 | |
209 | 209 | |
210 | 210 | |
211 | 211 | |
212 | 212 | |
213 | 213 | |
214 | 214 | |
215 | 215 | |
216 | 216 | |
217 | 217 | |
... | ... | @@ -206,54 +206,54 @@ |
206 | 206 | return 0; |
207 | 207 | } |
208 | 208 | |
209 | -static int op_arm_start(void) | |
209 | +static int oprofile_perf_start(void) | |
210 | 210 | { |
211 | 211 | int ret = -EBUSY; |
212 | 212 | |
213 | - mutex_lock(&op_arm_mutex); | |
214 | - if (!op_arm_enabled) { | |
213 | + mutex_lock(&oprofile_perf_mutex); | |
214 | + if (!oprofile_perf_enabled) { | |
215 | 215 | ret = 0; |
216 | 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 | 220 | return ret; |
221 | 221 | } |
222 | 222 | |
223 | -static void op_arm_stop(void) | |
223 | +static void oprofile_perf_stop(void) | |
224 | 224 | { |
225 | - mutex_lock(&op_arm_mutex); | |
226 | - if (op_arm_enabled) | |
225 | + mutex_lock(&oprofile_perf_mutex); | |
226 | + if (oprofile_perf_enabled) | |
227 | 227 | op_perf_stop(); |
228 | - op_arm_enabled = 0; | |
229 | - mutex_unlock(&op_arm_mutex); | |
228 | + oprofile_perf_enabled = 0; | |
229 | + mutex_unlock(&oprofile_perf_mutex); | |
230 | 230 | } |
231 | 231 | |
232 | 232 | #ifdef CONFIG_PM |
233 | -static int op_arm_suspend(struct platform_device *dev, pm_message_t state) | |
233 | +static int oprofile_perf_suspend(struct platform_device *dev, pm_message_t state) | |
234 | 234 | { |
235 | - mutex_lock(&op_arm_mutex); | |
236 | - if (op_arm_enabled) | |
235 | + mutex_lock(&oprofile_perf_mutex); | |
236 | + if (oprofile_perf_enabled) | |
237 | 237 | op_perf_stop(); |
238 | - mutex_unlock(&op_arm_mutex); | |
238 | + mutex_unlock(&oprofile_perf_mutex); | |
239 | 239 | return 0; |
240 | 240 | } |
241 | 241 | |
242 | -static int op_arm_resume(struct platform_device *dev) | |
242 | +static int oprofile_perf_resume(struct platform_device *dev) | |
243 | 243 | { |
244 | - mutex_lock(&op_arm_mutex); | |
245 | - if (op_arm_enabled && op_perf_start()) | |
246 | - op_arm_enabled = 0; | |
247 | - mutex_unlock(&op_arm_mutex); | |
244 | + mutex_lock(&oprofile_perf_mutex); | |
245 | + if (oprofile_perf_enabled && op_perf_start()) | |
246 | + oprofile_perf_enabled = 0; | |
247 | + mutex_unlock(&oprofile_perf_mutex); | |
248 | 248 | return 0; |
249 | 249 | } |
250 | 250 | |
251 | 251 | static struct platform_driver oprofile_driver = { |
252 | 252 | .driver = { |
253 | - .name = "arm-oprofile", | |
253 | + .name = "oprofile-perf", | |
254 | 254 | }, |
255 | - .resume = op_arm_resume, | |
256 | - .suspend = op_arm_suspend, | |
255 | + .resume = oprofile_perf_resume, | |
256 | + .suspend = oprofile_perf_suspend, | |
257 | 257 | }; |
258 | 258 | |
259 | 259 | static struct platform_device *oprofile_pdev; |
... | ... | @@ -388,11 +388,11 @@ |
388 | 388 | } |
389 | 389 | |
390 | 390 | ops->backtrace = arm_backtrace; |
391 | - ops->create_files = op_arm_create_files; | |
392 | - ops->setup = op_arm_setup; | |
393 | - ops->start = op_arm_start; | |
394 | - ops->stop = op_arm_stop; | |
395 | - ops->shutdown = op_arm_stop; | |
391 | + ops->create_files = oprofile_perf_create_files; | |
392 | + ops->setup = oprofile_perf_setup; | |
393 | + ops->start = oprofile_perf_start; | |
394 | + ops->stop = oprofile_perf_stop; | |
395 | + ops->shutdown = oprofile_perf_stop; | |
396 | 396 | ops->cpu_type = op_name_from_perf_id(); |
397 | 397 | |
398 | 398 | if (!ops->cpu_type) |