PAPI  5.4.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cmpinfo.c
Go to the documentation of this file.
1 /*
2 * File: cmpinfo.c
3 * Author: Philip Mucci
4 * mucci@cs.utk.edu
5 * Mods: <your name here>
6 * <your email address>
7 */
8 #include <stdlib.h>
9 #include <stdio.h>
10 #include "papi_test.h"
11 
12 int
13 main( int argc, char **argv )
14 {
15  int retval;
16 
17  const PAPI_component_info_t *cmpinfo;
18 
19  tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */
20 
21  if ( ( retval =
23  test_fail( __FILE__, __LINE__, "PAPI_library_init", retval );
24 
25  if ( ( cmpinfo = PAPI_get_component_info( 0 ) ) == NULL )
26  test_fail( __FILE__, __LINE__, "PAPI_get_component_info", retval );
27 
28  printf( "name: %s\n", cmpinfo->name );
29  printf( "component_version: %s\n", cmpinfo->version );
30  printf( "support_version: %s\n", cmpinfo->support_version );
31  printf( "kernel_version: %s\n", cmpinfo->kernel_version );
32  printf( "num_cntrs: %d\n", cmpinfo->num_cntrs );
33  printf( "num_mpx_cntrs: %d\n", cmpinfo->num_mpx_cntrs );
34  printf( "num_preset_events: %d\n", cmpinfo->num_preset_events ); /* Number of counters the component supports */
35  printf( "num_native_events: %d\n", cmpinfo->num_native_events ); /* Number of counters the component supports */
36  printf( "default_domain: %#x (%s)\n", cmpinfo->default_domain,
38  printf( "available_domains: %#x (%s)\n", cmpinfo->available_domains, stringify_all_domains( cmpinfo->available_domains ) ); /* Available domains */
39  printf( "default_granularity: %#x (%s)\n", cmpinfo->default_granularity,
41  /* The default granularity when this component is used */
42  printf( "available_granularities: %#x (%s)\n", cmpinfo->available_granularities, stringify_all_granularities( cmpinfo->available_granularities ) ); /* Available granularities */
43  printf( "hardware_intr_sig: %d\n", cmpinfo->hardware_intr_sig ); printf( "hardware_intr: %d\n", cmpinfo->hardware_intr ); /* Needs hw overflow intr to be emulated in software */
44  printf( "precise_intr: %d\n", cmpinfo->precise_intr ); /* Performance interrupts happen precisely */
45  printf( "posix1b_timers: %d\n", cmpinfo->posix1b_timers ); /* Performance interrupts happen precisely */
46  printf( "kernel_profile: %d\n", cmpinfo->kernel_profile ); /* Needs kernel profile support (buffered interrupts) to be emulated */
47  printf( "kernel_multiplex: %d\n", cmpinfo->kernel_multiplex ); /* In kernel multiplexing */
48  printf( "fast_counter_read: %d\n", cmpinfo->fast_counter_read ); /* Has a fast counter read */
49  printf( "fast_real_timer: %d\n", cmpinfo->fast_real_timer ); /* Has a fast real timer */
50  printf( "fast_virtual_timer: %d\n", cmpinfo->fast_virtual_timer ); /* Has a fast virtual timer */
51  printf( "attach: %d\n", cmpinfo->attach ); /* Supports attach */
52  printf( "attach_must_ptrace: %d\n", cmpinfo->attach_must_ptrace ); /* */
53 
54  test_pass( __FILE__, NULL, 0 );
55  exit( 0 );
56 }
char name[PAPI_MAX_STR_LEN]
Definition: papi.h:626
int available_granularities
Definition: papi.h:643
const PAPI_component_info_t * PAPI_get_component_info(int cidx)
Definition: papi.c:807
unsigned int posix1b_timers
Definition: papi.h:651
unsigned int attach
Definition: papi.h:659
char * stringify_granularity(int granularity)
Definition: test_utils.c:429
int default_granularity
Definition: papi.h:642
char * stringify_all_granularities(int granularities)
Definition: test_utils.c:408
tests_quiet(argc, argv)
#define printf
Definition: papi_test.h:125
test_pass(__FILE__, NULL, 0)
int int argc
Definition: iozone.c:1609
char kernel_version[PAPI_MIN_STR_LEN]
Definition: papi.h:632
char ** argv
Definition: iozone.c:1610
unsigned int precise_intr
Definition: papi.h:650
test_fail(__FILE__, __LINE__,"PAPI_library_init", retval)
int PAPI_library_init(int version)
Definition: papi.c:497
unsigned int fast_real_timer
Definition: papi.h:657
unsigned int fast_virtual_timer
Definition: papi.h:658
char * stringify_all_domains(int domains)
Definition: test_utils.c:369
unsigned int attach_must_ptrace
Definition: papi.h:660
unsigned int fast_counter_read
Definition: papi.h:656
unsigned int kernel_multiplex
Definition: papi.h:653
unsigned int kernel_profile
Definition: papi.h:652
unsigned int hardware_intr
Definition: papi.h:649
char version[PAPI_MIN_STR_LEN]
Definition: papi.h:630
char support_version[PAPI_MIN_STR_LEN]
Definition: papi.h:631
ssize_t retval
Definition: libasync.c:338
#define PAPI_VER_CURRENT
Definition: papi.h:223
int main(int argc, char **argv)
List all appio events codes and names.
void exit()