Commit 58850e210cd207399cf6461326e322541b2ec81c

Authored by Matt Fleming
Committed by Robert Richter
1 parent 80e96b11f6

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>

Showing 1 changed file with 14 additions and 3 deletions Side-by-side Diff

arch/arm/oprofile/common.c
... ... @@ -349,7 +349,7 @@
349 349 tail = user_backtrace(tail);
350 350 }
351 351  
352   -int __init oprofile_arch_init(struct oprofile_operations *ops)
  352 +int __init oprofile_perf_init(struct oprofile_operations *ops)
353 353 {
354 354 int cpu, ret = 0;
355 355  
... ... @@ -387,7 +387,6 @@
387 387 }
388 388 }
389 389  
390   - ops->backtrace = arm_backtrace;
391 390 ops->create_files = oprofile_perf_create_files;
392 391 ops->setup = oprofile_perf_setup;
393 392 ops->start = oprofile_perf_start;
394 393  
... ... @@ -410,8 +409,15 @@
410 409 return ret;
411 410 }
412 411  
413   -void __exit oprofile_arch_exit(void)
  412 +int __init oprofile_arch_init(struct oprofile_operations *ops)
414 413 {
  414 + ops->backtrace = arm_backtrace;
  415 +
  416 + return oprofile_perf_init(ops);
  417 +}
  418 +
  419 +void __exit oprofile_perf_exit(void)
  420 +{
415 421 int cpu, id;
416 422 struct perf_event *event;
417 423  
... ... @@ -427,6 +433,11 @@
427 433  
428 434 kfree(counter_config);
429 435 exit_driverfs();
  436 +}
  437 +
  438 +void __exit oprofile_arch_exit(void)
  439 +{
  440 + oprofile_perf_exit();
430 441 }
431 442 #else
432 443 int __init oprofile_arch_init(struct oprofile_operations *ops)