PAPI 7.1.0.0
Loading...
Searching...
No Matches
pfmlib_sicortex.c
Go to the documentation of this file.
1/*
2 * pfmlib_sicortex.c : support for the generic MIPS64 PMU family
3 *
4 * Contributed by Philip Mucci <mucci@cs.utk.edu> based on code from
5 * Copyright (c) 2005-2006 Hewlett-Packard Development Company, L.P.
6 * Contributed by Stephane Eranian <eranian@hpl.hp.com>
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12 * of the Software, and to permit persons to whom the Software is furnished to do so,
13 * subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in all
16 * copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
19 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
20 * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
22 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
23 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 */
25#include <sys/types.h>
26#include <ctype.h>
27#include <string.h>
28#include <stdio.h>
29#include <unistd.h>
30#include <sys/types.h>
31#include <sys/stat.h>
32#include <fcntl.h>
33#include <malloc.h>
34
35/* public headers */
38
39/* private headers */
40#include "pfmlib_priv.h" /* library private */
41#include "pfmlib_sicortex_priv.h" /* architecture private */
42#include "sicortex/ice9a/ice9a_all_spec_pme.h"
43#include "sicortex/ice9b/ice9b_all_spec_pme.h"
44#include "sicortex/ice9/ice9_scb_spec_sw.h"
45
46/* let's define some handy shortcuts! */
47#define sel_event_mask perfsel.sel_event_mask
48#define sel_exl perfsel.sel_exl
49#define sel_os perfsel.sel_os
50#define sel_usr perfsel.sel_usr
51#define sel_sup perfsel.sel_sup
52#define sel_int perfsel.sel_int
53
55
56// CHANGE FOR ICET
57#define core_counters 2
58
59#define MAX_ICE9_PMCS 2+4+256
60#define MAX_ICE9_PMDS 2+4+256
61
63{
64 int i;
65 int bound = 0;
67
70 for (i=0;i<MAX_ICE9_PMDS;i++)
71 {
72 char tmp[1024];
73 sprintf(tmp,"/sys/kernel/perfmon/pmu_desc/pmd%d",i);
74 if (access(tmp,F_OK) == 0)
76 }
77 for (i=0;i<MAX_ICE9_PMCS;i++)
78 {
79 char tmp[1024];
80 sprintf(tmp,"/sys/kernel/perfmon/pmu_desc/pmc%d",i);
81 if (access(tmp,F_OK) == 0)
83 }
84
85 /* Compute the max */
86
88 gen_mips64_pe = gen_mips64_ice9a_pe;
89// core_counters = 2;
90 bound = (sizeof(gen_mips64_ice9a_pe)/sizeof(pme_gen_mips64_entry_t));
91 } else if (type == PFMLIB_MIPS_ICE9B_PMU) {
92 gen_mips64_pe = gen_mips64_ice9b_pe;
93// core_counters = 2;
94 bound = (sizeof(gen_mips64_ice9b_pe)/sizeof(pme_gen_mips64_entry_t));
95 }
96
97 /* Allocate the table */
98
99 sicortex_pe = malloc(bound*sizeof(*sicortex_pe));
100 if (sicortex_pe == NULL)
101 return 0;
102
103 /* If we find we have SCB support */
104
106 {
107 /* Account for 4 sampling PMD registers */
110 }
111 else
112 {
114 /* Count up CPU only events */
115 for (i=0;i<bound;i++)
116 {
117 unsigned int tmp = gen_mips64_pe[i].pme_counters;
118 if (!(tmp & (1<<core_counters)))
120 }
121 }
122
123 for (i=0;i<bound;i++)
124 {
129 if (sicortex_pe[i].pme_counters & (1<<core_counters)) {
130 int j;
132 for (j=0;j<sicortex_pe[i].pme_numasks;j++)
133 {
137 }
138 } else {
140 memset(sicortex_pe[i].pme_umasks,0x0,sizeof(sicortex_pe[i].pme_umasks));
141 }
142 }
143 return 1;
144}
145
146static int
148{
149 static char mips_name[64] = "";
150 int ret;
151 char buffer[128];
153
154 ret = __pfm_getcpuinfo_attr("cpu model", buffer, sizeof(buffer));
155 if (ret == -1)
156 return PFMLIB_ERR_NOTSUPP;
157
159 if (strstr(buffer,"SiCortex ICE9A"))
160 {
162 return PFMLIB_ERR_NOTSUPP;
163 sicortex_support.pmu_name = mips_name;
164 strcpy(sicortex_support.pmu_name,"MIPSICE9A"),
166 }
167 else if (strstr(buffer,"SiCortex ICE9B"))
168 {
170 return PFMLIB_ERR_NOTSUPP;
171 sicortex_support.pmu_name = mips_name;
172 strcpy(sicortex_support.pmu_name,"MIPSICE9B"),
174 }
175 else
176 return PFMLIB_ERR_NOTSUPP;
177
178 if (sicortex_support.num_cnt == 0)
180
181 return PFMLIB_SUCCESS;
182}
183
184static void stuff_sicortex_regs(pfmlib_event_t *e, int plm, pfmlib_reg_t *pc, pfmlib_reg_t *pd, int cntr, int j, pfmlib_sicortex_input_param_t *mod_in)
185{
187 reg.val = 0; /* assume reserved bits are zerooed */
188 /* if plm is 0, then assume not specified per-event and use default */
189 plm = e[j].plm ? e[j].plm : plm;
190 reg.sel_usr = plm & PFM_PLM3 ? 1 : 0;
191 reg.sel_os = plm & PFM_PLM0 ? 1 : 0;
192 reg.sel_sup = plm & PFM_PLM1 ? 1 : 0;
193 reg.sel_exl = plm & PFM_PLM2 ? 1 : 0;
194 reg.sel_int = 1; /* force int to 1 */
195
196 /* CPU event */
197 if (sicortex_pe[e[j].event].pme_counters & ((1<<core_counters)-1))
198 {
199 reg.sel_event_mask = (sicortex_pe[e[j].event].pme_code >> (cntr*8)) & 0xff;
200 pc[j].reg_addr = cntr*2;
201 pc[j].reg_value = reg.val;
202 pc[j].reg_num = cntr;
203
204 __pfm_vbprintf("[CP0_25_%u(pmc%u)=0x%"PRIx64" event_mask=0x%x usr=%d os=%d sup=%d exl=%d int=1] %s\n",
205 pc[j].reg_addr,
206 pc[j].reg_num,
207 pc[j].reg_value,
208 reg.sel_event_mask,
209 reg.sel_usr,
210 reg.sel_os,
211 reg.sel_sup,
212 reg.sel_exl,
214
215 pd[j].reg_num = cntr;
216 pd[j].reg_addr = cntr*2 + 1;
217
218 __pfm_vbprintf("[CP0_25_%u(pmd%u)]\n",
219 pc[j].reg_addr,
220 pc[j].reg_num);
221
222 }
223 /* SCB event */
224 else
225 {
227 int k;
228 scbreg.val = 0;
230 for (k=0;k<e[j].num_masks;k++)
231 {
232 if (e[j].unit_masks[k] == 4)
233 scbreg.sicortex_ScbPerfBucket_reg.hist = 0x1;
234 else if (e[j].unit_masks[k] == 1)
236 else if (e[j].unit_masks[k] == 2)
238 }
239 __pfm_vbprintf("[ScbPerfBucket[%u](pmc%u)=0x%"PRIx64" event=0x%x hist=%d ifOther=0x%x]\n",
240 cntr,cntr+6,scbreg.val,
244
245 pc[j].reg_addr = cntr;
246 pc[j].reg_value = scbreg.val;
247 pc[j].reg_num = cntr + 6;
248
249 pd[j].reg_addr = cntr;
250 pd[j].reg_num = cntr + 6;
251
252 __pfm_vbprintf("[ScbPerfCount[%u](pmd%u)]\n",
253 pc[j].reg_addr,
254 pc[j].reg_num);
255
256 }
257}
258
260{
265
266 // __pfm_vbprintf("num = %d\n",num);
267
268 /* The kernel will enforce most of these, see perfmon_ice9.c in the kernel */
269
270 /* ScbPerfCtl */
271
272 pc[num].reg_num = 2;
273 pc[num].reg_addr = 2;
274 two.val = 0;
275 if (mod_in && (mod_in->flags & PFMLIB_SICORTEX_INPUT_SCB_INTERVAL))
276 {
278 }
279 else
280 {
281 two.sicortex_ScbPerfCtl_reg.Interval = 6; /* 2048 cycles */
282 }
283 if (mod_in && (mod_in->flags & PFMLIB_SICORTEX_INPUT_SCB_NOINC))
284 {
286 }
287 else
288 {
290 }
291
292 two.sicortex_ScbPerfCtl_reg.IntBit = 31; /* Interrupt on last bit */
295
296 __pfm_vbprintf("[Scb%s(pmc%u)=0x%"PRIx64" Interval=0x%x IntBit=0x%x NoInc=%d AddrAssert=%d MagicEvent=0x%x]\n","PerfCtl",
297 pc[num].reg_num,
298 two.val,
304 pc[num].reg_value = two.val;
305
306 /*ScbPerfHist */
307
308 pc[++num].reg_num = 3;
309 pc[num].reg_addr = 3;
310 three.val = 0;
311 if (mod_in && (mod_in->flags & PFMLIB_SICORTEX_INPUT_SCB_HISTGTE))
313 else
315
316 __pfm_vbprintf("[Scb%s(pmc%u)=0x%"PRIx64" HistGte=0x%x]\n","PerfHist",
317 pc[num].reg_num,
318 three.val,
320 pc[num].reg_value = three.val;
321
322 /*ScbPerfBuckNum */
323
324 pc[++num].reg_num = 4;
325 pc[num].reg_addr = 4;
326 four.val = 0;
327 if (mod_in && (mod_in->flags & PFMLIB_SICORTEX_INPUT_SCB_BUCKET))
329 else
331 __pfm_vbprintf("[Scb%s(pmc%u)=0x%"PRIx64" Bucket=0x%x]\n","PerfBuckNum",
332 pc[num].reg_num,
333 four.val,
335 pc[num].reg_value = four.val;
336
337 /*ScbPerfEna */
338
339 pc[++num].reg_num = 5;
340 pc[num].reg_addr = 5;
341 five.val = 0;
343 __pfm_vbprintf("[Scb%s(pmc%u)=0x%"PRIx64" ena=%d]\n","PerfEna",
344 pc[num].reg_num,
345 five.val,
347 pc[num].reg_value = five.val;
348 ++num;
349 return(num);
350}
351
352/*
353 * Automatically dispatch events to corresponding counters following constraints.
354 * Upon return the pfarg_regt structure is ready to be submitted to kernel
355 */
356static int
358{
359 /* pfmlib_sicortex_input_param_t *param = mod_in; */
360 pfmlib_event_t *e = inp->pfp_events;
361 pfmlib_reg_t *pc, *pd;
362 unsigned int i, j, cnt = inp->pfp_event_count;
363 unsigned int used = 0;
365 unsigned int cntr, avail;
366
367 pc = outp->pfp_pmcs;
368 pd = outp->pfp_pmds;
369
370 /* Degree N rank based allocation */
372
373 if (PFMLIB_DEBUG()) {
374 for (j=0; j < cnt; j++) {
375 DPRINT("ev[%d]=%s, counters=0x%x\n", j, sicortex_pe[e[j].event].pme_name,sicortex_pe[e[j].event].pme_counters);
376 }
377 }
378
379 /* Do rank based allocation, counters that live on 1 reg
380 before counters that live on 2 regs etc. */
381
382 /* CPU counters first */
383 for (i=1;i<=core_counters;i++)
384 {
385 for (j=0; j < cnt;j++)
386 {
387 /* CPU counters first */
388 if ((sicortex_pe[e[j].event].pme_counters & ((1<<core_counters)-1)) && (pfmlib_popcnt(sicortex_pe[e[j].event].pme_counters) == i))
389 {
390 /* These counters can be used for this event */
391 avail = ~used & sicortex_pe[e[j].event].pme_counters;
392 DPRINT("Rank %d: Counters available 0x%x\n",i,avail);
393 if (avail == 0x0)
394 return PFMLIB_ERR_NOASSIGN;
395
396 /* Pick one, mark as used*/
397 cntr = ffs(avail) - 1;
398 DPRINT("Rank %d: Chose counter %d\n",i,cntr);
399
400 /* Update registers */
401 stuff_sicortex_regs(e,inp->pfp_dfl_plm,pc,pd,cntr,j,mod_in);
402
403 used |= (1 << cntr);
404 DPRINT("Rank %d: Used counters 0x%x\n",i, used);
405 }
406 }
407 }
408
409 /* SCB counters can live anywhere */
410
411 used = 0;
412 for (j=0; j < cnt;j++)
413 {
414 unsigned int cntr;
415
416 /* CPU counters first */
417 if (sicortex_pe[e[j].event].pme_counters & (1<<core_counters))
418 {
419 int k, has_ifother = 0, has_hist = 0;
420 for (k=0;k<e[j].num_masks;k++)
421 {
422 if ((e[j].unit_masks[k] == 0) || (e[j].unit_masks[k] == 1) || (e[j].unit_masks[k] == 2)) {
423 if (has_ifother)
424 return PFMLIB_ERR_UMASK;
425 has_ifother = 1;
426 }
427 else if ((e[j].unit_masks[k] == 3) || (e[j].unit_masks[k] == 4)) {
428 if (has_hist)
429 return PFMLIB_ERR_UMASK;
430 has_hist = 1;
431 }
432 }
433 /* These counters can be used for this event */
434 avail = sicortex_support.num_cnt - core_counters - used;
435 DPRINT("SCB(%d): Counters available %d\n",j,avail);
436
437 cntr = (sicortex_support.num_cnt - core_counters) - avail;
438 DPRINT("SCB(%d): Chose SCB counter %d\n",j,cntr);
439
440 /* Update registers */
441 stuff_sicortex_regs(e,inp->pfp_dfl_plm,pc,pd,cntr,j,mod_in);
442 used++;
443 DPRINT("SCB(%d): Used counters %d\n",j,used);
444 }
445 }
446 if (used)
447 {
448 outp->pfp_pmc_count = stuff_sicortex_scb_control_regs(pc,pd,cnt,mod_in);
449 outp->pfp_pmd_count = cnt;
450 return PFMLIB_SUCCESS;
451 }
452
453 /* number of evtsel registers programmed */
454 outp->pfp_pmc_count = cnt;
455 outp->pfp_pmd_count = cnt;
456
457 return PFMLIB_SUCCESS;
458}
459
460static int
462{
464
465 return pfm_sicortex_dispatch_counters(inp, mod_sicortex_in, outp);
466}
467
468static int
469pfm_sicortex_get_event_code(unsigned int i, unsigned int cnt, int *code)
470{
472
473 /* check validity of counter index */
474 if (cnt != PFMLIB_CNT_FIRST) {
475 if (cnt < 0 || cnt >= sicortex_support.pmc_count)
476 return PFMLIB_ERR_INVAL; }
477 else {
478 cnt = ffs(sicortex_pe[i].pme_counters)-1;
479 if (cnt == -1)
480 return(PFMLIB_ERR_INVAL);
481 }
482
483 /* if cnt == 1, shift right by 0, if cnt == 2, shift right by 8 */
484 /* Works on both 5k anf 20K */
485
486 unsigned int tmp = sicortex_pe[i].pme_counters;
487 /* CPU event */
488 if (tmp & ((1<<core_counters)-1))
489 {
490 if (tmp & (1<< cnt))
491 *code = 0xff & (sicortex_pe[i].pme_code >> (cnt*8));
492 else
493 return PFMLIB_ERR_INVAL;
494 }
495 /* SCB event */
496 else
497 {
498 if ((cnt < 6) || (cnt >= sicortex_support.pmc_count))
499 return PFMLIB_ERR_INVAL;
500 *code = 0xffff & (sicortex_pe[i].pme_code >> 16);
501 }
502
503 return PFMLIB_SUCCESS;
504}
505
506/*
507 * This function is accessible directly to the user
508 */
509int
510pfm_sicortex_get_event_umask(unsigned int i, unsigned long *umask)
511{
513 if (i >= sicortex_support.pme_count || umask == NULL) return PFMLIB_ERR_INVAL;
514 *umask = 0; //evt_umask(i);
515 return PFMLIB_SUCCESS;
516}
517
518static void
520{
522 unsigned int tmp;
523
524 memset(counters, 0, sizeof(*counters));
526
527 /* CPU counter */
528 if (tmp & ((1<<core_counters)-1))
529 {
530 while (tmp)
531 {
532 int t = ffs(tmp) - 1;
533 pfm_regmask_set(counters, t);
534 tmp = tmp ^ (1 << t);
535 }
536 }
537 /* SCB counter, requires first 4, then 1 of the remaining */
538 else
539 {
540 int i;
541 for (i=6;i<sicortex_support.pmc_count;i++)
542 pfm_regmask_set(counters, i);
543 }
544}
545
546static void
548{
549 unsigned int i = 0;
551
552 /* all pmcs are contiguous */
553 for(i=0; i < sicortex_support.pmc_count; i++) pfm_regmask_set(impl_pmcs, i);
554}
555
556static void
558{
559 unsigned int i = 0;
561
562 /* all pmds are contiguous */
563 for(i=0; i < sicortex_support.pmd_count; i++) pfm_regmask_set(impl_pmds, i);
564}
565
566static void
568{
569 unsigned int i = 0;
571
572 pfm_regmask_set(impl_counters, 0);
573 pfm_regmask_set(impl_counters, 1);
574 /* If we have the SCB turned on */
576 {
577 /* counting pmds are not contiguous on ICE9*/
578 for(i=6; i < sicortex_support.pmd_count; i++)
579 pfm_regmask_set(impl_counters, i);
580 }
581}
582
583static void
585{
587}
588
589static char *
591{
592 return sicortex_pe[i].pme_name;
593}
594
595static int
596pfm_sicortex_get_event_description(unsigned int ev, char **str)
597{
598 char *s;
599 s = sicortex_pe[ev].pme_desc;
600 if (s) {
601 *str = strdup(s);
602 } else {
603 *str = NULL;
604 }
605 return PFMLIB_SUCCESS;
606}
607
608static int
610{
611 return pfm_find_full_event("CPU_CYCLES",e);
612}
613
614static int
616{
617 return pfm_find_full_event("CPU_INSEXEC",e);
618}
619
620/* SiCortex specific functions */
621
622/* CPU counter */
623int pfm_sicortex_is_cpu(unsigned int i)
624{
626 {
627 unsigned int tmp = sicortex_pe[i].pme_counters;
628 return !(tmp & (1<<core_counters));
629 }
630 return 0;
631}
632
633/* SCB counter */
634int pfm_sicortex_is_scb(unsigned int i)
635{
637 {
638 unsigned int tmp = sicortex_pe[i].pme_counters;
639 return (tmp & (1<<core_counters));
640 }
641 return 0;
642}
643
644/* Reg 25 domain support */
646{
648 {
649 unsigned int tmp = sicortex_pe[i].pme_counters;
650 return (tmp & (1<<3));
651 }
652 return 0;
653}
654
655/* VPC/PEA sampling support */
657{
659 {
660 unsigned int tmp = sicortex_pe[i].pme_counters;
661 return (tmp & (1<<4));
662 }
663 return 0;
664}
665
666static char *
667pfm_sicortex_get_event_mask_name(unsigned int ev, unsigned int midx)
668{
669 return sicortex_pe[ev].pme_umasks[midx].pme_uname;
670}
671
672static int
673pfm_sicortex_get_event_mask_desc(unsigned int ev, unsigned int midx, char **str)
674{
675 char *s;
676
677 s = sicortex_pe[ev].pme_umasks[midx].pme_udesc;
678 if (s) {
679 *str = strdup(s);
680 } else {
681 *str = NULL;
682 }
683 return PFMLIB_SUCCESS;
684}
685
686static unsigned int
688{
689 return sicortex_pe[ev].pme_numasks;
690}
691
692static int
693pfm_sicortex_get_event_mask_code(unsigned int ev, unsigned int midx, unsigned int *code)
694{
695 *code = sicortex_pe[ev].pme_umasks[midx].pme_ucode;
696 return PFMLIB_SUCCESS;
697}
698
699static int
701{
702 /* all events have default unit mask */
703 return 1;
704}
705
707 .pmu_name = NULL,
708 .pmu_type = PFMLIB_UNKNOWN_PMU,
709 .pme_count = 0,
710 .pmc_count = 0,
711 .pmd_count = 0,
712 .num_cnt = 0,
713 .flags = PFMLIB_MULT_CODE_EVENT,
714 .get_event_code = pfm_sicortex_get_event_code,
715 .get_event_name = pfm_sicortex_get_event_name,
716 .get_event_counters = pfm_sicortex_get_event_counters,
717 .dispatch_events = pfm_sicortex_dispatch_events,
718 .pmu_detect = pfm_sicortex_detect,
719 .get_impl_pmcs = pfm_sicortex_get_impl_perfsel,
720 .get_impl_pmds = pfm_sicortex_get_impl_perfctr,
721 .get_impl_counters = pfm_sicortex_get_impl_counters,
722 .get_hw_counter_width = pfm_sicortex_get_hw_counter_width,
723 .get_event_desc = pfm_sicortex_get_event_description,
724 .get_num_event_masks = pfm_sicortex_get_num_event_masks,
725 .get_event_mask_name = pfm_sicortex_get_event_mask_name,
726 .get_event_mask_code = pfm_sicortex_get_event_mask_code,
727 .get_event_mask_desc = pfm_sicortex_get_event_mask_desc,
728 .get_cycle_event = pfm_sicortex_get_cycle_event,
729 .get_inst_retired_event = pfm_sicortex_get_inst_retired,
730 .has_umask_default = pfm_sicortex_has_umask_default
731};
double tmp
int i
double s
Definition: byte_profile.c:36
uint16_t type
#define PFM_PLM2
Definition: pfmlib.h:52
#define PFMLIB_ERR_UMASK
Definition: pfmlib.h:306
static int pfm_regmask_set(pfmlib_regmask_t *h, unsigned int b)
Definition: pfmlib.h:321
#define PFMLIB_SUCCESS
Definition: pfmlib.h:283
#define PFMLIB_MIPS_ICE9B_PMU
Definition: pfmlib.h:255
#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
pfm_err_t pfm_find_full_event(const char *str, pfmlib_event_t *e)
#define PFMLIB_ERR_NOASSIGN
Definition: pfmlib.h:288
#define PFMLIB_MIPS_ICE9A_PMU
Definition: pfmlib.h:254
#define PFM_PLM1
Definition: pfmlib.h:51
#define PFMLIB_ERR_NOTSUPP
Definition: pfmlib.h:284
#define PFMLIB_UNKNOWN_PMU
Definition: pfmlib.h:222
#define pfmlib_popcnt
static pme_gen_mips64_entry_t * gen_mips64_pe
#define PMU_GEN_MIPS64_COUNTER_WIDTH
int __pfm_getcpuinfo_attr(const char *attr, char *ret_buf, size_t maxlen)
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
#define PFMLIB_MULT_CODE_EVENT
Definition: pfmlib_priv.h:60
#define PFMLIB_CNT_FIRST
Definition: pfmlib_priv.h:62
static int pfm_sicortex_get_event_mask_code(unsigned int ev, unsigned int midx, unsigned int *code)
static int pfm_sicortex_get_cycle_event(pfmlib_event_t *e)
static int pfm_sicortex_has_umask_default(unsigned int ev)
#define MAX_ICE9_PMDS
static unsigned int pfm_sicortex_get_num_event_masks(unsigned int ev)
static void pfm_sicortex_get_impl_perfsel(pfmlib_regmask_t *impl_pmcs)
int pfm_sicortex_is_cpu(unsigned int i)
static int pfm_sicortex_get_event_mask_desc(unsigned int ev, unsigned int midx, char **str)
static int pfm_sicortex_get_inst_retired(pfmlib_event_t *e)
static int pfm_sicortex_dispatch_counters(pfmlib_input_param_t *inp, pfmlib_sicortex_input_param_t *mod_in, pfmlib_output_param_t *outp)
#define core_counters
static int stuff_sicortex_scb_control_regs(pfmlib_reg_t *pc, pfmlib_reg_t *pd, int num, pfmlib_sicortex_input_param_t *mod_in)
static void pfm_sicortex_get_hw_counter_width(unsigned int *width)
static int pfm_sicortex_dispatch_events(pfmlib_input_param_t *inp, void *model_in, pfmlib_output_param_t *outp, void *model_out)
#define MAX_ICE9_PMCS
static int pfm_sicortex_get_event_description(unsigned int ev, char **str)
int pfm_sicortex_support_domain(unsigned int i)
static int compute_ice9_counters(int type)
static int pfm_sicortex_get_event_code(unsigned int i, unsigned int cnt, int *code)
static int pfm_sicortex_detect(void)
static pme_sicortex_entry_t * sicortex_pe
static void pfm_sicortex_get_event_counters(unsigned int j, pfmlib_regmask_t *counters)
static void pfm_sicortex_get_impl_counters(pfmlib_regmask_t *impl_counters)
static char * pfm_sicortex_get_event_mask_name(unsigned int ev, unsigned int midx)
int pfm_sicortex_get_event_umask(unsigned int i, unsigned long *umask)
static char * pfm_sicortex_get_event_name(unsigned int i)
static void stuff_sicortex_regs(pfmlib_event_t *e, int plm, pfmlib_reg_t *pc, pfmlib_reg_t *pd, int cntr, int j, pfmlib_sicortex_input_param_t *mod_in)
pfm_pmu_support_t sicortex_support
int pfm_sicortex_support_vpc_pea(unsigned int i)
static void pfm_sicortex_get_impl_perfctr(pfmlib_regmask_t *impl_pmds)
int pfm_sicortex_is_scb(unsigned int i)
#define PFMLIB_SICORTEX_INPUT_SCB_NOINC
#define PFMLIB_SICORTEX_INPUT_SCB_INTERVAL
#define PFMLIB_SICORTEX_INPUT_SCB_HISTGTE
#define PFMLIB_SICORTEX_INPUT_SCB_BUCKET
static pme_sicortex_umask_t sicortex_scb_umasks[PFMLIB_SICORTEX_MAX_UMASK]
#define PFMLIB_SICORTEX_MAX_UMASK
unsigned int pmc_count
Definition: pfmlib_priv.h:37
unsigned int num_cnt
Definition: pfmlib_priv.h:38
unsigned int pmd_count
Definition: pfmlib_priv.h:36
unsigned int pme_count
Definition: pfmlib_priv.h:35
unsigned int num_masks
Definition: pfmlib.h:90
unsigned int plm
Definition: pfmlib.h:87
unsigned int event
Definition: pfmlib.h:86
unsigned int pfp_dfl_plm
Definition: pfmlib.h:110
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 long reg_addr
Definition: pfmlib.h:99
pfmlib_sicortex_scb_t pfp_sicortex_scb_global
char * pme_name
char * pme_desc
unsigned int pme_counters
unsigned int pme_code
unsigned int pme_numasks
char * pme_name
unsigned int pme_code
char * pme_desc
unsigned int pme_counters
pme_sicortex_umask_t pme_umasks[PFMLIB_SICORTEX_MAX_UMASK]
unsigned long sel_event_mask
struct pmc_sicortex_scb_reg_t::@89 sicortex_ScbPerfHist_reg
unsigned long MagicEvent
struct pmc_sicortex_scb_reg_t::@91 sicortex_ScbPerfEna_reg
struct pmc_sicortex_scb_reg_t::@92 sicortex_ScbPerfBucket_reg
unsigned long AddrAssert
struct pmc_sicortex_scb_reg_t::@88 sicortex_ScbPerfCtl_reg
struct pmc_sicortex_scb_reg_t::@90 sicortex_ScbPerfBuckNum_reg