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.

00013 {
00014    int i,tmp=0;   
00015    int retval;
00016    const PAPI_exe_info_t *prginfo = NULL;
00017 
00018    /****************************************************************************
00019    *  This part initializes the library and compares the version number of the *
00020    * header file, to the version of the library, if these don't match then it  *
00021    * is likely that PAPI won't work correctly.If there is an error, retval     *
00022    * keeps track of the version number.                                        *
00023    ****************************************************************************/
00024 
00025    if((retval = PAPI_library_init(PAPI_VER_CURRENT)) != PAPI_VER_CURRENT )
00026    {
00027       printf("Library initialization error! \n");
00028       exit(1);
00029    }
00030     
00031 
00032    for(i=0;i<1000;i++)
00033       tmp=tmp+i;
00034     
00035    /* PAPI_get_executable_info returns a NULL if there is an error */    
00036    if ((prginfo = PAPI_get_executable_info()) == NULL)
00037    {
00038       printf("PAPI_get_executable_info error! \n");
00039       exit(1);
00040    }
00041 
00042   
00043    printf("Start text addess of user program is at %p\n",
00044               prginfo->address_info.text_start);
00045    printf("End text address of user program is at %p\n",
00046               prginfo->address_info.text_end);
00047 
00048    exit(0);
00049 }

Here is the call graph for this function:


Generated on 26 Jan 2016 for PAPI by  doxygen 1.6.1