1
2
3
4
5
6
7 #ifndef _UAPI_ASM_IA64_PERFMON_H
8 #define _UAPI_ASM_IA64_PERFMON_H
9
10
11
12
13 #define PFM_WRITE_PMCS 0x01
14 #define PFM_WRITE_PMDS 0x02
15 #define PFM_READ_PMDS 0x03
16 #define PFM_STOP 0x04
17 #define PFM_START 0x05
18 #define PFM_ENABLE 0x06
19 #define PFM_DISABLE 0x07
20 #define PFM_CREATE_CONTEXT 0x08
21 #define PFM_DESTROY_CONTEXT 0x09
22 #define PFM_RESTART 0x0a
23 #define PFM_PROTECT_CONTEXT 0x0b
24 #define PFM_GET_FEATURES 0x0c
25 #define PFM_DEBUG 0x0d
26 #define PFM_UNPROTECT_CONTEXT 0x0e
27 #define PFM_GET_PMC_RESET_VAL 0x0f
28 #define PFM_LOAD_CONTEXT 0x10
29 #define PFM_UNLOAD_CONTEXT 0x11
30
31
32
33
34 #define PFM_WRITE_IBRS 0x20
35 #define PFM_WRITE_DBRS 0x21
36
37
38
39
40 #define PFM_FL_NOTIFY_BLOCK 0x01
41 #define PFM_FL_SYSTEM_WIDE 0x02
42 #define PFM_FL_OVFL_NO_MSG 0x80
43
44
45
46
47 #define PFM_SETFL_EXCL_IDLE 0x01
48
49
50
51
52 #define PFM_REGFL_OVFL_NOTIFY 0x1
53 #define PFM_REGFL_RANDOM 0x2
54
55
56
57
58
59
60
61 #define PFM_REG_RETFL_NOTAVAIL (1UL<<31)
62 #define PFM_REG_RETFL_EINVAL (1UL<<30)
63 #define PFM_REG_RETFL_MASK (PFM_REG_RETFL_NOTAVAIL|PFM_REG_RETFL_EINVAL)
64
65 #define PFM_REG_HAS_ERROR(flag) (((flag) & PFM_REG_RETFL_MASK) != 0)
66
67 typedef unsigned char pfm_uuid_t[16];
68
69
70
71
72 typedef struct {
73 pfm_uuid_t ctx_smpl_buf_id;
74 unsigned long ctx_flags;
75 unsigned short ctx_nextra_sets;
76 unsigned short ctx_reserved1;
77 int ctx_fd;
78 void *ctx_smpl_vaddr;
79 unsigned long ctx_reserved2[11];
80 } pfarg_context_t;
81
82
83
84
85 typedef struct {
86 unsigned int reg_num;
87 unsigned short reg_set;
88 unsigned short reg_reserved1;
89
90 unsigned long reg_value;
91 unsigned long reg_flags;
92
93 unsigned long reg_long_reset;
94 unsigned long reg_short_reset;
95
96 unsigned long reg_reset_pmds[4];
97 unsigned long reg_random_seed;
98 unsigned long reg_random_mask;
99 unsigned long reg_last_reset_val;
100
101 unsigned long reg_smpl_pmds[4];
102 unsigned long reg_smpl_eventid;
103
104 unsigned long reg_reserved2[3];
105 } pfarg_reg_t;
106
107 typedef struct {
108 unsigned int dbreg_num;
109 unsigned short dbreg_set;
110 unsigned short dbreg_reserved1;
111 unsigned long dbreg_value;
112 unsigned long dbreg_flags;
113 unsigned long dbreg_reserved2[1];
114 } pfarg_dbreg_t;
115
116 typedef struct {
117 unsigned int ft_version;
118 unsigned int ft_reserved;
119 unsigned long reserved[4];
120 } pfarg_features_t;
121
122 typedef struct {
123 pid_t load_pid;
124 unsigned short load_set;
125 unsigned short load_reserved1;
126 unsigned long load_reserved2[3];
127 } pfarg_load_t;
128
129 typedef struct {
130 int msg_type;
131 int msg_ctx_fd;
132 unsigned long msg_ovfl_pmds[4];
133 unsigned short msg_active_set;
134 unsigned short msg_reserved1;
135 unsigned int msg_reserved2;
136 unsigned long msg_tstamp;
137 } pfm_ovfl_msg_t;
138
139 typedef struct {
140 int msg_type;
141 int msg_ctx_fd;
142 unsigned long msg_tstamp;
143 } pfm_end_msg_t;
144
145 typedef struct {
146 int msg_type;
147 int msg_ctx_fd;
148 unsigned long msg_tstamp;
149 } pfm_gen_msg_t;
150
151 #define PFM_MSG_OVFL 1
152 #define PFM_MSG_END 2
153
154 typedef union {
155 pfm_ovfl_msg_t pfm_ovfl_msg;
156 pfm_end_msg_t pfm_end_msg;
157 pfm_gen_msg_t pfm_gen_msg;
158 } pfm_msg_t;
159
160
161
162
163 #define PFM_VERSION_MAJ 2U
164 #define PFM_VERSION_MIN 0U
165 #define PFM_VERSION (((PFM_VERSION_MAJ&0xffff)<<16)|(PFM_VERSION_MIN & 0xffff))
166 #define PFM_VERSION_MAJOR(x) (((x)>>16) & 0xffff)
167 #define PFM_VERSION_MINOR(x) ((x) & 0xffff)
168
169
170
171
172
173 #define PMU_FIRST_COUNTER 4
174 #define PMU_MAX_PMCS 256
175 #define PMU_MAX_PMDS 256
176
177
178 #endif