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

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 12 of file PAPI_get_executable_info.c.

13{
14 int i,tmp=0;
15 int retval;
16 const PAPI_exe_info_t *prginfo = NULL;
17
18 /****************************************************************************
19 * This part initializes the library and compares the version number of the *
20 * header file, to the version of the library, if these don't match then it *
21 * is likely that PAPI won't work correctly.If there is an error, retval *
22 * keeps track of the version number. *
23 ****************************************************************************/
24
26 {
27 printf("Library initialization error! \n");
28 exit(1);
29 }
30
31
32 for(i=0;i<1000;i++)
33 tmp=tmp+i;
34
35 /* PAPI_get_executable_info returns a NULL if there is an error */
36 if ((prginfo = PAPI_get_executable_info()) == NULL)
37 {
38 printf("PAPI_get_executable_info error! \n");
39 exit(1);
40 }
41
42
43 printf("Start text addess of user program is at %p\n",
44 prginfo->address_info.text_start);
45 printf("End text address of user program is at %p\n",
46 prginfo->address_info.text_end);
47
48 exit(0);
49}
double tmp
int i
Get the executable's address space info.
initialize the PAPI library.
#define PAPI_VER_CURRENT
Definition: f90papi.h:54
vptr_t text_start
Definition: papi.h:686
vptr_t text_end
Definition: papi.h:687
get the executable's info
Definition: papi.h:696
PAPI_address_map_t address_info
Definition: papi.h:698
int retval
Definition: zero_fork.c:53