init.c 836 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * @file init.c
  3. *
  4. * @remark Copyright 2002 OProfile authors
  5. * @remark Read the file COPYING
  6. *
  7. * @author John Levon <levon@movementarian.org>
  8. */
  9. #include <linux/oprofile.h>
  10. #include <linux/init.h>
  11. #include <linux/errno.h>
  12. /*
  13. * We support CPUs that have performance counters like the Pentium Pro
  14. * with the NMI mode driver.
  15. */
  16. #ifdef CONFIG_X86_LOCAL_APIC
  17. extern int op_nmi_init(struct oprofile_operations *ops);
  18. extern void op_nmi_exit(void);
  19. #else
  20. static int op_nmi_init(struct oprofile_operations *ops) { return -ENODEV; }
  21. static void op_nmi_exit(void) { }
  22. #endif
  23. extern void x86_backtrace(struct pt_regs * const regs, unsigned int depth);
  24. int __init oprofile_arch_init(struct oprofile_operations *ops)
  25. {
  26. ops->backtrace = x86_backtrace;
  27. return op_nmi_init(ops);
  28. }
  29. void oprofile_arch_exit(void)
  30. {
  31. op_nmi_exit();
  32. }