|
PAPI
5.0.1.0
|

Go to the source code of this file.
Functions | |
| int | main () |
| int main | ( | ) |
Definition at line 12 of file PAPI_get_executable_info.c.
{
int i,tmp=0;
int retval;
const PAPI_exe_info_t *prginfo = NULL;
/****************************************************************************
* This part initializes the library and compares the version number of the *
* header file, to the version of the library, if these don't match then it *
* is likely that PAPI won't work correctly.If there is an error, retval *
* keeps track of the version number. *
****************************************************************************/
if((retval = PAPI_library_init(PAPI_VER_CURRENT)) != PAPI_VER_CURRENT )
{
printf("Library initialization error! \n");
exit(1);
}
for(i=0;i<1000;i++)
tmp=tmp+i;
/* PAPI_get_executable_info returns a NULL if there is an error */
if ((prginfo = PAPI_get_executable_info()) == NULL)
{
printf("PAPI_get_executable_info error! \n");
exit(1);
}
printf("Start text addess of user program is at %p\n",
prginfo->address_info.text_start);
printf("End text address of user program is at %p\n",
prginfo->address_info.text_end);
exit(0);
}
