PAPI 7.1.0.0
Loading...
Searching...
No Matches
pfmlib_montecito.h File Reference
Include dependency graph for pfmlib_montecito.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  pfm_mont_pmc_reg_t
 
union  pfm_mont_pmd_reg_t
 
struct  pfmlib_mont_counter_t
 
struct  pfmlib_mont_etb_t
 
struct  pfmlib_mont_ear_t
 
struct  pfmlib_mont_input_rr_desc_t
 
struct  pfmlib_mont_output_rr_desc_t
 
struct  pfmlib_mont_input_rr_t
 
struct  pfmlib_mont_output_rr_t
 
struct  pfmlib_mont_opcm_t
 
struct  pfmlib_mont_ipear_t
 
struct  pfmlib_mont_input_param_t
 
struct  pfmlib_mont_output_param_t
 

Macros

#define PMU_MONT_FIRST_COUNTER   4 /* index of first PMC/PMD counter */
 
#define PMU_MONT_NUM_COUNTERS   12 /* total numbers of PMC/PMD pairs used as counting monitors */
 
#define PMU_MONT_NUM_PMCS   27 /* total number of PMCS defined */
 
#define PMU_MONT_NUM_PMDS   36 /* total number of PMDS defined */
 
#define PMU_MONT_NUM_ETB   16 /* total number of PMDS in ETB */
 
#define PMU_MONT_COUNTER_WIDTH   47 /* hardware counter bit width */
 
#define PFMLIB_MONT_FL_EVT_NO_QUALCHECK   0x1 /* don't check qualifier constraints */
 
#define PFMLIB_MONT_FL_EVT_ALL_THRD   0x2 /* event measured for both threads */
 
#define PFMLIB_MONT_FL_EVT_ACTIVE_ONLY   0x4 /* measure the event only when the thread is active */
 
#define PFMLIB_MONT_FL_EVT_ALWAYS   0x8 /* measure the event at all times (active or inactive) */
 
#define PFMLIB_MONT_RR_INV   0x1 /* inverse instruction ranges (iranges only) */
 
#define PFMLIB_MONT_RR_NO_FINE_MODE   0x2 /* force non fine mode for instruction ranges */
 
#define PFMLIB_MONT_IRR_DEMAND_FETCH   0x4 /* demand fetch only for dual events */
 
#define PFMLIB_MONT_IRR_PREFETCH_MATCH   0x8 /* regular prefetches for dual events */
 
#define PFMLIB_MONT_EVT_NO_GRP   0 /* event does not belong to a group */
 
#define PFMLIB_MONT_EVT_L1D_CACHE_GRP   1 /* event belongs to L1D Cache group */
 
#define PFMLIB_MONT_EVT_L2D_CACHE_GRP   2 /* event belongs to L2D Cache group */
 
#define PFMLIB_MONT_EVT_NO_SET   -1 /* event does not belong to a set */
 
#define PFMLIB_MONT_EVT_ACTIVE   0 /* event measures only when thread is active */
 
#define PFMLIB_MONT_EVT_FLOATING   1
 
#define PFMLIB_MONT_EVT_CAUSAL   2
 
#define PFMLIB_MONT_EVT_SELF_FLOATING   3 /* floating with .self, causal otherwise */
 

Enumerations

enum  pfmlib_mont_ear_mode_t { PFMLIB_MONT_EAR_CACHE_MODE = 0 , PFMLIB_MONT_EAR_TLB_MODE = 1 , PFMLIB_MONT_EAR_ALAT_MODE = 2 }
 

Functions

int pfm_mont_is_ear (unsigned int i)
 
int pfm_mont_is_dear (unsigned int i)
 
int pfm_mont_is_dear_tlb (unsigned int i)
 
int pfm_mont_is_dear_cache (unsigned int i)
 
int pfm_mont_is_dear_alat (unsigned int i)
 
int pfm_mont_is_iear (unsigned int i)
 
int pfm_mont_is_iear_tlb (unsigned int i)
 
int pfm_mont_is_iear_cache (unsigned int i)
 
int pfm_mont_is_etb (unsigned int i)
 
int pfm_mont_support_opcm (unsigned int i)
 
int pfm_mont_support_iarr (unsigned int i)
 
int pfm_mont_support_darr (unsigned int i)
 
int pfm_mont_support_all (unsigned int i)
 
int pfm_mont_get_ear_mode (unsigned int i, pfmlib_mont_ear_mode_t *m)
 
int pfm_mont_irange_is_fine (pfmlib_output_param_t *outp, pfmlib_mont_output_param_t *mod_out)
 
int pfm_mont_get_event_maxincr (unsigned int i, unsigned int *maxincr)
 
int pfm_mont_get_event_umask (unsigned int i, unsigned long *umask)
 
int pfm_mont_get_event_group (unsigned int i, int *grp)
 
int pfm_mont_get_event_set (unsigned int i, int *set)
 
int pfm_mont_get_event_type (unsigned int i, int *type)
 

Macro Definition Documentation

◆ PFMLIB_MONT_EVT_ACTIVE

#define PFMLIB_MONT_EVT_ACTIVE   0 /* event measures only when thread is active */

Definition at line 650 of file pfmlib_montecito.h.

◆ PFMLIB_MONT_EVT_CAUSAL

#define PFMLIB_MONT_EVT_CAUSAL   2

Definition at line 652 of file pfmlib_montecito.h.

◆ PFMLIB_MONT_EVT_FLOATING

#define PFMLIB_MONT_EVT_FLOATING   1

Definition at line 651 of file pfmlib_montecito.h.

◆ PFMLIB_MONT_EVT_L1D_CACHE_GRP

#define PFMLIB_MONT_EVT_L1D_CACHE_GRP   1 /* event belongs to L1D Cache group */

Definition at line 639 of file pfmlib_montecito.h.

◆ PFMLIB_MONT_EVT_L2D_CACHE_GRP

#define PFMLIB_MONT_EVT_L2D_CACHE_GRP   2 /* event belongs to L2D Cache group */

Definition at line 640 of file pfmlib_montecito.h.

◆ PFMLIB_MONT_EVT_NO_GRP

#define PFMLIB_MONT_EVT_NO_GRP   0 /* event does not belong to a group */

Definition at line 638 of file pfmlib_montecito.h.

◆ PFMLIB_MONT_EVT_NO_SET

#define PFMLIB_MONT_EVT_NO_SET   -1 /* event does not belong to a set */

Definition at line 645 of file pfmlib_montecito.h.

◆ PFMLIB_MONT_EVT_SELF_FLOATING

#define PFMLIB_MONT_EVT_SELF_FLOATING   3 /* floating with .self, causal otherwise */

Definition at line 653 of file pfmlib_montecito.h.

◆ PFMLIB_MONT_FL_EVT_ACTIVE_ONLY

#define PFMLIB_MONT_FL_EVT_ACTIVE_ONLY   0x4 /* measure the event only when the thread is active */

Definition at line 453 of file pfmlib_montecito.h.

◆ PFMLIB_MONT_FL_EVT_ALL_THRD

#define PFMLIB_MONT_FL_EVT_ALL_THRD   0x2 /* event measured for both threads */

Definition at line 452 of file pfmlib_montecito.h.

◆ PFMLIB_MONT_FL_EVT_ALWAYS

#define PFMLIB_MONT_FL_EVT_ALWAYS   0x8 /* measure the event at all times (active or inactive) */

Definition at line 454 of file pfmlib_montecito.h.

◆ PFMLIB_MONT_FL_EVT_NO_QUALCHECK

#define PFMLIB_MONT_FL_EVT_NO_QUALCHECK   0x1 /* don't check qualifier constraints */

Definition at line 451 of file pfmlib_montecito.h.

◆ PFMLIB_MONT_IRR_DEMAND_FETCH

#define PFMLIB_MONT_IRR_DEMAND_FETCH   0x4 /* demand fetch only for dual events */

Definition at line 562 of file pfmlib_montecito.h.

◆ PFMLIB_MONT_IRR_PREFETCH_MATCH

