exeinfo.c File Reference

Include dependency graph for exeinfo.c:

Go to the source code of this file.

Functions

int main (int argc, char **argv)

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 14 of file exeinfo.c.

00015 {
00016     int retval;
00017 
00018     const PAPI_exe_info_t *exeinfo;
00019 
00020     tests_quiet( argc, argv );  /* Set TESTS_QUIET variable */
00021 
00022     if ( ( retval =
00023            PAPI_library_init( PAPI_VER_CURRENT ) ) != PAPI_VER_CURRENT )
00024         test_fail( __FILE__, __LINE__, "PAPI_library_init", retval );
00025 
00026     if ( ( exeinfo = PAPI_get_executable_info(  ) ) == NULL )
00027         test_fail( __FILE__, __LINE__, "PAPI_get_executable_info", retval );
00028 
00029     printf( "Path+Program: %s\n", exeinfo->fullname );
00030     printf( "Program: %s\n", exeinfo->address_info.name );
00031     printf( "Text start: %p, Text end: %p\n", exeinfo->address_info.text_start,
00032             exeinfo->address_info.text_end );
00033     printf( "Data start: %p, Data end: %p\n", exeinfo->address_info.data_start,
00034             exeinfo->address_info.data_end );
00035     printf( "Bss start: %p, Bss end: %p\n", exeinfo->address_info.bss_start,
00036             exeinfo->address_info.bss_end );
00037 
00038     if ( ( strlen( &(exeinfo->fullname[0]) ) == 0 ) )
00039         test_fail( __FILE__, __LINE__, "PAPI_get_executable_info", 1 );
00040     if ( ( strlen( &(exeinfo->address_info.name[0]) ) == 0 ) )
00041         test_fail( __FILE__, __LINE__, "PAPI_get_executable_info", 1 );
00042     if ( ( exeinfo->address_info.text_start == 0x0 ) ||
00043          ( exeinfo->address_info.text_end == 0x0 ) ||
00044          ( exeinfo->address_info.text_start >=
00045            exeinfo->address_info.text_end ) )
00046         test_fail( __FILE__, __LINE__, "PAPI_get_executable_info", 1 );
00047     if ( ( exeinfo->address_info.data_start == 0x0 ) ||
00048          ( exeinfo->address_info.data_end == 0x0 ) ||
00049          ( exeinfo->address_info.data_start >=
00050            exeinfo->address_info.data_end ) )
00051         test_fail( __FILE__, __LINE__, "PAPI_get_executable_info", 1 );
00052 /*
00053    if ((exeinfo->address_info.bss_start == 0x0) || (exeinfo->address_info.bss_end == 0x0) ||
00054        (exeinfo->address_info.bss_start >= exeinfo->address_info.bss_end))
00055      test_fail(__FILE__, __LINE__, "PAPI_get_executable_info",1);
00056 */
00057 
00058     sleep( 1 );              /* Needed for debugging, so you can ^Z and stop the process, inspect /proc to see if it's right */
00059 
00060     test_pass( __FILE__, NULL, 0 );
00061     exit( 0 );
00062 }

Here is the call graph for this function:


Generated on 26 Jan 2016 for PAPI by  doxygen 1.6.1