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

Go to the source code of this file.

Macros

#define sel_event_mask   perfsel.sel_event_mask
 
#define sel_unit_mask   perfsel.sel_unit_mask
 
#define sel_usr   perfsel.sel_usr
 
#define sel_os   perfsel.sel_os
 
#define sel_edge   perfsel.sel_edge
 
#define sel_pc   perfsel.sel_pc
 
#define sel_int   perfsel.sel_int
 
#define sel_en   perfsel.sel_en
 
#define sel_inv   perfsel.sel_inv
 
#define sel_cnt_mask   perfsel.sel_cnt_mask
 
#define PFMLIB_I386_P6_HAS_COMBO(_e)   ((i386_pe[_e].pme_flags & PFMLIB_I386_P6_UMASK_COMBO) != 0)
 
#define PFMLIB_I386_P6_ALL_FLAGS    (PFM_I386_P6_SEL_INV|PFM_I386_P6_SEL_EDGE)
 
#define I386_P6_SEL_BASE   0x186
 
#define I386_P6_CTR_BASE   0xc1
 

Functions

static char * pfm_i386_p6_get_event_name (unsigned int i)
 
static void pfm_i386_p6_get_impl_counters (pfmlib_regmask_t *impl_counters)
 
static int pfm_i386_detect_common (void)
 
static int pfm_i386_p6_detect_ppro (void)
 
static int pfm_i386_p6_init_ppro (void)
 
static int pfm_i386_p6_detect_pii (void)
 
static int pfm_i386_p6_init_pii (void)
 
static int pfm_i386_p6_detect_piii (void)
 
static int pfm_i386_p6_init_piii (void)
 
static int pfm_i386_p6_detect_pm (void)
 
static int pfm_i386_p6_init_pm (void)
 
static int pfm_i386_p6_dispatch_counters (pfmlib_input_param_t *inp, pfmlib_i386_p6_input_param_t *mod_in, pfmlib_output_param_t *outp)
 
static int pfm_i386_p6_dispatch_events (pfmlib_input_param_t *inp, void *model_in, pfmlib_output_param_t *outp, void *model_out)
 
static int pfm_i386_p6_get_event_code (unsigned int i, unsigned int cnt, int *code)
 
static void pfm_i386_p6_get_event_counters (unsigned int j, pfmlib_regmask_t *counters)
 
static void pfm_i386_p6_get_impl_perfsel (pfmlib_regmask_t *impl_pmcs)
 
static void pfm_i386_p6_get_impl_perfctr (pfmlib_regmask_t *impl_pmds)
 
static void pfm_i386_p6_get_hw_counter_width (unsigned int *width)
 
static int pfm_i386_p6_get_event_description (unsigned int ev, char **str)
 
static char * pfm_i386_p6_get_event_mask_name (unsigned int ev, unsigned int midx)
 
static int pfm_i386_p6_get_event_mask_desc (unsigned int ev, unsigned int midx, char **str)
 
static unsigned int pfm_i386_p6_get_num_event_masks (unsigned int ev)
 
static int pfm_i386_p6_get_event_mask_code (unsigned int ev, unsigned int midx, unsigned int *code)
 
static int pfm_i386_p6_get_cycle_event (pfmlib_event_t *e)
 
static int pfm_i386_p6_get_inst_retired (pfmlib_event_t *e)
 

Variables

static pme_i386_p6_entry_ti386_pe
 
static int i386_p6_cycle_event
 
static int i386_p6_inst_retired_event
 
pfm_pmu_support_t i386_pii_support
 
pfm_pmu_support_t i386_p6_support
 
pfm_pmu_support_t i386_ppro_support
 
pfm_pmu_support_t i386_pm_support
 

Macro Definition Documentation

◆ I386_P6_CTR_BASE

#define I386_P6_CTR_BASE   0xc1

Definition at line 69 of file pfmlib_i386_p6.c.

◆ I386_P6_SEL_BASE

#define I386_P6_SEL_BASE   0x186

Definition at line 68 of file pfmlib_i386_p6.c.

◆ PFMLIB_I386_P6_ALL_FLAGS

#define PFMLIB_I386_P6_ALL_FLAGS    (PFM_I386_P6_SEL_INV|PFM_I386_P6_SEL_EDGE)

Definition at line 56 of file pfmlib_i386_p6.c.

◆ PFMLIB_I386_P6_HAS_COMBO

#define PFMLIB_I386_P6_HAS_COMBO (   _e)    ((i386_pe[_e].pme_flags & PFMLIB_I386_P6_UMASK_COMBO) != 0)

Definition at line 54 of file pfmlib_i386_p6.c.

◆ sel_cnt_mask

#define sel_cnt_mask   perfsel.sel_cnt_mask

Definition at line 48 of file pfmlib_i386_p6.c.

◆ sel_edge

#define sel_edge   perfsel.sel_edge

Definition at line 43 of file pfmlib_i386_p6.c.

◆ sel_en

#define sel_en   perfsel.sel_en

Definition at line 46 of file pfmlib_i386_p6.c.

◆ sel_event_mask

#define sel_event_mask   perfsel.sel_event_mask

Definition at line 39 of file pfmlib_i386_p6.c.

◆ sel_int

#define sel_int   perfsel.sel_int

Definition at line 45 of file pfmlib_i386_p6.c.

◆ sel_inv

#define sel_inv   perfsel.sel_inv

Definition at line 47 of file pfmlib_i386_p6.c.

◆ sel_os

#define sel_os   perfsel.sel_os

Definition at line 42 of file pfmlib_i386_p6.c.

◆ sel_pc

#define sel_pc   perfsel.sel_pc

Definition at line 44 of file pfmlib_i386_p6.c.

◆ sel_unit_mask

#define sel_unit_mask   perfsel.sel_unit_mask

Definition at line 40 of file pfmlib_i386_p6.c.

◆ sel_usr

#define sel_usr   perfsel.sel_usr

Definition at line 41 of file pfmlib_i386_p6.c.

Function Documentation

◆ pfm_i386_detect_common()

static int pfm_i386_detect_common ( void  )
static

Definition at line 74 of file pfmlib_i386_p6.c.

75{
76 int ret, family;
77 char buffer[128];
78
79 ret = __pfm_getcpuinfo_attr("vendor_id", buffer, sizeof(buffer));
80 if (ret == -1)
81 return PFMLIB_ERR_NOTSUPP;
82
83 if (strcmp(buffer, "GenuineIntel"))
84 return PFMLIB_ERR_NOTSUPP;
85
86 ret = __pfm_getcpuinfo_attr("cpu family", buffer, sizeof(buffer));
87 if (ret == -1)
88 return PFMLIB_ERR_NOTSUPP;
89
90 family = atoi(buffer);
91
93}
#define PFMLIB_SUCCESS
Definition: pfmlib.h:283
#define PFMLIB_ERR_NOTSUPP
Definition: pfmlib.h:284
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:
Here is the caller graph for this function:

◆ pfm_i386_p6_detect_pii()

static int pfm_i386_p6_detect_pii ( void  )
static

Definition at line 133 of file pfmlib_i386_p6.c.

134{
135 int ret, model;
136 char buffer[128];
137
139 if (ret != PFMLIB_SUCCESS)
140 return ret;
141
142 ret = __pfm_getcpuinfo_attr("model", buffer, sizeof(buffer));
143 if (ret == -1)
144 return PFMLIB_ERR_NOTSUPP;
145
146 model = atoi(buffer);
147 switch(model) {
148 case 3: /* Pentium II */
149 case 5: /* Pentium II Deschutes */
150 case 6: /* Pentium II Mendocino */
151 break;
152 default:
153 return PFMLIB_ERR_NOTSUPP;
154 }
155 return PFMLIB_SUCCESS;
156}
int model
Definition: pfmlib_amd64.c:86
static int pfm_i386_detect_common(void)
Here is the call graph for this function:

◆ pfm_i386_p6_detect_piii()

static int pfm_i386_p6_detect_piii ( void  )
static

Definition at line 172 of file pfmlib_i386_p6.c.

173{
174 int ret, model;
175 char buffer[128];
176
178 if (ret != PFMLIB_SUCCESS)
179 return ret;
180
181 ret = __pfm_getcpuinfo_attr("model", buffer, sizeof(buffer));
182 if (ret == -1)
183 return PFMLIB_ERR_NOTSUPP;
184
185 model = atoi(buffer);
186
187 switch(model) {
188 case 7: /* Pentium III Katmai */
189 case 8: /* Pentium III Coppermine */
190 case 10:/* Pentium III Cascades */
191 case 11:/* Pentium III Tualatin */
192 break;
193 default:
194 return PFMLIB_ERR_NOTSUPP;
195 }
196 return PFMLIB_SUCCESS;
197}
Here is the call graph for this function:

◆ pfm_i386_p6_detect_pm()

static int pfm_i386_p6_detect_pm ( void  )
static

Definition at line 213 of file pfmlib_i386_p6.c.

214{
215 int ret, model;
216 char buffer[128];
217
219 if (ret != PFMLIB_SUCCESS)
220 return ret;
221
222 ret = __pfm_getcpuinfo_attr("model", buffer, sizeof(buffer));
223 if (ret == -1)
224 return PFMLIB_ERR_NOTSUPP;
225
226 model = atoi(buffer);
227 switch (model) {
228 case 9:
229 case 13:
230 break;
231 default:
232 return PFMLIB_ERR_NOTSUPP;
233 }
234
235 return PFMLIB_SUCCESS;
236}
Here is the call graph for this function:

◆ pfm_i386_p6_detect_ppro()

static int pfm_i386_p6_detect_ppro ( void  )
static

Definition at line 98 of file pfmlib_i386_p6.c.

99{
100 int ret, model;
101 char buffer[128];
102
104 if (ret != PFMLIB_SUCCESS)
105 return ret;
106
107 ret = __pfm_getcpuinfo_attr("model", buffer, sizeof(buffer));
108 if (ret == -1)
109 return PFMLIB_ERR_NOTSUPP;
110
111 model = atoi(buffer);
112
113 if (model != 1)
114 return PFMLIB_ERR_NOTSUPP;
115
116 return PFMLIB_SUCCESS;
117}
Here is the call graph for this function:

◆ pfm_i386_p6_dispatch_counters()

static int pfm_i386_p6_dispatch_counters ( pfmlib_input_param_t inp,
pfmlib_i386_p6_input_param_t mod_in,
pfmlib_output_param_t outp 
)
static

Definition at line 253 of file pfmlib_i386_p6.c.

254{
255 pfmlib_i386_p6_input_param_t *param = mod_in;
259 pfmlib_reg_t *pc, *pd;
260 pfmlib_regmask_t impl_cntrs, avail_cntrs;
261 unsigned long plm;
262 unsigned int i, j, cnt, k, umask;
263 unsigned int assign[PMU_I386_P6_NUM_COUNTERS];
264
265 e = inp->pfp_events;
266 pc = outp->pfp_pmcs;
267 pd = outp->pfp_pmds;
268 cnt = inp->pfp_event_count;
269 cntrs = param ? param->pfp_i386_p6_counters : NULL;
270
271 if (PFMLIB_DEBUG()) {
272 for (j=0; j < cnt; j++) {
273 DPRINT("ev[%d]=%s\n", j, i386_pe[e[j].event].pme_name);
274 }
275 }
276
277 if (cnt > PMU_I386_P6_NUM_COUNTERS)
278 return PFMLIB_ERR_TOOMANY;
279
281 pfm_regmask_andnot(&avail_cntrs, &impl_cntrs, &inp->pfp_unavail_pmcs);
282
283 DPRINT("impl=0x%lx avail=0x%lx unavail=0x%lx\n", impl_cntrs.bits[0], avail_cntrs.bits[0], inp->pfp_unavail_pmcs.bits[0]);
284
285 for(j=0; j < cnt; j++) {
286 /*
287 * P6 only supports two priv levels for perf counters
288 */
289 if (e[j].plm & (PFM_PLM1|PFM_PLM2)) {
290 DPRINT("event=%d invalid plm=%d\n", e[j].event, e[j].plm);
291 return PFMLIB_ERR_INVAL;
292 }
293
294 if (cntrs && cntrs[j].flags & ~PFMLIB_I386_P6_ALL_FLAGS) {
295 DPRINT("event=%d invalid flags=0x%lx\n", e[j].event, e[j].flags);
296 return PFMLIB_ERR_INVAL;
297 }
298
299 /*
300 * check illegal unit masks combination
301 */
302 if (e[j].num_masks > 1 && PFMLIB_I386_P6_HAS_COMBO(e[j].event) == 0) {
303 DPRINT("event does not support unit mask combination\n");
304 return PFMLIB_ERR_FEATCOMB;
305 }
306 }
307 /*
308 * first pass: events for fixed counters
309 */
310 for(j=0; j < cnt; j++) {
311 if (i386_pe[e[j].event].pme_flags & PFMLIB_I386_P6_CTR0_ONLY) {
312 if (!pfm_regmask_isset(&avail_cntrs, 0))
313 return PFMLIB_ERR_NOASSIGN;
314 assign[j] = 0;
315 pfm_regmask_clr(&avail_cntrs, 0);
316 } else if (i386_pe[e[j].event].pme_flags & PFMLIB_I386_P6_CTR1_ONLY) {
317 if (!pfm_regmask_isset(&avail_cntrs, 1))
318 return PFMLIB_ERR_NOASSIGN;
319 assign[j] = 1;
320 pfm_regmask_clr(&avail_cntrs, 1);
321 }
322 }
323 /*
324 * second pass: events with no constraints
325 */
326 for (j=0, i=0; j < cnt ; j++ ) {
327 if (i386_pe[e[j].event].pme_flags & (PFMLIB_I386_P6_CTR0_ONLY|PFMLIB_I386_P6_CTR1_ONLY))
328 continue;
329
330 while (i < PMU_I386_P6_NUM_COUNTERS && !pfm_regmask_isset(&avail_cntrs, i))
331 i++;
333 return PFMLIB_ERR_NOASSIGN;
334 pfm_regmask_clr(&avail_cntrs, i);
335 assign[j] = i++;
336 }
337 /*
338 * final pass: assign value to registers
339 */
340 for (j=0; j < cnt ; j++) {
341 reg.val = 0; /* assume reserved bits are zeroed */
342
343 /* if plm is 0, then assume not specified per-event and use default */
344 plm = e[j].plm ? e[j].plm : inp->pfp_dfl_plm;
345
347 /*
348 * some events have only a single umask. We do not create
349 * specific umask entry in this case. The umask code is taken
350 * out of the (extended) event code (2nd byte)
351 */
352 umask = (i386_pe[e[j].event].pme_code >> 8) & 0xff;
353
354 for(k=0; k < e[j].num_masks; k++) {
355 umask |= i386_pe[e[j].event].pme_umasks[e[j].unit_masks[k]].pme_ucode;
356 }
357 reg.sel_unit_mask = umask;
358 reg.sel_usr = plm & PFM_PLM3 ? 1 : 0;
359 reg.sel_os = plm & PFM_PLM0 ? 1 : 0;
360 reg.sel_int = 1; /* force APIC int to 1 */
361 /*
362 * only perfevtsel0 has an enable bit (allows atomic start/stop)
363 */
364 if (assign[j] == 0)
365 reg.sel_en = 1; /* force enable bit to 1 */
366
367 if (cntrs) {
368 reg.sel_cnt_mask = cntrs[j].cnt_mask;
369 reg.sel_edge = cntrs[j].flags & PFM_I386_P6_SEL_EDGE ? 1 : 0;
370 reg.sel_inv = cntrs[j].flags & PFM_I386_P6_SEL_INV ? 1 : 0;
371 }
372
373 pc[j].reg_num = assign[j];
374 pc[j].reg_value = reg.val;
375 pc[j].reg_addr = I386_P6_SEL_BASE+assign[j];
376 pc[j].reg_alt_addr= I386_P6_SEL_BASE+assign[j];
377
378
379 pd[j].reg_num = assign[j];
380 pd[j].reg_addr = I386_P6_CTR_BASE+assign[j];
381 /* index to use with RDPMC */
382 pd[j].reg_alt_addr = assign[j];
383
384 __pfm_vbprintf("[PERFEVTSEL%u(pmc%u)=0x%lx emask=0x%x umask=0x%x os=%d usr=%d en=%d int=%d inv=%d edge=%d cnt_mask=%d] %s\n",
385 assign[j],
386 assign[j],
387 reg.val,
388 reg.sel_event_mask,
389 reg.sel_unit_mask,
390 reg.sel_os,
391 reg.sel_usr,
392 reg.sel_en,
393 reg.sel_int,
394 reg.sel_inv,
395 reg.sel_edge,
396 reg.sel_cnt_mask,
397 i386_pe[e[j].event].pme_name);
398
399 __pfm_vbprintf("[PMC%u(pmd%u)]\n", pd[j].reg_num, pd[j].reg_num);
400 }
401 /*
402 * add perfsel0 if not used. This is required as it holds
403 * the enable bit for all counters
404 */
405 if (pfm_regmask_isset(&avail_cntrs, 0)) {
406 reg.val = 0;
407 reg.sel_en = 1; /* force enable bit to 1 */
408 pc[j].reg_num = 0;
409 pc[j].reg_value = reg.val;
412 j++;
413
414 __pfm_vbprintf("[PERFEVTSEL0(pmc0)=0x%lx] required for enabling counters\n", reg.val);
415 }
416 /* number of evtsel registers programmed */
417 outp->pfp_pmc_count = j;
418 outp->pfp_pmd_count = cnt;
419
420 return PFMLIB_SUCCESS;
421}
int i
#define PFMLIB_ERR_FEATCOMB
Definition: pfmlib.h:292
#define PFM_PLM2
Definition: pfmlib.h:52
#define PFM_PLM3
Definition: pfmlib.h:53
#define PFMLIB_ERR_INVAL
Definition: pfmlib.h:285
static int pfm_regmask_clr(pfmlib_regmask_t *h, unsigned int b)
Definition: pfmlib.h:332
static int pfm_regmask_andnot(pfmlib_regmask_t *dst, pfmlib_regmask_t *h1, pfmlib_regmask_t *h2)
Definition: pfmlib.h:386
#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_I386_P6_ALL_FLAGS
static void pfm_i386_p6_get_impl_counters(pfmlib_regmask_t *impl_counters)
#define PFMLIB_I386_P6_HAS_COMBO(_e)
#define I386_P6_CTR_BASE
static pme_i386_p6_entry_t * i386_pe
#define I386_P6_SEL_BASE
#define PFM_I386_P6_SEL_INV
#define PMU_I386_P6_NUM_COUNTERS
#define PFM_I386_P6_SEL_EDGE
#define PFMLIB_I386_P6_CTR0_ONLY
#define PFMLIB_I386_P6_CTR1_ONLY
void __pfm_vbprintf(const char *fmt,...)
Definition: pfmlib_priv.c:52
#define DPRINT(fmt, a...)
Definition: pfmlib_priv.h:90
#define PFMLIB_DEBUG()
Definition: pfmlib_priv.h:76
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
pfm_i386_p6_cnt_mask_t cnt_mask
pfmlib_i386_p6_counter_t pfp_i386_p6_counters[PMU_I386_P6_NUM_COUNTERS]
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
pfmlib_regmask_bits_t bits[PFMLIB_REG_BV]
Definition: pfmlib.h:76
unsigned int pme_code
char * pme_name
pme_i386_p6_umask_t pme_umasks[PFMLIB_I386_P6_MAX_UMASK]
unsigned long sel_en
unsigned long sel_int
unsigned long sel_os
unsigned long sel_unit_mask
unsigned long sel_usr
unsigned long sel_cnt_mask
unsigned long sel_event_mask
unsigned long sel_edge
unsigned long sel_inv
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pfm_i386_p6_dispatch_events()

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

Definition at line 424 of file pfmlib_i386_p6.c.

425{
427
428 if (inp->pfp_dfl_plm & (PFM_PLM1|PFM_PLM2)) {
429 DPRINT("invalid plm=%x\n", inp->pfp_dfl_plm);
430 return PFMLIB_ERR_INVAL;
431 }
432 return pfm_i386_p6_dispatch_counters(inp, mod_in, outp);
433}
static int pfm_i386_p6_dispatch_counters(pfmlib_input_param_t *inp, pfmlib_i386_p6_input_param_t *mod_in, pfmlib_output_param_t *outp)
Here is the call graph for this function:

◆ pfm_i386_p6_get_cycle_event()

static int pfm_i386_p6_get_cycle_event ( pfmlib_event_t e)
static

Definition at line 552 of file pfmlib_i386_p6.c.

553{
555 return PFMLIB_SUCCESS;
556
557}
static int i386_p6_cycle_event

◆ pfm_i386_p6_get_event_code()

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

Definition at line 436 of file pfmlib_i386_p6.c.

437{
438 if (cnt != PFMLIB_CNT_FIRST && cnt > 2)
439 return PFMLIB_ERR_INVAL;
440
441 *code = i386_pe[i].pme_code;
442
443 return PFMLIB_SUCCESS;
444}
#define PFMLIB_CNT_FIRST
Definition: pfmlib_priv.h:62

◆ pfm_i386_p6_get_event_counters()

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

Definition at line 447 of file pfmlib_i386_p6.c.

448{
449 unsigned int i;
450
451 memset(counters, 0, sizeof(*counters));
452
453 if (i386_pe[j].pme_flags & PFMLIB_I386_P6_CTR0_ONLY) {
454 pfm_regmask_set(counters, 0);
455 } else if (i386_pe[j].pme_flags & PFMLIB_I386_P6_CTR1_ONLY) {
456 pfm_regmask_set(counters, 1);
457 } else {
458 for(i=0; i < PMU_I386_P6_NUM_COUNTERS; i++)
459 pfm_regmask_set(counters, i);
460 }
461}
static int pfm_regmask_set(pfmlib_regmask_t *h, unsigned int b)
Definition: pfmlib.h:321
Here is the call graph for this function:

◆ pfm_i386_p6_get_event_description()

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

Definition at line 506 of file pfmlib_i386_p6.c.

507{
508 char *s;
509 s = i386_pe[ev].pme_desc;
510 if (s) {
511 *str = strdup(s);
512 } else {
513 *str = NULL;
514 }
515 return PFMLIB_SUCCESS;
516}
double s
Definition: byte_profile.c:36
char * pme_desc

◆ pfm_i386_p6_get_event_mask_code()

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

Definition at line 545 of file pfmlib_i386_p6.c.

546{
547 *code = i386_pe[ev].pme_umasks[midx].pme_ucode;
548 return PFMLIB_SUCCESS;
549}

◆ pfm_i386_p6_get_event_mask_desc()

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

Definition at line 525 of file pfmlib_i386_p6.c.

526{
527 char *s;
528
529 s = i386_pe[ev].pme_umasks[midx].pme_udesc;
530 if (s) {
531 *str = strdup(s);
532 } else {
533 *str = NULL;
534 }
535 return PFMLIB_SUCCESS;
536}

◆ pfm_i386_p6_get_event_mask_name()

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

Definition at line 519 of file pfmlib_i386_p6.c.

520{
521 return i386_pe[ev].pme_umasks[midx].pme_uname;
522}

◆ pfm_i386_p6_get_event_name()

static char * pfm_i386_p6_get_event_name ( unsigned int  i)
static

Definition at line 500 of file pfmlib_i386_p6.c.

501{
502 return i386_pe[i].pme_name;
503}

◆ pfm_i386_p6_get_hw_counter_width()

static void pfm_i386_p6_get_hw_counter_width ( unsigned int width)
static

Definition at line 494 of file pfmlib_i386_p6.c.

495{
497}
#define PMU_I386_P6_COUNTER_WIDTH

◆ pfm_i386_p6_get_impl_counters()

static void pfm_i386_p6_get_impl_counters ( pfmlib_regmask_t impl_counters)
static

Definition at line 484 of file pfmlib_i386_p6.c.

485{
486 unsigned int i = 0;
487
488 /* counting pmds are contiguous */
489 for(i=0; i < PMU_I386_P6_NUM_COUNTERS; i++)
490 pfm_regmask_set(impl_counters, i);
491}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pfm_i386_p6_get_impl_perfctr()

static void pfm_i386_p6_get_impl_perfctr ( pfmlib_regmask_t impl_pmds)
static

Definition at line 474 of file pfmlib_i386_p6.c.

475{
476 unsigned int i = 0;
477
478 /* all pmds are contiguous */
479 for(i=0; i < PMU_I386_P6_NUM_PERFCTR; i++)
480 pfm_regmask_set(impl_pmds, i);
481}
#define PMU_I386_P6_NUM_PERFCTR
Here is the call graph for this function:

◆ pfm_i386_p6_get_impl_perfsel()

static void pfm_i386_p6_get_impl_perfsel ( pfmlib_regmask_t impl_pmcs)
static

Definition at line 464 of file pfmlib_i386_p6.c.

465{
466 unsigned int i = 0;
467
468 /* all pmcs are contiguous */
469 for(i=0; i < PMU_I386_P6_NUM_PERFSEL; i++)
470 pfm_regmask_set(impl_pmcs, i);
471}
#define PMU_I386_P6_NUM_PERFSEL
Here is the call graph for this function:

◆ pfm_i386_p6_get_inst_retired()

static int pfm_i386_p6_get_inst_retired ( pfmlib_event_t e)
static

Definition at line 560 of file pfmlib_i386_p6.c.

561{
563 return PFMLIB_SUCCESS;
564}
static int i386_p6_inst_retired_event

◆ pfm_i386_p6_get_num_event_masks()

static unsigned int pfm_i386_p6_get_num_event_masks ( unsigned int  ev)
static

Definition at line 539 of file pfmlib_i386_p6.c.

540{
541 return i386_pe[ev].pme_numasks;
542}
unsigned int pme_numasks

◆ pfm_i386_p6_init_pii()

static int pfm_i386_p6_init_pii ( void  )
static

Definition at line 159 of file pfmlib_i386_p6.c.

160{
161
165 return PFMLIB_SUCCESS;
166}
#define PME_I386_PII_INST_RETIRED
static pme_i386_p6_entry_t i386_pII_pe[]
#define PME_I386_PII_CPU_CLK_UNHALTED

◆ pfm_i386_p6_init_piii()

static int pfm_i386_p6_init_piii ( void  )
static

Definition at line 200 of file pfmlib_i386_p6.c.

201{
205
206 return PFMLIB_SUCCESS;
207}
#define PME_I386_PIII_CPU_CLK_UNHALTED
static pme_i386_p6_entry_t i386_pIII_pe[]
#define PME_I386_PIII_INST_RETIRED

◆ pfm_i386_p6_init_pm()

static int pfm_i386_p6_init_pm ( void  )
static

