49 printf(
"This is the PAPI decode utility program.\n" );
50 printf(
"It decodes PAPI preset events into csv formatted text.\n" );
51 printf(
"By default all presets are decoded.\n" );
52 printf(
"The text goes to stdout, but can be piped to a file.\n" );
53 printf(
"Such a file can be edited in a text editor or spreadsheet.\n" );
54 printf(
"It can also be parsed by PAPI_encode_events.\n" );
55 printf(
"Usage:\n\n" );
56 printf(
" decode [options]\n\n" );
57 printf(
"Options:\n\n" );
58 printf(
" -a decode only available PAPI preset events\n" );
59 printf(
" -h print this help message\n" );
64main(
int argc,
char **argv )
68 int print_avail_only = 0;
74 for (
i = 1;
i < argc;
i++ )
76 if ( !strcmp( argv[
i],
"-a" ) )
78 else if ( !strcmp( argv[
i],
"-h" ) ) {
89 fprintf(
stderr,
"Error with PAPI_library_init!\n");
95 fprintf(
stderr,
"Error with PAPI_set_debug\n");
101 (
"name,derived,postfix,short_descr,long_descr,note,[native,...]\n\n" );
117 printf(
"\"%s\"", info.
note );
119 for ( j = 0; j < (
int ) info.
count; j++ )
120 printf(
",%s", info.
name[j] );
Enumerate PAPI preset or native events.
Get the event's name and description info.
initialize the PAPI library.
Set the current debug level for error output from PAPI.
Return codes and api definitions.
static void print_help(void)
char name[PAPI_MAX_INFO_TERMS][PAPI_2MAX_STR_LEN]
char postfix[PAPI_2MAX_STR_LEN]
char note[PAPI_HUGE_STR_LEN]
char short_descr[PAPI_MIN_STR_LEN]
char symbol[PAPI_HUGE_STR_LEN]
char derived[PAPI_MIN_STR_LEN]
char long_descr[PAPI_HUGE_STR_LEN]