PAPI  5.6.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 
11 #include "papi.h"
12 #include "papi_test.h"
13 
14 int
15 main( int argc, char **argv )
16 {
17  int retval;
18 
19  const PAPI_component_info_t *cmpinfo;
20 
21  tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */
22 
23  if ( ( retval =
25  test_fail( __FILE__, __LINE__, "PAPI_library_init", retval );
26 
27  if ( ( cmpinfo = PAPI_get_component_info( 0 ) ) == NULL )
28  test_fail( __FILE__, __LINE__, "PAPI_get_component_info", retval );
29 
30  if (!TESTS_QUIET) {
31  printf( "name: %s\n", cmpinfo->name );
32  printf( "component_version: %s\n", cmpinfo->version );
33  printf( "support_version: %s\n", cmpinfo->support_version );
34  printf( "kernel_version: %s\n", cmpinfo->kernel_version );
35  printf( "num_cntrs: %d\n", cmpinfo->num_cntrs );
36  printf( "num_mpx_cntrs: %d\n", cmpinfo->num_mpx_cntrs );
37  printf( "num_preset_events: %d\n", cmpinfo->num_preset_events ); /* Number of counters the component supports */
38  printf( "num_native_events: %d\n", cmpinfo->num_native_events ); /* Number of counters the component supports */
39  printf( "default_domain: %#x (%s)\n", cmpinfo->default_domain,
41  printf( "available_domains: %#x (%s)\n", cmpinfo->available_domains, stringify_all_domains( cmpinfo->available_domains ) ); /* Available domains */
42  printf( "default_granularity: %#x (%s)\n", cmpinfo->default_granularity,
44  /* The default granularity when this component is used */
45  printf( "available_granularities: %#x (%s)\n", cmpinfo->available_granularities, stringify_all_granularities( cmpinfo->available_granularities ) ); /* Available granularities */
46  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 */
47  printf( "precise_intr: %d\n", cmpinfo->precise_intr ); /* Performance interrupts happen precisely */
48  printf( "posix1b_timers: %d\n", cmpinfo->posix1b_timers ); /* Performance interrupts happen precisely */
49  printf( "kernel_profile: %d\n", cmpinfo->kernel_profile ); /* Needs kernel profile support (buffered interrupts) to be emulated */
50  printf( "kernel_multiplex: %d\n", cmpinfo->kernel_multiplex ); /* In kernel multiplexing */
51  printf( "fast_counter_read: %d\n", cmpinfo->fast_counter_read ); /* Has a fast counter read */
52  printf( "fast_real_timer: %d\n", cmpinfo->fast_real_timer ); /* Has a fast real timer */
53  printf( "fast_virtual_timer: %d\n", cmpinfo->fast_virtual_timer ); /* Has a fast virtual timer */
54  printf( "attach: %d\n", cmpinfo->attach ); /* Supports attach */
55  printf( "attach_must_ptrace: %d\n", cmpinfo->attach_must_ptrace ); /* */
56  }
57 
58  test_pass( __FILE__ );
59 
60  return 0;
61 }
char name[PAPI_MAX_STR_LEN]
Definition: papi.h:629
int available_granularities
Definition: papi.h:646
const PAPI_component_info_t * PAPI_get_component_info(int cidx)
Definition: papi.c:796
void test_pass(const char *filename)
Definition: test_utils.c:432
unsigned int posix1b_timers
Definition: papi.h:654
unsigned int attach
Definition: papi.h:662
char * stringify_granularity(int granularity)
Definition: test_utils.c:353
int default_granularity
Definition: papi.h:645
char * stringify_all_granularities(int granularities)
Definition: test_utils.c:332
int int argc
Definition: iozone.c:1609
char kernel_version[PAPI_MIN_STR_LEN]
Definition: papi.h:635
Return codes and api definitions.
char ** argv
Definition: iozone.c:1610
unsigned int precise_intr
Definition: papi.h:653
int PAPI_library_init(int version)
Definition: papi.c:500
unsigned int fast_real_timer
Definition: papi.h:660
unsigned int fast_virtual_timer
Definition: papi.h:661
char * stringify_all_domains(int domains)
Definition: test_utils.c:293
unsigned int attach_must_ptrace
Definition: papi.h:663
unsigned int fast_counter_read
Definition: papi.h:659
unsigned int kernel_multiplex
Definition: papi.h:656
unsigned int kernel_profile
Definition: papi.h:655
unsigned int hardware_intr
Definition: papi.h:652
printf("\tTry: -i 0 -i 1 \n\n")
int TESTS_QUIET
Definition: test_utils.c:18
int tests_quiet(int argc, char **argv)
Definition: test_utils.c:376
void test_fail(const char *file, int line, const char *call, int retval)
Definition: test_utils.c:468
char version[PAPI_MIN_STR_LEN]
Definition: papi.h:633
char support_version[PAPI_MIN_STR_LEN]
Definition: papi.h:634
ssize_t retval
Definition: libasync.c:338
#define PAPI_VER_CURRENT
Definition: papi.h:225
int main(int argc, char **argv)
List all appio events codes and names.