Definition at line 239 of file pfmlib_i386_p6.c.

240{
244
245 return PFMLIB_SUCCESS;
246}
#define PME_I386_PM_CPU_CLK_UNHALTED
#define PME_I386_PM_INST_RETIRED
static pme_i386_p6_entry_t i386_pm_pe[]

◆ pfm_i386_p6_init_ppro()

static int pfm_i386_p6_init_ppro ( void  )
static

Definition at line 120 of file pfmlib_i386_p6.c.

121{
125
126 return PFMLIB_SUCCESS;
127}
static pme_i386_p6_entry_t i386_ppro_pe[]
#define PME_I386_PPRO_CPU_CLK_UNHALTED
#define PME_I386_PPRO_INST_RETIRED

Variable Documentation

◆ i386_p6_cycle_event

int i386_p6_cycle_event
static

Definition at line 52 of file pfmlib_i386_p6.c.

◆ i386_p6_inst_retired_event

int i386_p6_inst_retired_event
static

Definition at line 52 of file pfmlib_i386_p6.c.

◆ i386_p6_support

pfm_pmu_support_t i386_p6_support
Initial value:
={
.pmu_name = "Intel P6 Processor Family",
.pmu_type = PFMLIB_I386_P6_PMU,
.get_event_code = pfm_i386_p6_get_event_code,
.get_event_name = pfm_i386_p6_get_event_name,
.get_event_counters = pfm_i386_p6_get_event_counters,
.dispatch_events = pfm_i386_p6_dispatch_events,
.pmu_detect = pfm_i386_p6_detect_piii,
.pmu_init = pfm_i386_p6_init_piii,
.get_impl_pmcs = pfm_i386_p6_get_impl_perfsel,
.get_impl_pmds = pfm_i386_p6_get_impl_perfctr,
.get_impl_counters = pfm_i386_p6_get_impl_counters,
.get_hw_counter_width = pfm_i386_p6_get_hw_counter_width,
.get_num_event_masks = pfm_i386_p6_get_num_event_masks,
.get_event_mask_name = pfm_i386_p6_get_event_mask_name,
.get_event_mask_code = pfm_i386_p6_get_event_mask_code,
.get_event_mask_desc = pfm_i386_p6_get_event_mask_desc,
.get_cycle_event = pfm_i386_p6_get_cycle_event,
.get_inst_retired_event = pfm_i386_p6_get_inst_retired
}
#define PME_I386_PIII_EVENT_COUNT
#define PFMLIB_I386_P6_PMU
Definition: pfmlib.h:229
static int pfm_i386_p6_get_event_description(unsigned int ev, char **str)
static void pfm_i386_p6_get_impl_perfctr(pfmlib_regmask_t *impl_pmds)
static int pfm_i386_p6_get_event_code(unsigned int i, unsigned int cnt, int *code)
static void pfm_i386_p6_get_impl_perfsel(pfmlib_regmask_t *impl_pmcs)
static char * pfm_i386_p6_get_event_mask_name(unsigned int ev, unsigned int midx)
static void pfm_i386_p6_get_event_counters(unsigned int j, pfmlib_regmask_t *counters)
static int pfm_i386_p6_get_inst_retired(pfmlib_event_t *e)
static void pfm_i386_p6_get_hw_counter_width(unsigned int *width)
static unsigned int pfm_i386_p6_get_num_event_masks(unsigned int ev)
static int pfm_i386_p6_dispatch_events(pfmlib_input_param_t *inp, void *model_in, pfmlib_output_param_t *outp, void *model_out)
static char * pfm_i386_p6_get_event_name(unsigned int i)
static int pfm_i386_p6_init_piii(void)
static int pfm_i386_p6_get_event_mask_desc(unsigned int ev, unsigned int midx, char **str)
static int pfm_i386_p6_detect_piii(void)
static int pfm_i386_p6_get_cycle_event(pfmlib_event_t *e)
static int pfm_i386_p6_get_event_mask_code(unsigned int ev, unsigned int midx, unsigned int *code)

Definition at line 593 of file pfmlib_i386_p6.c.

◆ i386_pe

pme_i386_p6_entry_t* i386_pe
static

Definition at line 51 of file pfmlib_i386_p6.c.

◆ i386_pii_support

