aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt@console-pimps.org>2010-09-27 15:35:29 -0400
committerRobert Richter <robert.richter@amd.com>2010-10-11 11:46:15 -0400
commit58850e210cd207399cf6461326e322541b2ec81c (patch)
tree7649e9ebcb30c0e9347cb39b9f3e9006e898717d
parent80e96b11f6cd261e1e569f3931604d656388af33 (diff)
ARM: oprofile: Move non-ARM code into separate init/exit
In preparation for moving the majority of this oprofile code into an architecture-neutral place separate the architecture-independent code into oprofile_perf_init() and oprofile_perf_exit(). 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>
-rw-r--r--arch/arm/oprofile/common.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index d18c9f3fcffb..8718311cb530 100644
--- a/arch/arm/oprofile/common.c
+++ b/arch/arm/oprofile/common.c
@@ -349,7 +349,7 @@ static void arm_backtrace(struct pt_regs * const regs, unsigned int depth)
349 tail = user_backtrace(tail); 349 tail = user_backtrace(tail);
350} 350}
351 351
352int __init oprofile_arch_init(struct oprofile_operations *ops) 352int __init oprofile_perf_init(struct oprofile_operations *ops)
353{ 353{
354 int cpu, ret = 0; 354 int cpu, ret = 0;
355 355
@@ -387,7 +387,6 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
387 } 387 }
388 } 388 }
389 389
390 ops->backtrace = arm_backtrace;
391 ops->create_files = oprofile_perf_create_files; 390 ops->create_files = oprofile_perf_create_files;
392 ops->setup = oprofile_perf_setup; 391 ops->setup = oprofile_perf_setup;
393 ops->start = oprofile_perf_start; 392 ops->start = oprofile_perf_start;
@@ -410,7 +409,14 @@ out:
410 return ret; 409 return ret;
411} 410}
412 411
413void __exit oprofile_arch_exit(void) 412int __init oprofile_arch_init(struct oprofile_operations *ops)
413{
414 ops->backtrace = arm_backtrace;
415
416 return oprofile_perf_init(ops);
417}
418
419void __exit oprofile_perf_exit(void)
414{ 420{
415 int cpu, id; 421 int cpu, id;
416 struct perf_event *event; 422 struct perf_event *event;
@@ -428,6 +434,11 @@ void __exit oprofile_arch_exit(void)
428 kfree(counter_config); 434 kfree(counter_config);
429 exit_driverfs(); 435 exit_driverfs();
430} 436}
437
438void __exit oprofile_arch_exit(void)
439{
440 oprofile_perf_exit();
441}
431#else 442#else
432int __init oprofile_arch_init(struct oprofile_operations *ops) 443int __init oprofile_arch_init(struct oprofile_operations *ops)
433{ 444{