35 typedef struct command_flags
46 printf(
"This is the PAPI component avail program.\n" );
47 printf(
"It provides availability of installed PAPI components.\n" );
48 printf(
"Usage: %s [options]\n", argv[0] );
49 printf(
"Options:\n\n" );
50 printf(
" --help, -h print this help message\n" );
51 printf(
" -d print detailed information on each component\n" );
61 for (
i = 1;
i < argc;
i++ ) {
62 if ( !strcmp( argv[
i],
"-d" ) ) {
64 }
else if ( !strcmp( argv[
i],
"-h" ) || !strcmp( argv[
i],
"--help" ) )
67 printf(
"%s is not supported\n", argv[
i] );
79 main(
int argc,
char **argv )
91 fprintf(stderr,
"Error! PAPI_library_init\n");
99 fprintf(stderr,
"Error! PAPI_set_debug\n");
104 "hardware information.\n", &hwinfo );
106 fprintf(stderr,
"Error! PAPI_get_ahrdware_info\n");
113 printf(
"Compiled-in components:\n");
114 for ( cid = 0; cid < numcmp; cid++ ) {
124 printf(
" %-23s Version:\t\t\t%s\n",
" ", cmpinfo->
version );
125 printf(
" %-23s Number of native events:\t%d\n",
" ", cmpinfo->
num_native_events);
126 printf(
" %-23s Number of preset events:\t%d\n",
" ", cmpinfo->
num_preset_events);
131 printf(
"\nActive components:\n");
134 for ( cid = 0; cid < numcmp; cid++ ) {
139 printf(
" %-23s Native: %d, Preset: %d, Counters: %d\n",
141 printf(
" %-23s PMUs supported: ",
" ");
146 if (line_len + strlen(cmpinfo->
pmu_names[
i]) > 130) {
147 printf(
"\n %-23s ",
" ");
153 if ((
i != 0) && (line_len > 50)) {
161 printf(
" %-23s Version:\t\t\t%s\n",
" ", cmpinfo->
version );
169 (
"\n--------------------------------------------------------------------------------\n" );
char disabled_reason[PAPI_MAX_STR_LEN]
const PAPI_component_info_t * PAPI_get_component_info(int cidx)
int PAPI_num_components(void)
Return codes and api definitions.
int PAPI_library_init(int version)
static void print_help(char **argv)
static void parse_args(int argc, char **argv, command_flags_t *f)
unsigned int fast_counter_read
int main(int argc, char **argv)
char name[PAPI_MAX_STR_LEN]
char description[PAPI_MAX_STR_LEN]
char * pmu_names[PAPI_PMU_MAX]
char version[PAPI_MIN_STR_LEN]
int PAPI_set_debug(int level)