pfm_pmu_support_t i386_pii_support
Initial value:
={
.pmu_name = "Intel Pentium II",
.pmu_type = PFMLIB_INTEL_PII_PMU,
.get_event_code = pfm_i386_p6_get_event_code,
.get_event_name = pfm_i386_p6_get_event_name,
.get_event_counters = pfm_i386_p6_get_event_counters,
.dispatch_events = pfm_i386_p6_dispatch_events,
.pmu_detect = pfm_i386_p6_detect_pii,
.pmu_init = pfm_i386_p6_init_pii,
.get_impl_pmcs = pfm_i386_p6_get_impl_perfsel,
.get_impl_pmds = pfm_i386_p6_get_impl_perfctr,
.get_impl_counters = pfm_i386_p6_get_impl_counters,
.get_hw_counter_width = pfm_i386_p6_get_hw_counter_width,
.get_num_event_masks = pfm_i386_p6_get_num_event_masks,
.get_event_mask_name = pfm_i386_p6_get_event_mask_name,
.get_event_mask_code = pfm_i386_p6_get_event_mask_code,
.get_event_mask_desc = pfm_i386_p6_get_event_mask_desc,
.get_cycle_event = pfm_i386_p6_get_cycle_event,
.get_inst_retired_event = pfm_i386_p6_get_inst_retired
}
#define PME_I386_PII_EVENT_COUNT
#define PFMLIB_INTEL_PII_PMU
Definition: pfmlib.h:236
static int pfm_i386_p6_init_pii(void)
static int pfm_i386_p6_detect_pii(void)

Definition at line 566 of file pfmlib_i386_p6.c.

◆ i386_pm_support

pfm_pmu_support_t i386_pm_support
Initial value:
={
.pmu_name = "Intel Pentium M",
.pmu_type = PFMLIB_I386_PM_PMU,
.get_event_code = pfm_i386_p6_get_event_code,
.get_event_name = pfm_i386_p6_get_event_name,
.get_event_counters = pfm_i386_p6_get_event_counters,
.dispatch_events = pfm_i386_p6_dispatch_events,
.pmu_detect = pfm_i386_p6_detect_pm,
.pmu_init = pfm_i386_p6_init_pm,
.get_impl_pmcs = pfm_i386_p6_get_impl_perfsel,
.get_impl_pmds = pfm_i386_p6_get_impl_perfctr,
.get_impl_counters = pfm_i386_p6_get_impl_counters,
.get_hw_counter_width = pfm_i386_p6_get_hw_counter_width,
.get_num_event_masks = pfm_i386_p6_get_num_event_masks,
.get_event_mask_name = pfm_i386_p6_get_event_mask_name,
.get_event_mask_code = pfm_i386_p6_get_event_mask_code,
.get_event_mask_desc = pfm_i386_p6_get_event_mask_desc,
.get_cycle_event = pfm_i386_p6_get_cycle_event,
.get_inst_retired_event = pfm_i386_p6_get_inst_retired
}
#define PME_I386_PM_EVENT_COUNT
#define PFMLIB_I386_PM_PMU
Definition: pfmlib.h:232
static int pfm_i386_p6_detect_pm(void)
static int pfm_i386_p6_init_pm(void)

Definition at line 647 of file pfmlib_i386_p6.c.

◆ i386_ppro_support

pfm_pmu_support_t i386_ppro_support
Initial value:
={
.pmu_name = "Intel Pentium Pro",
.pmu_type = PFMLIB_INTEL_PPRO_PMU,
.get_event_code = pfm_i386_p6_get_event_code,
.get_event_name = pfm_i386_p6_get_event_name,
.get_event_counters = pfm_i386_p6_get_event_counters,
.dispatch_events = pfm_i386_p6_dispatch_events,
.pmu_detect = pfm_i386_p6_detect_ppro,
.pmu_init = pfm_i386_p6_init_ppro,
.get_impl_pmcs = pfm_i386_p6_get_impl_perfsel,
.get_impl_pmds = pfm_i386_p6_get_impl_perfctr,
.get_impl_counters = pfm_i386_p6_get_impl_counters,
.get_hw_counter_width = pfm_i386_p6_get_hw_counter_width,
.get_num_event_masks = pfm_i386_p6_get_num_event_masks,
.get_event_mask_name = pfm_i386_p6_get_event_mask_name,
.get_event_mask_code = pfm_i386_p6_get_event_mask_code,
.get_event_mask_desc = pfm_i386_p6_get_event_mask_desc,
.get_cycle_event = pfm_i386_p6_get_cycle_event,
.get_inst_retired_event = pfm_i386_p6_get_inst_retired
}
#define PME_I386_PPRO_EVENT_COUNT
#define PFMLIB_INTEL_PPRO_PMU
Definition: pfmlib.h:235
static int pfm_i386_p6_detect_ppro(void)
static int pfm_i386_p6_init_ppro(void)

Definition at line 619 of file pfmlib_i386_p6.c.