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

Go to the source code of this file.

Functions

void instr_driver (char *papi_event_name, hw_desc_t *hw_desc, char *outdir)
 

Function Documentation

◆ instr_driver()

void instr_driver ( char *  papi_event_name,
hw_desc_t hw_desc,
char *  outdir 
)

Definition at line 1308 of file instructions.c.

1309{
1310 int retval = PAPI_OK;
1311 int EventSet = PAPI_NULL;
1312 FILE* ofp_papi;
1313 const char *sufx = ".instr";
1314 char *papiFileName;
1315
1316 (void)hw_desc;
1317
1318 int l = strlen(outdir)+strlen(papi_event_name)+strlen(sufx);
1319 if (NULL == (papiFileName = (char *)calloc( 1+l, sizeof(char)))) {
1320 return;
1321 }
1322 if (l != (sprintf(papiFileName, "%s%s%s", outdir, papi_event_name, sufx))) {
1323 goto error0;
1324 }
1325 if (NULL == (ofp_papi = fopen(papiFileName,"w"))) {
1326 fprintf(stderr, "Failed to open file %s.\n", papiFileName);
1327 goto error0;
1328 }
1329
1331 if (retval != PAPI_OK ){
1332 goto error1;
1333 }
1334
1335 retval = PAPI_add_named_event( EventSet, papi_event_name );
1336 if (retval != PAPI_OK ){
1337 goto error1;
1338 }
1339
1340 retval = PAPI_OK;
1341
1342 instr_test(EventSet, ofp_papi);
1343
1345 if (retval != PAPI_OK ){
1346 goto error1;
1347 }
1349 if (retval != PAPI_OK ){
1350 goto error1;
1351 }
1352
1353error1:
1354 fclose(ofp_papi);
1355error0:
1356 free(papiFileName);
1357 return;
1358}
add PAPI preset or native hardware event by name to an EventSet
Empty and destroy an EventSet.
Create a new empty PAPI EventSet.
Empty and destroy an EventSet.
#define PAPI_OK
Definition: f90papi.h:73
#define PAPI_NULL
Definition: f90papi.h:78
static int EventSet
Definition: init_fini.c:8
void instr_test(int EventSet, FILE *fp)
FILE * stderr
int fclose(FILE *__stream)
int retval
Definition: zero_fork.c:53
Here is the call graph for this function:
Here is the caller graph for this function: