1
2
3
4
5
6
7
8
9
10
11#ifndef OP_X86_MODEL_H
12#define OP_X86_MODEL_H
13
14struct op_saved_msr {
15 unsigned int high;
16 unsigned int low;
17};
18
19struct op_msr {
20 unsigned long addr;
21 struct op_saved_msr saved;
22};
23
24struct op_msrs {
25 struct op_msr *counters;
26 struct op_msr *controls;
27};
28
29struct pt_regs;
30
31
32
33
34struct op_x86_model_spec {
35 int (*init)(struct oprofile_operations *ops);
36 void (*exit)(void);
37 unsigned int num_counters;
38 unsigned int num_controls;
39 void (*fill_in_addresses)(struct op_msrs * const msrs);
40 void (*setup_ctrs)(struct op_msrs const * const msrs);
41 int (*check_ctrs)(struct pt_regs * const regs,
42 struct op_msrs const * const msrs);
43 void (*start)(struct op_msrs const * const msrs);
44 void (*stop)(struct op_msrs const * const msrs);
45 void (*shutdown)(struct op_msrs const * const msrs);
46};
47
48extern struct op_x86_model_spec op_ppro_spec;
49extern struct op_x86_model_spec const op_p4_spec;
50extern struct op_x86_model_spec const op_p4_ht2_spec;
51extern struct op_x86_model_spec const op_amd_spec;
52extern struct op_x86_model_spec op_arch_perfmon_spec;
53
54extern void arch_perfmon_setup_counters(void);
55
56#endif
57