Line | |
---|
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 | |
---|
10 | #include <linux/kernel.h> |
---|
11 | #include <linux/oprofile.h> |
---|
12 | #include <linux/init.h> |
---|
13 | #include <linux/errno.h> |
---|
14 | #include "oprofile_perfmon.h" |
---|
15 | |
---|
16 | extern int perfmon_init(struct oprofile_operations * ops); |
---|
17 | extern void perfmon_exit(void); |
---|
18 | extern void ia64_backtrace(struct pt_regs * const regs, unsigned int depth); |
---|
19 | |
---|
20 | int __init oprofile_arch_init(struct oprofile_operations * ops) |
---|
21 | { |
---|
22 | int ret = -ENODEV; |
---|
23 | |
---|
24 | if (is_running_on_xen()) { |
---|
25 | ret = xen_perfmon_init(); |
---|
26 | if (ret) |
---|
27 | return ret; |
---|
28 | return xenoprofile_init(ops); |
---|
29 | } |
---|
30 | |
---|
31 | #ifdef CONFIG_PERFMON |
---|
32 | /* perfmon_init() can fail, but we have no way to report it */ |
---|
33 | ret = perfmon_init(ops); |
---|
34 | #endif |
---|
35 | ops->backtrace = ia64_backtrace; |
---|
36 | |
---|
37 | return ret; |
---|
38 | } |
---|
39 | |
---|
40 | |
---|
41 | void oprofile_arch_exit(void) |
---|
42 | { |
---|
43 | if (is_running_on_xen()) { |
---|
44 | xenoprofile_exit(); |
---|
45 | xen_perfmon_exit(); |
---|
46 | return; |
---|
47 | } |
---|
48 | |
---|
49 | #ifdef CONFIG_PERFMON |
---|
50 | perfmon_exit(); |
---|
51 | #endif |
---|
52 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.