35typedef struct command_flags
48 printf(
"This is the PAPI component avail program.\n" );
49 printf(
"It provides availability of installed PAPI components.\n" );
50 printf(
"Usage: %s [options]\n", argv[0] );
51 printf(
"Options:\n\n" );
52 printf(
" --help, -h print this help message\n" );
53 printf(
" -d print detailed information on each component\n" );
63 for (
i = 1;
i < argc;
i++ ) {
64 if ( !strcmp( argv[
i],
"-d" ) ) {
66 }
else if ( !strcmp( argv[
i],
"-h" ) || !strcmp( argv[
i],
"--help" ) )
69 printf(
"%s is not supported\n", argv[
i] );
81main(
int argc,
char **argv )
93 fprintf(
stderr,
"Error! PAPI_library_init\n");
101 fprintf(
stderr,
"Error! PAPI_set_debug\n");
106 "hardware information.\n", &hwinfo );
108 fprintf(
stderr,
"Error! PAPI_get_hardware_info\n");
115 printf(
"Compiled-in components:\n");
116 for ( cid = 0; cid < numcmp; cid++ ) {
129 printf(
" %-23s Version:\t\t\t%s\n",
" ", cmpinfo->
version );
130 printf(
" %-23s Number of native events:\t%d\n",
" ", cmpinfo->
num_native_events);
131 printf(
" %-23s Number of preset events:\t%d\n",
" ", cmpinfo->
num_preset_events);
136 printf(
"\nActive components:\n");
139 for ( cid = 0; cid < numcmp; cid++ ) {
144 printf(
" %-23s Native: %d, Preset: %d, Counters: %d\n",
153 printf(
" %-23s PMUs supported: ",
" ");
154 int line_len = 48, name_len;
160 if ((line_len + 2 + name_len) > 130) {
161 printf(
"\n %-23s ",
" ");
171 line_len += name_len;
180 printf(
" %-23s Version:\t\t\t%s\n",
" ", cmpinfo->
version );
188 (
"\n--------------------------------------------------------------------------------\n" );
Enumerate PAPI preset or native events for a given component.
get information about a specific software component
initialize the PAPI library.
Get the number of components available on the system.
Set the current debug level for error output from PAPI.
Return codes and api definitions.
static void force_cmp_init(int cid)
static void parse_args(int argc, char **argv, command_flags_t *f)
static void print_help(void)
char description[PAPI_MAX_STR_LEN]
unsigned int fast_counter_read
char name[PAPI_MAX_STR_LEN]
char disabled_reason[PAPI_HUGE_STR_LEN]
char version[PAPI_MIN_STR_LEN]
char * pmu_names[PAPI_PMU_MAX]