This source file includes following definitions.
- op_name_from_perf_id
- oprofile_arch_init
- oprofile_arch_exit
- oprofile_arch_init
- oprofile_arch_exit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #include <linux/kernel.h>
16 #include <linux/oprofile.h>
17 #include <linux/init.h>
18 #include <linux/errno.h>
19 #include <linux/smp.h>
20 #include <linux/perf_event.h>
21 #include <linux/slab.h>
22 #include <asm/processor.h>
23
24 extern void sh_backtrace(struct pt_regs * const regs, unsigned int depth);
25
26 #ifdef CONFIG_HW_PERF_EVENTS
27
28
29
30 static char *sh_pmu_op_name;
31
32 char *op_name_from_perf_id(void)
33 {
34 return sh_pmu_op_name;
35 }
36
37 int __init oprofile_arch_init(struct oprofile_operations *ops)
38 {
39 ops->backtrace = sh_backtrace;
40
41 if (perf_num_counters() == 0)
42 return -ENODEV;
43
44 sh_pmu_op_name = kasprintf(GFP_KERNEL, "%s/%s",
45 UTS_MACHINE, perf_pmu_name());
46 if (unlikely(!sh_pmu_op_name))
47 return -ENOMEM;
48
49 return oprofile_perf_init(ops);
50 }
51
52 void oprofile_arch_exit(void)
53 {
54 oprofile_perf_exit();
55 kfree(sh_pmu_op_name);
56 }
57 #else
58 int __init oprofile_arch_init(struct oprofile_operations *ops)
59 {
60 ops->backtrace = sh_backtrace;
61 return -ENODEV;
62 }
63 void oprofile_arch_exit(void) {}
64 #endif