decode.c File Reference

Include dependency graph for decode.c:

Go to the source code of this file.

Functions

static void print_help (void)
int main (int argc, char **argv)

Variables

int TESTS_QUIET

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 61 of file decode.c.

00062 {
00063     int i, j;
00064     int retval;
00065     int print_avail_only = 0;
00066     PAPI_event_info_t info;
00067 
00068     tests_quiet( argc, argv );  /* Set TESTS_QUIET variable */
00069     for ( i = 1; i < argc; i++ )
00070         if ( argv[i] ) {
00071             if ( !strcmp( argv[i], "-a" ) )
00072                 print_avail_only = PAPI_PRESET_ENUM_AVAIL;
00073             else if ( !strcmp( argv[i], "-h" ) ) {
00074                 print_help(  );
00075                 exit( 1 );
00076             } else {
00077                 print_help(  );
00078                 exit( 1 );
00079             }
00080         }
00081 
00082     retval = PAPI_library_init( PAPI_VER_CURRENT );
00083     if ( retval != PAPI_VER_CURRENT )
00084         test_fail( __FILE__, __LINE__, "PAPI_library_init", retval );
00085 
00086     if ( !TESTS_QUIET ) {
00087         retval = PAPI_set_debug( PAPI_VERB_ECONT );
00088         if ( retval != PAPI_OK )
00089             test_fail( __FILE__, __LINE__, "PAPI_set_debug", retval );
00090     }
00091 
00092     i = PAPI_PRESET_MASK;
00093     printf
00094         ( "name,derived,postfix,short_descr,long_descr,note,[native,...]\n\n" );
00095 
00096     do {
00097         if ( PAPI_get_event_info( i, &info ) == PAPI_OK ) {
00098             printf( "%s,%s,%s,", info.symbol, info.derived, info.postfix );
00099             if ( info.short_descr[0] ) {
00100                 printf( "\"%s\",", info.short_descr );
00101             } else {
00102                 printf( "," );
00103             }
00104             if ( info.long_descr[0] ) {
00105                 printf( "\"%s\",", info.long_descr );
00106             } else {
00107                 printf( "," );
00108             }
00109             if ( info.note[0] )
00110                 printf( "\"%s\"", info.note );
00111 
00112             for ( j = 0; j < ( int ) info.count; j++ )
00113                 printf( ",%s", info.name[j] );
00114             printf( "\n" );
00115         }
00116     } while ( PAPI_enum_event( &i, print_avail_only ) == PAPI_OK );
00117     exit( 1 );
00118 }

Here is the call graph for this function:

static void print_help ( void   )  [static]

Definition at line 44 of file decode.c.

00045 {
00046     printf( "This is the PAPI decode utility program.\n" );
00047     printf( "It decodes PAPI preset events into csv formatted text.\n" );
00048     printf( "By default all presets are decoded.\n" );
00049     printf( "The text goes to stdout, but can be piped to a file.\n" );
00050     printf( "Such a file can be edited in a text editor or spreadsheet.\n" );
00051     printf( "It can also be parsed by PAPI_encode_events.\n" );
00052     printf( "Usage:\n\n" );
00053     printf( "    decode [options]\n\n" );
00054     printf( "Options:\n\n" );
00055     printf( "  -a            decode only available PAPI preset events\n" );
00056     printf( "  -h            print this help message\n" );
00057     printf( "\n" );
00058 }

Here is the caller graph for this function:


Variable Documentation

Definition at line 11 of file test_utils.c.


Generated on 17 Nov 2016 for PAPI by  doxygen 1.6.1