PAPI 7.1.0.0
Loading...
Searching...
No Matches
pfmlib_coreduo.c File Reference
Include dependency graph for pfmlib_coreduo.c:

Go to the source code of this file.

Macros

#define sel_event_select   perfevtsel.sel_event_select
 
#define sel_unit_mask   perfevtsel.sel_unit_mask
 
#define sel_usr   perfevtsel.sel_usr
 
#define sel_os   perfevtsel.sel_os
 
#define sel_edge   perfevtsel.sel_edge
 
#define sel_pc   perfevtsel.sel_pc
 
#define sel_int   perfevtsel.sel_int
 
#define sel_en   perfevtsel.sel_en
 
#define sel_inv   perfevtsel.sel_inv
 
#define sel_cnt_mask   perfevtsel.sel_cnt_mask
 
#define COREDUO_SEL_BASE   0x186
 
#define COREDUO_CTR_BASE   0xc1
 
#define PFMLIB_COREDUO_ALL_FLAGS    (PFM_COREDUO_SEL_INV|PFM_COREDUO_SEL_EDGE)
 
#define HAS_OPTIONS(x)   (cntrs && (cntrs[x].flags || cntrs[x].cnt_mask))
 

Functions

static int pfm_coreduo_detect (void)
 
static int pfm_coreduo_init (void)
 
static int pfm_coreduo_dispatch_counters (pfmlib_input_param_t *inp, pfmlib_coreduo_input_param_t *param, pfmlib_output_param_t *outp)
 
static int pfm_coreduo_dispatch_events (pfmlib_input_param_t *inp, void *model_in, pfmlib_output_param_t *outp, void *model_out)
 
static int pfm_coreduo_get_event_code (unsigned int i, unsigned int cnt, int *code)
 
static void pfm_coreduo_get_event_counters (unsigned int j, pfmlib_regmask_t *counters)
 
static void pfm_coreduo_get_impl_pmcs (pfmlib_regmask_t *impl_pmcs)
 
static void pfm_coreduo_get_impl_pmds (pfmlib_regmask_t *impl_pmds)
 
static void pfm_coreduo_get_impl_counters (pfmlib_regmask_t *impl_counters)
 
static void pfm_coreduo_get_hw_counter_width (unsigned int *width)
 
static char * pfm_coreduo_get_event_name (unsigned int i)
 
static int pfm_coreduo_get_event_description (unsigned int ev, char **str)
 
static char * pfm_coreduo_get_event_mask_name (unsigned int ev, unsigned int midx)
 
static int pfm_coreduo_get_event_mask_desc (unsigned int ev, unsigned int midx, char **str)
 
static unsigned int pfm_coreduo_get_num_event_masks (unsigned int ev)
 
static int pfm_coreduo_get_event_mask_code (unsigned int ev, unsigned int midx, unsigned int *code)
 
static int pfm_coreduo_get_cycle_event (pfmlib_event_t *e)
 
static int pfm_coreduo_get_inst_retired (pfmlib_event_t *e)
 

Variables

static pfmlib_regmask_t coreduo_impl_pmcs
 
static pfmlib_regmask_t coreduo_impl_pmds
 
static int highest_counter
 
pfm_pmu_support_t coreduo_support
 

Macro Definition Documentation

◆ COREDUO_CTR_BASE

#define COREDUO_CTR_BASE   0xc1

Definition at line 76 of file pfmlib_coreduo.c.

◆ COREDUO_SEL_BASE

#define COREDUO_SEL_BASE   0x186

Definition at line 75 of file pfmlib_coreduo.c.

◆ HAS_OPTIONS

#define HAS_OPTIONS (   x)    (cntrs && (cntrs[x].flags || cntrs[x].cnt_mask))

◆ PFMLIB_COREDUO_ALL_FLAGS

#define PFMLIB_COREDUO_ALL_FLAGS    (PFM_COREDUO_SEL_INV|PFM_COREDUO_SEL_EDGE)

Definition at line 78 of file pfmlib_coreduo.c.

◆ sel_cnt_mask

#define sel_cnt_mask   perfevtsel.sel_cnt_mask

Definition at line 57 of file pfmlib_coreduo.c.

◆ sel_edge

#define sel_edge   perfevtsel.sel_edge

Definition at line 52 of file pfmlib_coreduo.c.

◆ sel_en

#define sel_en   perfevtsel.sel_en

Definition at line 55 of file pfmlib_coreduo.c.

◆ sel_event_select

#define sel_event_select   perfevtsel.sel_event_select

Definition at line 48 of file pfmlib_coreduo.c.

◆ sel_int

#define sel_int   perfevtsel.sel_int

Definition at line 54 of file pfmlib_coreduo.c.

◆ sel_inv

#define sel_inv   perfevtsel.sel_inv

Definition at line 56 of file pfmlib_coreduo.c.

◆ sel_os

#define sel_os   perfevtsel.sel_os

Definition at line 51 of file pfmlib_coreduo.c.

◆ sel_pc

#define sel_pc   perfevtsel.sel_pc

Definition at line 53 of file pfmlib_coreduo.c.

◆ sel_unit_mask

#define sel_unit_mask   perfevtsel.sel_unit_mask

Definition at line 49 of file pfmlib_coreduo.c.

◆ sel_usr

#define sel_usr   perfevtsel.sel_usr

Definition at line 50 of file pfmlib_coreduo.c.

Function Documentation

◆ pfm_coreduo_detect()

static int pfm_coreduo_detect ( void  )
static

Definition at line 85 of file pfmlib_coreduo.c.

86{
87 char buffer[128];
88 int family, model;
89 int ret;
90
91 ret = __pfm_getcpuinfo_attr("vendor_id", buffer, sizeof(buffer));
92 if (ret == -1)
93 return PFMLIB_ERR_NOTSUPP;
94
95 if (strcmp(buffer, "GenuineIntel"))
96 return PFMLIB_ERR_NOTSUPP;
97
98 ret = __pfm_getcpuinfo_attr("cpu family", buffer, sizeof(buffer));
99 if (ret == -1)
100 return PFMLIB_ERR_NOTSUPP;
101
102 family = atoi(buffer);
103
104 ret = __pfm_getcpuinfo_attr("model", buffer, sizeof(buffer));
105 if (ret == -1)
106 return PFMLIB_ERR_NOTSUPP;
107
108 model = atoi(buffer);
109
110 return family == 6 && model == 14 ? PFMLIB_SUCCESS : PFMLIB_ERR_NOTSUPP;
111}
#define PFMLIB_SUCCESS
Definition: pfmlib.h:283
#define PFMLIB_ERR_NOTSUPP
Definition: pfmlib.h:284
int model
Definition: pfmlib_amd64.c:86
int family
Definition: pfmlib_amd64.c:85
int __pfm_getcpuinfo_attr(const char *attr, char *ret_buf, size_t maxlen)
Here is the call graph for this function:

◆ pfm_coreduo_dispatch_counters()

static int pfm_coreduo_dispatch_counters ( pfmlib_input_param_t inp,
pfmlib_coreduo_input_param_t param,
pfmlib_output_param_t outp 
)
static

Definition at line 132 of file pfmlib_coreduo.c.

133{
134#define HAS_OPTIONS(x) (cntrs && (cntrs[x].flags || cntrs[x].cnt_mask))
135
139 pfmlib_reg_t *pc, *pd;
140 pfmlib_regmask_t *r_pmcs;
141 uint64_t val;
142 unsigned long plm;
143 unsigned int npc, npmc0, npmc1, nf2;
144 unsigned int i, n, k, ucode;
145 unsigned int assign_pc[PMU_COREDUO_NUM_COUNTERS];
146 unsigned int next_gen, last_gen;
147
148 npc = npmc0 = npmc1 = nf2 = 0;
149
150 e = inp->pfp_events;
151 pc = outp->pfp_pmcs;
152 pd = outp->pfp_pmds;
153 n = inp->pfp_event_count;
154
155 r_pmcs = &inp->pfp_unavail_pmcs;
156 cntrs = param ? param->pfp_coreduo_counters : NULL;
157
159 return PFMLIB_ERR_TOOMANY;
160
161 /*
162 * initilize to empty
163 */
164 for(i=0; i < PMU_COREDUO_NUM_COUNTERS; i++)
165 assign_pc[i] = -1;
166
167 /*
168 * error checking
169 */
170 for(i=0; i < n; i++) {
171 /*
172 * only supports two priv levels for perf counters
173 */
174 if (e[i].plm & (PFM_PLM1|PFM_PLM2))
175 return PFMLIB_ERR_INVAL;
176
177 /*
178 * check for valid flags
179 */
180 if (cntrs && cntrs[i].flags & ~PFMLIB_COREDUO_ALL_FLAGS)
181 return PFMLIB_ERR_INVAL;
182
183 /*
184 * check event-level single register constraint (PMC0, PMC1, FIXED_CTR2)
185 * fail if more than two events requested for the same counter
186 */
187 if (coreduo_pe[e[i].event].pme_flags & PFMLIB_COREDUO_PMC0) {
188 if (++npmc0 > 1) {
189 DPRINT("two events compete for a PMC0\n");
190 return PFMLIB_ERR_NOASSIGN;
191 }
192 }
193 /*
194 * check if PMC1 is available and if only one event is dependent on it
195 */
196 if (coreduo_pe[e[i].event].pme_flags & PFMLIB_COREDUO_PMC1) {
197 if (++npmc1 > 1) {
198 DPRINT("two events compete for a PMC1\n");
199 return PFMLIB_ERR_NOASSIGN;
200 }
201 }
202 }
203
204 next_gen = 0; /* first generic counter */
205 last_gen = 1; /* last generic counter */
206
207 /*
208 * strongest constraint first: works only in IA32_PMC0, IA32_PMC1
209 */
210 for(i=0; i < n; i++) {
211 if ((coreduo_pe[e[i].event].pme_flags & PFMLIB_COREDUO_PMC0)) {
212 if (pfm_regmask_isset(r_pmcs, 0))
213 return PFMLIB_ERR_NOASSIGN;
214
215 assign_pc[i] = 0;
216
217 next_gen++;
218 }
219 if (coreduo_pe[e[i].event].pme_flags & PFMLIB_COREDUO_PMC1) {
220 if (pfm_regmask_isset(r_pmcs, 1))
221 return PFMLIB_ERR_NOASSIGN;
222
223 assign_pc[i] = 1;
224
225 next_gen = (next_gen+1) % PMU_COREDUO_NUM_COUNTERS;
226 }
227 }
228 /*
229 * assign what is left
230 */
231 for(i=0; i < n; i++) {
232 if (assign_pc[i] == -1) {
233 for(; next_gen <= last_gen; next_gen++) {
234DPRINT("i=%d next_gen=%d last=%d isset=%d\n", i, next_gen, last_gen, pfm_regmask_isset(r_pmcs, next_gen));
235 if (!pfm_regmask_isset(r_pmcs, next_gen))
236 break;
237 }
238 if (next_gen <= last_gen)
239 assign_pc[i] = next_gen++;
240 else {
241 DPRINT("cannot assign generic counters\n");
242 return PFMLIB_ERR_NOASSIGN;
243 }
244 }
245 }
246
247 for (i=0; i < n ; i++ ) {
248 reg.val = 0; /* assume reserved bits are zerooed */
249
250 /* if plm is 0, then assume not specified per-event and use default */
251 plm = e[i].plm ? e[i].plm : inp->pfp_dfl_plm;
252
253 val = coreduo_pe[e[i].event].pme_code;
254
255 reg.sel_event_select = val & 0xff;
256
257 ucode = (val >> 8) & 0xff;
258
259 for(k=0; k < e[i].num_masks; k++) {
260 ucode |= coreduo_pe[e[i].event].pme_umasks[e[i].unit_masks[k]].pme_ucode;
261 }
262
263 /*
264 * for events supporting Core specificity (self, both), a value
265 * of 0 for bits 15:14 (7:6 in our umask) is reserved, therefore we
266 * force to SELF if user did not specify anything
267 */
268 if ((coreduo_pe[e[i].event].pme_flags & PFMLIB_COREDUO_CSPEC)
269 && ((ucode & (0x3 << 6)) == 0)) {
270 ucode |= 1 << 6;
271 }
272 /*
273 * for events supporting MESI, a value
274 * of 0 for bits 11:8 (0-3 in our umask) means nothing will be
275 * counted. Therefore, we force a default of 0xf (M,E,S,I).
276 */
277 if ((coreduo_pe[e[i].event].pme_flags & PFMLIB_COREDUO_MESI)
278 && ((ucode & 0xf) == 0)) {
279 ucode |= 0xf;
280 }
281
282 val |= ucode << 8;
283
284 reg.sel_unit_mask = ucode;
285 reg.sel_usr = plm & PFM_PLM3 ? 1 : 0;
286 reg.sel_os = plm & PFM_PLM0 ? 1 : 0;
287 reg.sel_en = 1; /* force enable bit to 1 */
288 reg.sel_int = 1; /* force APIC int to 1 */
289
290 reg.sel_cnt_mask = val >>24;
291 reg.sel_inv = val >> 23;
292 reg.sel_edge = val >> 18;
293
294 if (cntrs) {
295 if (!reg.sel_cnt_mask) {
296 /*
297 * counter mask is 8-bit wide, do not silently
298 * wrap-around
299 */
300 if (cntrs[i].cnt_mask > 255)
301 return PFMLIB_ERR_INVAL;
302 reg.sel_cnt_mask = cntrs[i].cnt_mask;
303 }
304
305 if (!reg.sel_edge)
306 reg.sel_edge = cntrs[i].flags & PFM_COREDUO_SEL_EDGE ? 1 : 0;
307 if (!reg.sel_inv)
308 reg.sel_inv = cntrs[i].flags & PFM_COREDUO_SEL_INV ? 1 : 0;
309 }
310
311 pc[npc].reg_num = assign_pc[i];
312 pc[npc].reg_value = reg.val;
313 pc[npc].reg_addr = COREDUO_SEL_BASE+assign_pc[i];
314 pc[npc].reg_alt_addr= COREDUO_SEL_BASE+assign_pc[i];
315
316 __pfm_vbprintf("[PERFEVTSEL%u(pmc%u)=0x%"PRIx64" event_sel=0x%x umask=0x%x os=%d usr=%d en=%d int=%d inv=%d edge=%d cnt_mask=%d] %s\n",
317 pc[npc].reg_num,
318 pc[npc].reg_num,
319 reg.val,
321 reg.sel_unit_mask,
322 reg.sel_os,
323 reg.sel_usr,
324 reg.sel_en,
325 reg.sel_int,
326 reg.sel_inv,
327 reg.sel_edge,
328 reg.sel_cnt_mask,
329 coreduo_pe[e[i].event].pme_name);
330
331 __pfm_vbprintf("[PMC%u(pmd%u)]\n",
332 pc[npc].reg_num,
333 pc[npc].reg_num);
334
335 npc++;
336 }
337 /*
338 * setup pmds: must be in the same order as the events
339 */
340 for (i=0; i < n ; i++) {
341 pd[i].reg_num = assign_pc[i];
342 pd[i].reg_addr = COREDUO_CTR_BASE+assign_pc[i];
343 /* index to use with RDPMC */
344 pd[i].reg_alt_addr = assign_pc[i];
345 }
346 outp->pfp_pmd_count = i;
347 outp->pfp_pmc_count = npc;
348
349 return PFMLIB_SUCCESS;
350}
int i
static pme_coreduo_entry_t coreduo_pe[]
#define PFM_PLM2
Definition: pfmlib.h:52
#define PFM_PLM3
Definition: pfmlib.h:53
#define PFMLIB_ERR_INVAL
Definition: pfmlib.h:285
#define PFMLIB_ERR_TOOMANY
Definition: pfmlib.h:295
#define PFM_PLM0
Definition: pfmlib.h:50
static int pfm_regmask_isset(pfmlib_regmask_t *h, unsigned int b)
Definition: pfmlib.h:313
#define PFMLIB_ERR_NOASSIGN
Definition: pfmlib.h:288
#define PFM_PLM1
Definition: pfmlib.h:51
#define PFMLIB_COREDUO_ALL_FLAGS
#define COREDUO_SEL_BASE
#define COREDUO_CTR_BASE
#define PFM_COREDUO_SEL_EDGE
#define PFM_COREDUO_SEL_INV
#define PMU_COREDUO_NUM_COUNTERS
#define PFMLIB_COREDUO_CSPEC
#define PFMLIB_COREDUO_PMC1
#define PFMLIB_COREDUO_PMC0
#define PFMLIB_COREDUO_MESI
void __pfm_vbprintf(const char *fmt,...)
Definition: pfmlib_priv.c:52
#define DPRINT(fmt, a...)
Definition: pfmlib_priv.h:90
unsigned long cnt_mask
pfm_coreduo_counter_t pfp_coreduo_counters[PMU_COREDUO_NUM_COUNTERS]
unsigned int num_masks
Definition: pfmlib.h:90
unsigned int plm
Definition: pfmlib.h:87
unsigned int unit_masks[PFMLIB_MAX_MASKS_PER_EVENT]
Definition: pfmlib.h:89
unsigned int event
Definition: pfmlib.h:86
unsigned int pfp_dfl_plm
Definition: pfmlib.h:110
pfmlib_regmask_t pfp_unavail_pmcs
Definition: pfmlib.h:114
pfmlib_event_t pfp_events[PFMLIB_MAX_PMCS]
Definition: pfmlib.h:113
unsigned int pfp_event_count
Definition: pfmlib.h:109
pfmlib_reg_t pfp_pmds[PFMLIB_MAX_PMDS]
Definition: pfmlib.h:130
pfmlib_reg_t pfp_pmcs[PFMLIB_MAX_PMCS]
Definition: pfmlib.h:129
unsigned int pfp_pmc_count
Definition: pfmlib.h:127
unsigned int pfp_pmd_count
Definition: pfmlib.h:128
unsigned long long reg_value
Definition: pfmlib.h:98
unsigned int reg_num
Definition: pfmlib.h:100
unsigned long reg_alt_addr
Definition: pfmlib.h:102
unsigned long long reg_addr
Definition: pfmlib.h:99
unsigned int pme_code
pme_coreduo_umask_t pme_umasks[PFMLIB_COREDUO_MAX_UMASK]
char * pme_name
unsigned long sel_usr
unsigned long sel_cnt_mask
unsigned long sel_en
unsigned long long val
unsigned long sel_int
unsigned long sel_os
unsigned long sel_event_select
unsigned long sel_edge
unsigned long sel_inv
unsigned long sel_unit_mask
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pfm_coreduo_dispatch_events()

static int pfm_coreduo_dispatch_events ( pfmlib_input_param_t inp,
void *  model_in,
pfmlib_output_param_t outp,
void *  model_out 
)
static

Definition at line 352 of file pfmlib_coreduo.c.

353{
355
356 if (inp->pfp_dfl_plm & (PFM_PLM1|PFM_PLM2)) {
357 DPRINT("invalid plm=%x\n", inp->pfp_dfl_plm);
358 return PFMLIB_ERR_INVAL;
359 }
360 return pfm_coreduo_dispatch_counters(inp, mod_in, outp);
361}
static int pfm_coreduo_dispatch_counters(pfmlib_input_param_t *inp, pfmlib_coreduo_input_param_t *param, pfmlib_output_param_t *outp)
Here is the call graph for this function:

◆ pfm_coreduo_get_cycle_event()

static int pfm_coreduo_get_cycle_event ( pfmlib_event_t e)
static

Definition at line 480 of file pfmlib_coreduo.c.

481{
483 return PFMLIB_SUCCESS;
484}
#define PME_COREDUO_UNHALTED_CORE_CYCLES

◆ pfm_coreduo_get_event_code()

static int pfm_coreduo_get_event_code ( unsigned int  i,
unsigned int  cnt,
int code 
)
static

Definition at line 364 of file pfmlib_coreduo.c.

365{
366 if (cnt != PFMLIB_CNT_FIRST
367 && (cnt > highest_counter ||
369 return PFMLIB_ERR_INVAL;
370
371 *code = coreduo_pe[i].pme_code;
372
373 return PFMLIB_SUCCESS;
374}
static pfmlib_regmask_t coreduo_impl_pmds
static int highest_counter
#define PFMLIB_CNT_FIRST
Definition: pfmlib_priv.h:62
Here is the call graph for this function:

◆ pfm_coreduo_get_event_counters()

static void pfm_coreduo_get_event_counters ( unsigned int  j,
pfmlib_regmask_t counters 
)
static

Definition at line 377 of file pfmlib_coreduo.c.

378{
379 memset(counters, 0, sizeof(*counters));
380
381 pfm_regmask_set(counters, 0);
382 pfm_regmask_set(counters, 1);
383
384 if (coreduo_pe[j].pme_flags & PFMLIB_COREDUO_PMC0)
385 pfm_regmask_clr(counters, 1);
386 if (coreduo_pe[j].pme_flags & PFMLIB_COREDUO_PMC1)
387 pfm_regmask_clr(counters, 0);
388}
static int pfm_regmask_set(pfmlib_regmask_t *h, unsigned int b)
Definition: pfmlib.h:321
static int pfm_regmask_clr(pfmlib_regmask_t *h, unsigned int b)
Definition: pfmlib.h:332
Here is the call graph for this function:

◆ pfm_coreduo_get_event_description()

static int pfm_coreduo_get_event_description ( unsigned int  ev,
char **  str 
)
static

Definition at line 434 of file pfmlib_coreduo.c.

435{
436 char *s;
437 s = coreduo_pe[ev].pme_desc;
438 if (s) {
439 *str = strdup(s);
440 } else {
441 *str = NULL;
442 }
443 return PFMLIB_SUCCESS;
444}
double s
Definition: byte_profile.c:36
char * pme_desc

◆ pfm_coreduo_get_event_mask_code()

static int pfm_coreduo_get_event_mask_code ( unsigned int  ev,
unsigned int  midx,
unsigned int code 
)
static

Definition at line 473 of file pfmlib_coreduo.c.

474{
475 *code = coreduo_pe[ev].pme_umasks[midx].pme_ucode;
476 return PFMLIB_SUCCESS;
477}

◆ pfm_coreduo_get_event_mask_desc()

static int pfm_coreduo_get_event_mask_desc ( unsigned int  ev,
unsigned int  midx,
char **  str 
)
static

Definition at line 453 of file pfmlib_coreduo.c.

454{
455 char *s;
456
457 s = coreduo_pe[ev].pme_umasks[midx].pme_udesc;
458 if (s) {
459 *str = strdup(s);
460 } else {
461 *str = NULL;
462 }
463 return PFMLIB_SUCCESS;
464}

◆ pfm_coreduo_get_event_mask_name()

static char * pfm_coreduo_get_event_mask_name ( unsigned int  ev,
unsigned int  midx 
)
static

Definition at line 447 of file pfmlib_coreduo.c.

448{
449 return coreduo_pe[ev].pme_umasks[midx].pme_uname;
450}

◆ pfm_coreduo_get_event_name()

static char * pfm_coreduo_get_event_name ( unsigned int  i)
static

Definition at line 428 of file pfmlib_coreduo.c.

429{
430 return coreduo_pe[i].pme_name;
431}

◆ pfm_coreduo_get_hw_counter_width()

static void pfm_coreduo_get_hw_counter_width ( unsigned int width)
static

Definition at line 416 of file pfmlib_coreduo.c.

417{
418 /*
419 * Even though, CPUID 0xa returns in eax the actual counter
420 * width, the architecture specifies that writes are limited
421 * to lower 32-bits. As such, only the lower 31 bits have full
422 * degree of freedom. That is the "useable" counter width.
423 */
424 *width = 32;
425}

◆ pfm_coreduo_get_impl_counters()

static void pfm_coreduo_get_impl_counters ( pfmlib_regmask_t impl_counters)
static

Definition at line 403 of file pfmlib_coreduo.c.

404{
405 /* all pmds are counters */
406 *impl_counters = coreduo_impl_pmds;
407}

◆ pfm_coreduo_get_impl_pmcs()

static void pfm_coreduo_get_impl_pmcs ( pfmlib_regmask_t impl_pmcs)
static

Definition at line 391 of file pfmlib_coreduo.c.

392{
393 *impl_pmcs = coreduo_impl_pmcs;
394}
static pfmlib_regmask_t coreduo_impl_pmcs

◆ pfm_coreduo_get_impl_pmds()

static void pfm_coreduo_get_impl_pmds ( pfmlib_regmask_t impl_pmds)
static

Definition at line 397 of file pfmlib_coreduo.c.

398{
399 *impl_pmds = coreduo_impl_pmds;
400}

◆ pfm_coreduo_get_inst_retired()

static int pfm_coreduo_get_inst_retired ( pfmlib_event_t e)
static

Definition at line 487 of file pfmlib_coreduo.c.

488{
490 return PFMLIB_SUCCESS;
491}
#define PME_COREDUO_INSTRUCTIONS_RETIRED

◆ pfm_coreduo_get_num_event_masks()

static unsigned int pfm_coreduo_get_num_event_masks ( unsigned int  ev)
static

Definition at line 467 of file pfmlib_coreduo.c.

468{
469 return coreduo_pe[ev].pme_numasks;
470}
unsigned int pme_numasks

◆ pfm_coreduo_init()

static int pfm_coreduo_init ( void  )
static

Definition at line 114 of file pfmlib_coreduo.c.

Here is the call graph for this function:

Variable Documentation

◆ coreduo_impl_pmcs

pfmlib_regmask_t coreduo_impl_pmcs
static

Definition at line 81 of file pfmlib_coreduo.c.

◆ coreduo_impl_pmds

pfmlib_regmask_t coreduo_impl_pmds
static

Definition at line 81 of file pfmlib_coreduo.c.

◆ coreduo_support

pfm_pmu_support_t coreduo_support
Initial value:
={
.pmu_name = "Intel Core Duo/Solo",
.pmu_type = PFMLIB_COREDUO_PMU,
.pmc_count = 2,
.pmd_count = 2,
.num_cnt = 2,
.get_event_code = pfm_coreduo_get_event_code,
.get_event_name = pfm_coreduo_get_event_name,
.get_event_counters = pfm_coreduo_get_event_counters,
.dispatch_events = pfm_coreduo_dispatch_events,
.pmu_detect = pfm_coreduo_detect,
.pmu_init = pfm_coreduo_init,
.get_impl_pmcs = pfm_coreduo_get_impl_pmcs,
.get_impl_pmds = pfm_coreduo_get_impl_pmds,
.get_impl_counters = pfm_coreduo_get_impl_counters,
.get_hw_counter_width = pfm_coreduo_get_hw_counter_width,
.get_num_event_masks = pfm_coreduo_get_num_event_masks,
.get_event_mask_name = pfm_coreduo_get_event_mask_name,
.get_event_mask_code = pfm_coreduo_get_event_mask_code,
.get_event_mask_desc = pfm_coreduo_get_event_mask_desc,
.get_cycle_event = pfm_coreduo_get_cycle_event,
.get_inst_retired_event = pfm_coreduo_get_inst_retired
}
#define PME_COREDUO_EVENT_COUNT
#define PFMLIB_COREDUO_PMU
Definition: pfmlib.h:231
static int pfm_coreduo_dispatch_events(pfmlib_input_param_t *inp, void *model_in, pfmlib_output_param_t *outp, void *model_out)
static int pfm_coreduo_get_event_mask_desc(unsigned int ev, unsigned int midx, char **str)
static void pfm_coreduo_get_impl_counters(pfmlib_regmask_t *impl_counters)
static int pfm_coreduo_detect(void)
static char * pfm_coreduo_get_event_name(unsigned int i)
static int pfm_coreduo_get_cycle_event(pfmlib_event_t *e)
static int pfm_coreduo_get_event_description(unsigned int ev, char **str)
static void pfm_coreduo_get_hw_counter_width(unsigned int *width)
static char * pfm_coreduo_get_event_mask_name(unsigned int ev, unsigned int midx)
static int pfm_coreduo_get_event_mask_code(unsigned int ev, unsigned int midx, unsigned int *code)
static void pfm_coreduo_get_impl_pmcs(pfmlib_regmask_t *impl_pmcs)
static int pfm_coreduo_get_event_code(unsigned int i, unsigned int cnt, int *code)
static void pfm_coreduo_get_impl_pmds(pfmlib_regmask_t *impl_pmds)
static void pfm_coreduo_get_event_counters(unsigned int j, pfmlib_regmask_t *counters)
static unsigned int pfm_coreduo_get_num_event_masks(unsigned int ev)
static int pfm_coreduo_get_inst_retired(pfmlib_event_t *e)
static int pfm_coreduo_init(void)

Definition at line 493 of file pfmlib_coreduo.c.

◆ highest_counter

int highest_counter
static

Definition at line 82 of file pfmlib_coreduo.c.