77{
78 int retval,cid,libmsr_cid=-1,numcmp;
82 int code;
90 double elapsed_time;
92 int repeat;
93
94 (void) do_wrap;
95
97 if ( argc > 1 && strstr( argv[1], "-w" ) )
98 do_wrap = 1;
99
100
104
106 printf( "Trying all LIBMSR events\n" );
107
109
110 for( cid=0; cid<numcmp; cid++ ) {
111
113 test_fail( __FILE__, __LINE__,
"PAPI_get_component_info failed\n", 0 );
114
115 if ( strstr( cmpinfo->
name,
"libmsr" ) ) {
116 libmsr_cid=cid;
117 if ( !
TESTS_QUIET ) printf(
"Found libmsr component at cid %d\n",libmsr_cid );
120 test_skip( __FILE__,__LINE__,
"libmsr component disabled", 0 );
121 }
122 break;
123 }
124 }
125
126
127 if ( cid==numcmp )
128 test_skip( __FILE__,__LINE__,
"No libmsr component found\n",0 );
129
130
134
135
145
148
151 break;
153
155 }
156
160
161 if ( !
TESTS_QUIET ) printf(
"Starting measurements...\n" );
162
163
167
168 for ( repeat=0; repeat<3; repeat++ ) {
169
170
172
173
177
179
181 printf( "Stopping measurements, took %.3fs, gathering results...\n", elapsed_time );
188 }
189 }
190 printf( "\n" );
191 }
192 }
193
196
199
202
204
205 return 0;
206}
static const char * event_names[2]
add PAPI preset or native hardware event to an event set
Empty and destroy an EventSet.
Create a new empty PAPI EventSet.
Empty and destroy an EventSet.
Enumerate PAPI preset or native events for a given component.
Convert a numeric hardware event code to a name.
get information about a specific software component
Get the event's name and description info.
Get real time counter value in nanoseconds.
initialize the PAPI library.
Get the number of components available on the system.
Read hardware counters from an event set.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
#define PAPI_DATATYPE_FP64
#define PAPI_DATATYPE_UINT64
static long long values[NUM_EVENTS]
#define MAX_LIBMSR_EVENTS
Tests basic functionality of libmsr component.
int tests_quiet(int argc, char **argv)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)
void PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)
int data_type[MAX_EVENTS]
char units[MAX_EVENTS][BUFSIZ]
static long long after_time
static long long before_time
char name[PAPI_MAX_STR_LEN]
char disabled_reason[PAPI_HUGE_STR_LEN]
char units[PAPI_MIN_STR_LEN]