|
PAPI
5.0.1.0
|
00001 /* 00002 * This utility loops through all the PAPI error codes and displays them in 00003 table format 00004 */ 00005 00031 #include "papi_test.h" 00032 extern int _papi_hwi_num_errors; 00033 00034 int 00035 main( int argc, char **argv ) 00036 { 00037 int i; 00038 int retval; 00039 00040 tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */ 00041 00042 if ( ( retval = 00043 PAPI_library_init( PAPI_VER_CURRENT ) ) != PAPI_VER_CURRENT ) 00044 test_fail( __FILE__, __LINE__, "PAPI_library_init", retval ); 00045 00046 00047 printf( "\n----------------------------------\n" ); 00048 printf( "For PAPI Version: %d.%d.%d.%d\n", 00049 PAPI_VERSION_MAJOR( PAPI_VERSION ), 00050 PAPI_VERSION_MINOR( PAPI_VERSION ), 00051 PAPI_VERSION_REVISION( PAPI_VERSION ), 00052 PAPI_VERSION_INCREMENT( PAPI_VERSION ) ); 00053 printf( "There are %d error codes defined\n", _papi_hwi_num_errors ); 00054 printf( "----------------------------------\n" ); 00055 for (i = 0; i < _papi_hwi_num_errors; i++) { 00056 char *errstr; 00057 errstr = PAPI_strerror( -i ); 00058 printf( "Error code %4d: %s\n", -i, errstr ); 00059 } 00060 printf( "----------------------------------\n\n" ); 00061 exit( 1 ); 00062 }