PAPI  5.3.2.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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

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 }
caddr_t text_end
Definition: papi.h:693
get the executable&#39;s info
Definition: papi.h:702
#define printf
Definition: papi_test.h:125
int PAPI_library_init(int version)
Definition: papi.c:495
int i
Definition: fileop.c:140
const PAPI_exe_info_t * PAPI_get_executable_info(void)
Definition: papi.c:5988
caddr_t text_start
Definition: papi.h:692
PAPI_address_map_t address_info
Definition: papi.h:704
#define PAPI_VER_CURRENT
Definition: fpapi.h:14
ssize_t retval
Definition: libasync.c:338
long long tmp
Definition: iozone.c:12031
void exit()

Here is the call graph for this function: