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

Go to the source code of this file.

Functions

void __pfm_vbprintf (const char *fmt,...)
 
int __pfm_check_event (pfmlib_event_t *e)
 

Variables

FILE * libpfm_fp
 

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_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
const char * fmt
Definition: pscanf.h:10
va_end(arg_list)
va_start(arg_list, fmt)
pfmlib_options_t options
Definition: pfmlib_priv.h:67
unsigned int pfm_verbose
Definition: pfmlib.h:139
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ libpfm_fp

FILE* libpfm_fp

Definition at line 42 of file pfmlib_priv.c.