PAPI  5.4.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
init_fini.c File Reference
Include dependency graph for init_fini.c:

Go to the source code of this file.

Macros

#define NUM_EVENTS   6
 

Functions

 __attribute__ ((constructor))
 
 __attribute__ ((destructor))
 

Variables

static int Events [NUM_EVENTS]
 
static const char * names [NUM_EVENTS] = {"READ_CALLS", "READ_BYTES","READ_USEC","WRITE_CALLS","WRITE_BYTES","WRITE_USEC"}
 
static long long values [NUM_EVENTS]
 

Macro Definition Documentation

#define NUM_EVENTS   6

Definition at line 7 of file init_fini.c.

Function Documentation

__attribute__ ( (constructor)  )

Definition at line 12 of file init_fini.c.

12  {
13  //fprintf(stderr, "appio: constructor started\n");
15  if (version != PAPI_VER_CURRENT) {
16  fprintf(stderr, "PAPI_library_init version mismatch\n");
17  exit(1);
18  }
19  else {
20  fprintf(stderr, "appio: PAPI library initialized\n");
21  }
22  int retval;
23  int e;
24  for (e=0; e<NUM_EVENTS; e++) {
25  retval = PAPI_event_name_to_code((char*)names[e], &Events[e]);
26  if (retval != PAPI_OK) {
27  fprintf(stderr, "Error getting code for %s\n", names[e]);
28  exit(2);
29  }
30  }
31 
32  /* Start counting events */
33  fprintf(stderr, "appio: starting PAPI counters; main program will follow\n");
34  if (PAPI_start_counters(Events, NUM_EVENTS) != PAPI_OK) {
35  fprintf(stderr, "Error in PAPI_start_counters\n");
36  exit(1);
37  }
38  return;
39 }
static int Events[NUM_EVENTS]
Definition: init_fini.c:8
return PAPI_OK
Definition: linux-nvml.c:458
int PAPI_library_init(int version)
Definition: papi.c:497
char version[]
Definition: fileop.c:134
int PAPI_event_name_to_code(char *in, int *out)
Definition: papi.c:1010
int PAPI_start_counters(int *events, int array_len)
Definition: papi_hl.c:593
ssize_t retval
Definition: libasync.c:338
#define PAPI_VER_CURRENT
Definition: papi.h:223
const char * names[NUM_EVENTS]
void exit()
#define NUM_EVENTS
Definition: init_fini.c:7

Here is the call graph for this function:

__attribute__ ( (destructor)  )

Definition at line 41 of file init_fini.c.

41  {
42  int e;
43  //fprintf(stderr, "appio: destructor called\n");
45  fprintf(stderr, "Error in PAPI_stop_counters\n");
46  }
47  fprintf(stderr, "\nappio: PAPI counts (for pid=%6d)\n"
48  "appio: ----------------------------\n", (int)getpid());
49  for (e=0; e<NUM_EVENTS; e++)
50  fprintf(stderr, "appio: %s : %lld\n", names[e], values[e]);
51  return;
52 }
return PAPI_OK
Definition: linux-nvml.c:458
int PAPI_stop_counters(long long *values, int array_len)
Definition: papi_hl.c:803
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
const char * names[NUM_EVENTS]
#define NUM_EVENTS
Definition: init_fini.c:7

Here is the call graph for this function:

Variable Documentation

int Events[NUM_EVENTS]
static

Definition at line 8 of file init_fini.c.

const char* names[NUM_EVENTS] = {"READ_CALLS", "READ_BYTES","READ_USEC","WRITE_CALLS","WRITE_BYTES","WRITE_USEC"}
static

Definition at line 9 of file init_fini.c.

long long values[NUM_EVENTS]
static

Definition at line 10 of file init_fini.c.