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

Go to the source code of this file.

Data Structures

struct  pfm_pmu_support_t
 
struct  pfm_config_t
 

Macros

#define PFMLIB_MULT_CODE_EVENT   0x1 /* more than one code per event (depending on counter) */
 
#define PFMLIB_CNT_FIRST   -1 /* return code for event on first counter */
 
#define PFMLIB_NO_EVT   (~0U) /* no event index associated with event */
 
#define PFMLIB_INITIALIZED()   (pfm_config.current != NULL)
 
#define PFMLIB_DEBUG()   pfm_config.options.pfm_debug
 
#define PFMLIB_VERBOSE()   pfm_config.options.pfm_verbose
 
#define pfm_current   pfm_config.current
 
#define DPRINT(fmt, a...)
 
#define ALIGN_DOWN(a, p)   ((a) & ~((1UL<<(p))-1))
 
#define ALIGN_UP(a, p)   ((((a) + ((1UL<<(p))-1))) & ~((1UL<<(p))-1))
 

Functions

void __pfm_vbprintf (const char *fmt,...)
 
int __pfm_check_event (pfmlib_event_t *e)
 
int __pfm_getcpuinfo_attr (const char *attr, char *ret_buf, size_t maxlen)
 
void pfm_init_syscalls (void)
 
static unsigned int pfm_num_masks (int e)
 
static int _pfmlib_get_sys_base ()
 

Variables

pfm_config_t pfm_config
 
pfm_pmu_support_t crayx2_support
 
pfm_pmu_support_t montecito_support
 
pfm_pmu_support_t itanium2_support
 
pfm_pmu_support_t itanium_support
 
pfm_pmu_support_t generic_ia64_support
 
pfm_pmu_support_t amd64_support
 
pfm_pmu_support_t i386_p6_support
 
pfm_pmu_support_t i386_ppro_support
 
pfm_pmu_support_t i386_pii_support
 
pfm_pmu_support_t i386_pm_support
 
pfm_pmu_support_t gen_ia32_support
 
pfm_pmu_support_t generic_mips64_support
 
pfm_pmu_support_t sicortex_support
 
pfm_pmu_support_t pentium4_support
 
pfm_pmu_support_t coreduo_support
 
pfm_pmu_support_t core_support
 
pfm_pmu_support_t gen_powerpc_support
 
pfm_pmu_support_t sparc_support
 
pfm_pmu_support_t cell_support
 
pfm_pmu_support_t intel_atom_support
 
pfm_pmu_support_t intel_nhm_support
 
pfm_pmu_support_t intel_wsm_support
 
FILE * libpfm_fp
 
int forced_pmu
 
int _pfmlib_sys_base
 
int _pfmlib_major_version
 
int _pfmlib_minor_version
 

Macro Definition Documentation

◆ ALIGN_DOWN

#define ALIGN_DOWN (   a,
 
)    ((a) & ~((1UL<<(p))-1))

Definition at line 99 of file pfmlib_priv.h.

◆ ALIGN_UP

#define ALIGN_UP (   a,
 
)    ((((a) + ((1UL<<(p))-1))) & ~((1UL<<(p))-1))

Definition at line 100 of file pfmlib_priv.h.

◆ DPRINT

#define DPRINT (   fmt,
  a... 
)
Value:
do { \
fprintf(libpfm_fp, "%s (%s.%d): " fmt, __FILE__, __func__, __LINE__, ## a); } \
} while (0)
static double a[MATRIX_SIZE][MATRIX_SIZE]
Definition: libmsr_basic.c:38
pfm_config_t pfm_config
FILE * libpfm_fp
Definition: pfmlib_priv.c:42
const char * fmt
Definition: pscanf.h:10
pfmlib_options_t options
Definition: pfmlib_priv.h:67
unsigned int pfm_debug
Definition: pfmlib.h:138

Definition at line 90 of file pfmlib_priv.h.

◆ pfm_current

#define pfm_current   pfm_config.current

Definition at line 78 of file pfmlib_priv.h.

◆ PFMLIB_CNT_FIRST

#define PFMLIB_CNT_FIRST   -1 /* return code for event on first counter */

Definition at line 62 of file pfmlib_priv.h.

◆ PFMLIB_DEBUG

#define PFMLIB_DEBUG ( )    pfm_config.options.pfm_debug

Definition at line 76 of file pfmlib_priv.h.

◆ PFMLIB_INITIALIZED

#define PFMLIB_INITIALIZED ( )    (pfm_config.current != NULL)

Definition at line 72 of file pfmlib_priv.h.

◆ PFMLIB_MULT_CODE_EVENT

#define PFMLIB_MULT_CODE_EVENT   0x1 /* more than one code per event (depending on counter) */

Definition at line 60 of file pfmlib_priv.h.

◆ PFMLIB_NO_EVT

#define PFMLIB_NO_EVT   (~0U) /* no event index associated with event */

Definition at line 64 of file pfmlib_priv.h.

◆ PFMLIB_VERBOSE

#define PFMLIB_VERBOSE ( )    pfm_config.options.pfm_verbose

Definition at line 77 of file pfmlib_priv.h.

Function Documentation

◆ __pfm_check_event()

int __pfm_check_event ( pfmlib_event_t e)

Definition at line 65 of file pfmlib_priv.c.

66{
67 unsigned int n, j;
68
69 if (e->event >= pfm_current->pme_count)
70 return PFMLIB_ERR_INVAL;
71
72 n = pfm_num_masks(e->event);
73 if (n == 0 && e->num_masks)
74 return PFMLIB_ERR_UMASK;
75
76 for(j=0; j < e->num_masks; j++) {
77 if (e->unit_masks[j] >= n)
78 return PFMLIB_ERR_UMASK;
79 }
80 /*
81 * if event has umask, but non specified by user, then
82 * return:
83 * - error if no default umask is defined
84 * - success if default umask exists for event
85 */
86 if (n && j == 0) {
87 if (pfm_current->has_umask_default
88 && pfm_current->has_umask_default(e->event))
89 return PFMLIB_SUCCESS;
90 return PFMLIB_ERR_UMASK;
91 }
92 return PFMLIB_SUCCESS;
93}
#define PFMLIB_ERR_UMASK
Definition: pfmlib.h:306
#define PFMLIB_SUCCESS
Definition: pfmlib.h:283
#define PFMLIB_ERR_INVAL
Definition: pfmlib.h:285
#define pfm_current
Definition: pfmlib_priv.h:78
static unsigned int pfm_num_masks(int e)
Definition: pfmlib_priv.h:125
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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __pfm_getcpuinfo_attr()

int __pfm_getcpuinfo_attr ( const char *  attr,
char *  ret_buf,
size_t  maxlen 
)

Definition at line 59 of file pfmlib_os_linux.c.

60{
61
62 int ret = 0;
63 return ret;
64}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __pfm_vbprintf()

void __pfm_vbprintf ( const char *  fmt,
  ... 
)

Definition at line 52 of file pfmlib_priv.c.

53{
54 va_list ap;
55
57 return;
58
59 va_start(ap, fmt);
60 vfprintf(libpfm_fp, fmt, ap);
61 va_end(ap);
62}
__gnuc_va_list va_list
pfm_config_t pfm_config
FILE * libpfm_fp
Definition: pfmlib_priv.c:42
va_end(arg_list)
va_start(arg_list, fmt)
unsigned int pfm_verbose
Definition: pfmlib.h:139
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _pfmlib_get_sys_base()

static int _pfmlib_get_sys_base ( )
inlinestatic

Definition at line 140 of file pfmlib_priv.h.

141{
142 if (!_pfmlib_sys_base)
144 return _pfmlib_sys_base;
145}
void pfm_init_syscalls(void)
int _pfmlib_sys_base
Here is the call graph for this function:

◆ pfm_init_syscalls()

void pfm_init_syscalls ( void  )

Definition at line 86 of file pfmlib_os_linux.c.

87{
88}
Here is the caller graph for this function:

◆ pfm_num_masks()

static unsigned int pfm_num_masks ( int  e)
inlinestatic

Definition at line 125 of file pfmlib_priv.h.

126{
127 if (pfm_current->get_num_event_masks == NULL)
128 return 0;
129 return pfm_current->get_num_event_masks(e);
130}
Here is the caller graph for this function:

Variable Documentation

◆ _pfmlib_major_version

int _pfmlib_major_version
extern

Definition at line 42 of file pfmlib_os_linux.c.

◆ _pfmlib_minor_version

int _pfmlib_minor_version
extern

Definition at line 43 of file pfmlib_os_linux.c.

◆ _pfmlib_sys_base

int _pfmlib_sys_base
extern

Definition at line 41 of file pfmlib_os_linux.c.

◆ amd64_support

pfm_pmu_support_t amd64_support
extern

Definition at line 98 of file pfmlib_amd64.c.

◆ cell_support

pfm_pmu_support_t cell_support
extern

Definition at line 675 of file pfmlib_cell.c.

◆ core_support

pfm_pmu_support_t core_support
extern

Definition at line 903 of file pfmlib_core.c.

◆ coreduo_support

pfm_pmu_support_t coreduo_support
extern

Definition at line 493 of file pfmlib_coreduo.c.

◆ crayx2_support

pfm_pmu_support_t crayx2_support
extern

Definition at line 482 of file pfmlib_crayx2.c.

◆ forced_pmu

int forced_pmu
extern

Definition at line 108 of file pfmlib_common.c.

◆ gen_ia32_support

pfm_pmu_support_t gen_ia32_support
extern

Definition at line 889 of file pfmlib_gen_ia32.c.

◆ gen_powerpc_support

pfm_pmu_support_t gen_powerpc_support
extern

gen_powerpc_support

Definition at line 832 of file pfmlib_gen_powerpc.c.

◆ generic_ia64_support

pfm_pmu_support_t generic_ia64_support
extern

Definition at line 491 of file pfmlib_gen_ia64.c.

◆ generic_mips64_support

pfm_pmu_support_t generic_mips64_support
extern

Definition at line 52 of file pfmlib_gen_mips64.c.

◆ i386_p6_support

pfm_pmu_support_t i386_p6_support
extern

Definition at line 593 of file pfmlib_i386_p6.c.

◆ i386_pii_support

pfm_pmu_support_t i386_pii_support
extern

Definition at line 566 of file pfmlib_i386_p6.c.

◆ i386_pm_support

pfm_pmu_support_t i386_pm_support
extern

Definition at line 647 of file pfmlib_i386_p6.c.

◆ i386_ppro_support

pfm_pmu_support_t i386_ppro_support
extern

Definition at line 619 of file pfmlib_i386_p6.c.

◆ intel_atom_support

pfm_pmu_support_t intel_atom_support
extern

Definition at line 780 of file pfmlib_intel_atom.c.

◆ intel_nhm_support

pfm_pmu_support_t intel_nhm_support
extern

Definition at line 132 of file pfmlib_intel_nhm.c.

◆ intel_wsm_support

pfm_pmu_support_t intel_wsm_support
extern

Definition at line 133 of file pfmlib_intel_nhm.c.

◆ itanium2_support

pfm_pmu_support_t itanium2_support
extern

Definition at line 2136 of file pfmlib_itanium2.c.

◆ itanium_support

pfm_pmu_support_t itanium_support
extern

Definition at line 1195 of file pfmlib_itanium.c.

◆ libpfm_fp

FILE* libpfm_fp
extern

Definition at line 42 of file pfmlib_priv.c.

◆ montecito_support

pfm_pmu_support_t montecito_support
extern

Definition at line 2441 of file pfmlib_montecito.c.

◆ pentium4_support

pfm_pmu_support_t pentium4_support
extern

pentium4_support

Definition at line 720 of file pfmlib_pentium4.c.

◆ pfm_config

pfm_config_t pfm_config
extern

Definition at line 104 of file pfmlib_common.c.

◆ sicortex_support

pfm_pmu_support_t sicortex_support
extern

Definition at line 706 of file pfmlib_sicortex.c.

◆ sparc_support

pfm_pmu_support_t sparc_support
extern

sparc_support

Definition at line 519 of file pfmlib_sparc.c.