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

Go to the source code of this file.

Data Structures

union  pfm_nhm_sel_reg_t
 
struct  pfmlib_nhm_counter_t
 
struct  pfmlib_nhm_lbr_t
 
struct  pfmlib_nhm_pebs_t
 
struct  pfmlib_nhm_input_param_t
 

Macros

#define PMU_NHM_NUM_COUNTERS   16
 
#define PFM_NHM_SEL_INV   0x1 /* inverse */
 
#define PFM_NHM_SEL_EDGE   0x2 /* edge detect */
 
#define PFM_NHM_SEL_ANYTHR   0x4 /* any thread (core only) */
 
#define PFM_NHM_SEL_OCC_RST   0x8 /* reset occupancy (uncore only) */
 
#define PFM_NHM_LBR_JCC   0x4 /* do not capture conditional branches */
 
#define PFM_NHM_LBR_NEAR_REL_CALL   0x8 /* do not capture near calls */
 
#define PFM_NHM_LBR_NEAR_IND_CALL   0x10 /* do not capture indirect calls */
 
#define PFM_NHM_LBR_NEAR_RET   0x20 /* do not capture near returns */
 
#define PFM_NHM_LBR_NEAR_IND_JMP   0x40 /* do not capture indirect jumps */
 
#define PFM_NHM_LBR_NEAR_REL_JMP   0x80 /* do not capture near relative jumps */
 
#define PFM_NHM_LBR_FAR_BRANCH   0x100/* do not capture far branches */
 
#define PFM_NHM_LBR_ALL   0x1fc /* filter out all branches */
 

Functions

int pfm_nhm_is_pebs (pfmlib_event_t *e)
 
int pfm_nhm_is_uncore (pfmlib_event_t *e)
 
int pfm_nhm_data_src_desc (unsigned int val, char **desc)
 

Macro Definition Documentation

◆ PFM_NHM_LBR_ALL

#define PFM_NHM_LBR_ALL   0x1fc /* filter out all branches */

Definition at line 125 of file pfmlib_intel_nhm.h.

◆ PFM_NHM_LBR_FAR_BRANCH

#define PFM_NHM_LBR_FAR_BRANCH   0x100/* do not capture far branches */

Definition at line 124 of file pfmlib_intel_nhm.h.

◆ PFM_NHM_LBR_JCC

#define PFM_NHM_LBR_JCC   0x4 /* do not capture conditional branches */

Definition at line 118 of file pfmlib_intel_nhm.h.

◆ PFM_NHM_LBR_NEAR_IND_CALL

#define PFM_NHM_LBR_NEAR_IND_CALL   0x10 /* do not capture indirect calls */

Definition at line 120 of file pfmlib_intel_nhm.h.

◆ PFM_NHM_LBR_NEAR_IND_JMP

#define PFM_NHM_LBR_NEAR_IND_JMP   0x40 /* do not capture indirect jumps */

Definition at line 122 of file pfmlib_intel_nhm.h.

◆ PFM_NHM_LBR_NEAR_REL_CALL

#define PFM_NHM_LBR_NEAR_REL_CALL   0x8 /* do not capture near calls */

Definition at line 119 of file pfmlib_intel_nhm.h.

◆ PFM_NHM_LBR_NEAR_REL_JMP

#define PFM_NHM_LBR_NEAR_REL_JMP   0x80 /* do not capture near relative jumps */

Definition at line 123 of file pfmlib_intel_nhm.h.

◆ PFM_NHM_LBR_NEAR_RET

#define PFM_NHM_LBR_NEAR_RET   0x20 /* do not capture near returns */

Definition at line 121 of file pfmlib_intel_nhm.h.

◆ PFM_NHM_SEL_ANYTHR

#define PFM_NHM_SEL_ANYTHR   0x4 /* any thread (core only) */

Definition at line 105 of file pfmlib_intel_nhm.h.

◆ PFM_NHM_SEL_EDGE

#define PFM_NHM_SEL_EDGE   0x2 /* edge detect */

Definition at line 104 of file pfmlib_intel_nhm.h.

◆ PFM_NHM_SEL_INV

#define PFM_NHM_SEL_INV   0x1 /* inverse */

Definition at line 103 of file pfmlib_intel_nhm.h.

◆ PFM_NHM_SEL_OCC_RST

#define PFM_NHM_SEL_OCC_RST   0x8 /* reset occupancy (uncore only) */

Definition at line 106 of file pfmlib_intel_nhm.h.

◆ PMU_NHM_NUM_COUNTERS

#define PMU_NHM_NUM_COUNTERS   16

Definition at line 48 of file pfmlib_intel_nhm.h.

Function Documentation

◆ pfm_nhm_data_src_desc()

int pfm_nhm_data_src_desc ( unsigned int  val,
char **  desc 
)

Definition at line 1604 of file pfmlib_intel_nhm.c.

1605{
1606 if (val > 15 || !desc)
1607 return PFMLIB_ERR_INVAL;
1608
1609 *desc = strdup(data_src_encodings[val]);
1610 if (!*desc)
1611 return PFMLIB_ERR_NOMEM;
1612
1613 return PFMLIB_SUCCESS;
1614}
#define PFMLIB_SUCCESS
Definition: pfmlib.h:283
#define PFMLIB_ERR_NOMEM
Definition: pfmlib.h:307
#define PFMLIB_ERR_INVAL
Definition: pfmlib.h:285
static const char * data_src_encodings[]

◆ pfm_nhm_is_pebs()

int pfm_nhm_is_pebs ( pfmlib_event_t e)

Definition at line 1534 of file pfmlib_intel_nhm.c.

1535{
1536 pme_nhm_entry_t *ne;
1537 unsigned int i, n=0;
1538
1539 if (e == NULL || e->event >= intel_nhm_support.pme_count)
1540 return PFMLIB_ERR_INVAL;
1541
1542 ne = get_nhm_entry(e->event);
1543 if (ne->pme_flags & PFMLIB_NHM_PEBS)
1544 return 1;
1545
1546 /*
1547 * ALL unit mask must support PEBS for this test to return true
1548 */
1549 for(i=0; i < e->num_masks; i++) {
1550 int midx;
1551 /* check for valid unit mask */
1552 if (e->unit_masks[i] >= ne->pme_numasks)
1553 return PFMLIB_ERR_INVAL;
1554 midx = pfm_nhm_midx2uidx(e->event, e->unit_masks[i]);
1555 if (ne->pme_umasks[midx].pme_uflags & PFMLIB_NHM_PEBS)
1556 n++;
1557 }
1558 return n > 0 && n == e->num_masks;
1559}
int i
pfm_pmu_support_t intel_nhm_support
static pme_nhm_entry_t * get_nhm_entry(unsigned int i)
static int pfm_nhm_midx2uidx(unsigned int ev, unsigned int midx)
#define PFMLIB_NHM_PEBS
unsigned int pme_count
Definition: pfmlib_priv.h:35
unsigned int num_masks
Definition: pfmlib.h:90
unsigned int unit_masks[PFMLIB_MAX_MASKS_PER_EVENT]
Definition: pfmlib.h:89
unsigned int event
Definition: pfmlib.h:86
pme_nhm_umask_t pme_umasks[PFMLIB_NHM_MAX_UMASK]
unsigned int pme_numasks
unsigned int pme_flags
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pfm_nhm_is_uncore()

int pfm_nhm_is_uncore ( pfmlib_event_t e)

Definition at line 1569 of file pfmlib_intel_nhm.c.

1570{
1571 if (PFMLIB_INITIALIZED() == 0)
1572 return 0;
1573
1574 if (e == NULL || e->event >= num_pe)
1575 return PFMLIB_ERR_INVAL;
1576
1578}
static unsigned int num_pe
#define PFMLIB_NHM_UNC
#define PFMLIB_NHM_UNC_FIXED
#define PFMLIB_INITIALIZED()
Definition: pfmlib_priv.h:72
Here is the call graph for this function: