73{
74 (void) argv;
75 (void) argc;
76 int retval,cid,powercap_cid=-1,numcmp;
79 long long originalValues[1];
80 int code;
84 int r;
85
89
90
92
93
97
98 if ( !
TESTS_QUIET ) printf(
"Trying all powercap events\n" );
99
101
102 for( cid=0; cid<numcmp; cid++ ) {
103
105 test_fail( __FILE__, __LINE__,
"PAPI_get_component_info failed\n", 0 );
106
107 if ( strstr( cmpinfo->
name,
"powercap" ) ) {
108 powercap_cid=cid;
109 if ( !
TESTS_QUIET ) printf(
"Found powercap component at cid %d\n",powercap_cid );
112 printf( "powercap component disabled: %s\n",
114 }
115 test_skip( __FILE__,__LINE__,
"powercap component disabled",0 );
116 }
117 break;
118 }
119 }
120
121
122 if ( cid==numcmp )
123 test_skip( __FILE__,__LINE__,
"No powercap component found\n",0 );
124
125
127 test_skip( __FILE__,__LINE__,
"No counters in the powercap component\n",0 );
128
129
133
134
135 printf( "\nThis test may take a few minutes to complete.\n\n" );
141 test_fail( __FILE__, __LINE__,
"Error from PAPI_event_code_to_name",
retval );
142
146
149
151
153 break;
154
155
160
161
163
164
169
170 printf( "\n=======================================\n%-50s Readout (before 1st write) = %4.6f %s\n",
172
173
175
176
177 originalValues[0] =
values[0];
182
183
185
186
191
192 printf( "\n%-50s Readout (after 1st write) = %4.6f %s\n",
194
195
197
198
203
204
206
207
212
213 printf( "\n%-50s Readout (after restoring write) = %4.6f %s\n",
215
216
218
219
224
226
227 printf( "\n%-50s Readout (final value) %4.6f %s\n",
229 }
230
231
235
237 }
238
239
243
245
246 return 0;
247}
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.
Write counter values into counters.
#define PAPI_HUGE_STR_LEN
static long long values[NUM_EVENTS]
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)
char units[MAX_EVENTS][BUFSIZ]
static long long after_time
char name[PAPI_MAX_STR_LEN]
char disabled_reason[PAPI_HUGE_STR_LEN]
char units[PAPI_MIN_STR_LEN]
char long_descr[PAPI_HUGE_STR_LEN]