#define PFMLIB_MONT_IRR_PREFETCH_MATCH   0x8 /* regular prefetches for dual events */

Definition at line 563 of file pfmlib_montecito.h.

◆ PFMLIB_MONT_RR_INV

#define PFMLIB_MONT_RR_INV   0x1 /* inverse instruction ranges (iranges only) */

Definition at line 560 of file pfmlib_montecito.h.

◆ PFMLIB_MONT_RR_NO_FINE_MODE

#define PFMLIB_MONT_RR_NO_FINE_MODE   0x2 /* force non fine mode for instruction ranges */

Definition at line 561 of file pfmlib_montecito.h.

◆ PMU_MONT_COUNTER_WIDTH

#define PMU_MONT_COUNTER_WIDTH   47 /* hardware counter bit width */

Definition at line 42 of file pfmlib_montecito.h.

◆ PMU_MONT_FIRST_COUNTER

#define PMU_MONT_FIRST_COUNTER   4 /* index of first PMC/PMD counter */

Definition at line 37 of file pfmlib_montecito.h.

◆ PMU_MONT_NUM_COUNTERS

#define PMU_MONT_NUM_COUNTERS   12 /* total numbers of PMC/PMD pairs used as counting monitors */

Definition at line 38 of file pfmlib_montecito.h.

◆ PMU_MONT_NUM_ETB

#define PMU_MONT_NUM_ETB   16 /* total number of PMDS in ETB */

Definition at line 41 of file pfmlib_montecito.h.

◆ PMU_MONT_NUM_PMCS

#define PMU_MONT_NUM_PMCS   27 /* total number of PMCS defined */

Definition at line 39 of file pfmlib_montecito.h.

◆ PMU_MONT_NUM_PMDS

#define PMU_MONT_NUM_PMDS   36 /* total number of PMDS defined */

Definition at line 40 of file pfmlib_montecito.h.

Enumeration Type Documentation

◆ pfmlib_mont_ear_mode_t

Enumerator
PFMLIB_MONT_EAR_CACHE_MODE 
PFMLIB_MONT_EAR_TLB_MODE 
PFMLIB_MONT_EAR_ALAT_MODE 

Definition at line 506 of file pfmlib_montecito.h.

