PAPI  5.4.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
eventname.c
Go to the documentation of this file.
1 #include "papi_test.h"
2 extern int TESTS_QUIET; /* Declared in test_utils.c */
3 
4 int
5 main( int argc, char **argv )
6 {
7  int retval;
8  int preset;
9 
10  tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */
11 
12  if ( ( retval =
14  test_fail( __FILE__, __LINE__, "PAPI_library_init", retval );
15 
16  retval = PAPI_event_name_to_code( "PAPI_FP_INS", &preset );
17  if ( retval != PAPI_OK )
18  test_fail( __FILE__, __LINE__, "PAPI_event_name_to_code", retval );
19  if ( preset != PAPI_FP_INS )
20  test_fail( __FILE__, __LINE__, "Wrong preset returned", retval );
21 
22  retval = PAPI_event_name_to_code( "PAPI_TOT_CYC", &preset );
23  if ( retval != PAPI_OK )
24  test_fail( __FILE__, __LINE__, "PAPI_event_name_to_code", retval );
25  if ( preset != PAPI_TOT_CYC )
26  test_fail( __FILE__, __LINE__,
27  "*preset returned did not equal PAPI_TOT_CYC", retval );
28 
29  test_pass( __FILE__, NULL, 0 );
30  exit( 1 );
31 }
return PAPI_OK
Definition: linux-nvml.c:458
tests_quiet(argc, argv)
static int preset
Definition: event_info.c:38
test_pass(__FILE__, NULL, 0)
int int argc
Definition: iozone.c:1609
int TESTS_QUIET
Definition: test_utils.c:11
char ** argv
Definition: iozone.c:1610
test_fail(__FILE__, __LINE__,"PAPI_library_init", retval)
int PAPI_library_init(int version)
Definition: papi.c:497
#define PAPI_TOT_CYC
int PAPI_event_name_to_code(char *in, int *out)
Definition: papi.c:1010
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()
#define PAPI_FP_INS