506 {
507 PFMLIB_MONT_EAR_CACHE_MODE= 0, /* Cache mode : I-EAR and D-EAR */
508 PFMLIB_MONT_EAR_TLB_MODE = 1, /* TLB mode : I-EAR and D-EAR */
509 PFMLIB_MONT_EAR_ALAT_MODE = 2 /* ALAT mode : D-EAR only */
pfmlib_mont_ear_mode_t
@ PFMLIB_MONT_EAR_TLB_MODE
@ PFMLIB_MONT_EAR_CACHE_MODE
@ PFMLIB_MONT_EAR_ALAT_MODE

Function Documentation

◆ pfm_mont_get_ear_mode()

int pfm_mont_get_ear_mode ( unsigned int  i,
pfmlib_mont_ear_mode_t m 
)

Definition at line 2213 of file pfmlib_montecito.c.

2214{
2216
2217 if (!is_ear(i) || m == NULL) return PFMLIB_ERR_INVAL;
2218
2220 if (is_ear_tlb(i)) goto done;
2221
2223 if (is_ear_cache(i)) goto done;
2224
2226 if (is_ear_alat(i)) goto done;
2227
2228 return PFMLIB_ERR_INVAL;
2229done:
2230 *m = r;
2231 return PFMLIB_SUCCESS;
2232}
int i
#define PFMLIB_SUCCESS
Definition: pfmlib.h:283
#define PFMLIB_ERR_INVAL
Definition: pfmlib.h:285
#define is_ear(i)
#define is_ear_alat(i)
#define is_ear_cache(i)
#define is_ear_tlb(i)
Here is the caller graph for this function:

◆ pfm_mont_get_event_group()

int pfm_mont_get_event_group ( unsigned int  i,
int grp 
)

Definition at line 2257 of file pfmlib_montecito.c.

2258{
2259 if (i >= PME_MONT_EVENT_COUNT || grp == NULL) return PFMLIB_ERR_INVAL;
2260 *grp = evt_grp(i);
2261 return PFMLIB_SUCCESS;
2262}
#define PME_MONT_EVENT_COUNT
#define evt_grp(e)

◆ pfm_mont_get_event_maxincr()

int pfm_mont_get_event_maxincr ( unsigned int  i,
unsigned int maxincr 
)

Definition at line 2124 of file pfmlib_montecito.c.

2125{
2126 if (i >= PME_MONT_EVENT_COUNT || maxincr == NULL) return PFMLIB_ERR_INVAL;
2127 *maxincr = montecito_pe[i].pme_maxincr;
2128 return PFMLIB_SUCCESS;
2129}
static pme_mont_entry_t montecito_pe[]
unsigned int pme_maxincr

◆ pfm_mont_get_event_set()

int pfm_mont_get_event_set ( unsigned int  i,
int set 
)

Definition at line 2265 of file pfmlib_montecito.c.

2266{
2267 if (i >= PME_MONT_EVENT_COUNT || set == NULL) return PFMLIB_ERR_INVAL;
2268 *set = evt_set(i) == 0xf ? PFMLIB_MONT_EVT_NO_SET : evt_set(i);
2269 return PFMLIB_SUCCESS;
2270}
#define evt_set(e)
#define PFMLIB_MONT_EVT_NO_SET

◆ pfm_mont_get_event_type()

int pfm_mont_get_event_type ( unsigned int  i,
int type 
)

Definition at line 2273 of file pfmlib_montecito.c.

2274{
2275 if (i >= PME_MONT_EVENT_COUNT || type == NULL) return PFMLIB_ERR_INVAL;
2276 *type = evt_caf(i);
2277 return PFMLIB_SUCCESS;
2278}
uint16_t type
#define evt_caf(e)

◆ pfm_mont_get_event_umask()

int pfm_mont_get_event_umask ( unsigned int  i,
unsigned long umask 
)

Definition at line 2249 of file pfmlib_montecito.c.

2250{
2251 if (i >= PME_MONT_EVENT_COUNT || umask == NULL) return PFMLIB_ERR_INVAL;
2252 *umask = evt_umask(i);
2253 return PFMLIB_SUCCESS;
2254}
#define evt_umask(e)
Here is the caller graph for this function:

◆ pfm_mont_irange_is_fine()

int pfm_mont_irange_is_fine ( pfmlib_output_param_t outp,
pfmlib_mont_output_param_t mod_out 
)

Definition at line 2282 of file pfmlib_montecito.c.

2283{
2284 pfmlib_mont_output_param_t *param = mod_out;
2286 unsigned int i, count;
2287
2288 /* some sanity checks */
2289 if (outp == NULL || param == NULL) return 0;
2290 if (outp->pfp_pmc_count >= PFMLIB_MAX_PMCS) return 0;
2291
2292 if (param->pfp_mont_irange.rr_nbr_used == 0) return 0;
2293
2294 /*
2295 * we look for pmc38 as it contains the bit indicating if fine mode is used
2296 */
2297 count = outp->pfp_pmc_count;
2298 for(i=0; i < count; i++) {
2299 if (outp->pfp_pmcs[i].reg_num == 38) goto found;
2300 }
2301 return 0;
2302found:
2303 reg.pmc_val = outp->pfp_pmcs[i].reg_value;
2304 return reg.pmc38_mont_reg.iarc_fine ? 1 : 0;
2305}
static long count
#define PFMLIB_MAX_PMCS
Definition: pfmlib.h:41
pfmlib_mont_output_rr_t pfp_mont_irange
pfmlib_reg_t pfp_pmcs[PFMLIB_MAX_PMCS]
Definition: pfmlib.h:129
unsigned int pfp_pmc_count
Definition: pfmlib.h:127
unsigned long long reg_value
Definition: pfmlib.h:98
unsigned int reg_num
Definition: pfmlib.h:100
unsigned long iarc_fine
unsigned long pmc_val
struct pfm_mont_pmc_reg_t::@72 pmc38_mont_reg
Here is the caller graph for this function:

◆ pfm_mont_is_dear()

int pfm_mont_is_dear ( unsigned int  i)

Definition at line 2138 of file pfmlib_montecito.c.

2139{
2140 return i < PME_MONT_EVENT_COUNT && is_dear(i);
2141}
#define is_dear(i)
Here is the caller graph for this function:

◆ pfm_mont_is_dear_alat()

int pfm_mont_is_dear_alat ( unsigned int  i)

Definition at line 2156 of file pfmlib_montecito.c.

2157{
2158 return i < PME_MONT_EVENT_COUNT && is_ear_alat(i);
2159}

◆ pfm_mont_is_dear_cache()

int pfm_mont_is_dear_cache ( unsigned int  i)

Definition at line 2150 of file pfmlib_montecito.c.

2151{
2152 return i < PME_MONT_EVENT_COUNT && is_dear(i) && is_ear_cache(i);
2153}

◆ pfm_mont_is_dear_tlb()

int pfm_mont_is_dear_tlb ( unsigned int  i)

Definition at line 2144 of file pfmlib_montecito.c.

2145{
2146 return i < PME_MONT_EVENT_COUNT && is_dear(i) && is_ear_tlb(i);
2147}

◆ pfm_mont_is_ear()

int pfm_mont_is_ear ( unsigned int  i)

Definition at line 2132 of file pfmlib_montecito.c.

2133{
2134 return i < PME_MONT_EVENT_COUNT && is_ear(i);
2135}

◆ pfm_mont_is_etb()

int pfm_mont_is_etb ( unsigned int  i)

Definition at line 2180 of file pfmlib_montecito.c.

2181{
2182 return i < PME_MONT_EVENT_COUNT && is_etb(i);
2183}
#define is_etb(i)
Here is the caller graph for this function:

◆ pfm_mont_is_iear()

int pfm_mont_is_iear ( unsigned int  i)

Definition at line 2162 of file pfmlib_montecito.c.

2163{
2164 return i < PME_MONT_EVENT_COUNT && is_iear(i);
2165}
#define is_iear(i)
Here is the caller graph for this function:

◆ pfm_mont_is_iear_cache()

int pfm_mont_is_iear_cache ( unsigned int  i)

Definition at line 2174 of file pfmlib_montecito.c.

2175{
2176 return i < PME_MONT_EVENT_COUNT && is_iear(i) && is_ear_cache(i);
2177}

◆ pfm_mont_is_iear_tlb()

int pfm_mont_is_iear_tlb ( unsigned int  i)

Definition at line 2168 of file pfmlib_montecito.c.

2169{
2170 return i < PME_MONT_EVENT_COUNT && is_iear(i) && is_ear_tlb(i);
2171}

◆ pfm_mont_support_all()

int pfm_mont_support_all ( unsigned int  i)

Definition at line 2206 of file pfmlib_montecito.c.

2207{
2208 return i < PME_MONT_EVENT_COUNT && has_all(i);
2209}
#define has_all(i)

◆ pfm_mont_support_darr()

int pfm_mont_support_darr ( unsigned int  i)

Definition at line 2193 of file pfmlib_montecito.c.

2194{
2195 return i < PME_MONT_EVENT_COUNT && has_darr(i);
2196}
#define has_darr(i)
Here is the caller graph for this function:

◆ pfm_mont_support_iarr()

int pfm_mont_support_iarr ( unsigned int  i)

Definition at line 2186 of file pfmlib_montecito.c.

2187{
2188 return i < PME_MONT_EVENT_COUNT && has_iarr(i);
2189}
#define has_iarr(i)
Here is the caller graph for this function:

◆ pfm_mont_support_opcm()

int pfm_mont_support_opcm ( unsigned int  i)

Definition at line 2200 of file pfmlib_montecito.c.

2201{
2202 return i < PME_MONT_EVENT_COUNT && has_opcm(i);
2203}
#define has_opcm(i)
Here is the caller graph for this function: