24{
25
26 int retval,cid,coretemp_cid=-1,numcmp;
29 int code;
31 int r;
34 double temperature;
35
36
38
39
43 }
44
46 printf("Trying all coretemp events\n");
47 }
48
50
51 for(cid=0; cid<numcmp; cid++) {
52
54 test_fail(__FILE__, __LINE__,
"PAPI_get_component_info failed\n", 0);
55 }
56
57 if (strstr(cmpinfo->
name,
"coretemp")) {
58 coretemp_cid=cid;
59 if (!
TESTS_QUIET) printf(
"Found coretemp component at cid %d\n",
60 coretemp_cid);
65 "Component disabled\n", 0);
66 }
68 test_skip(__FILE__,__LINE__,
"No coretemp events found",0);
69 }
70 break;
71 }
72 }
73
74
75
76
78
80
82
85 printf("Error translating %#x\n",code);
87 "PAPI_event_code_to_name",
retval );
88 }
89
93 "Error getting event info\n",
retval);
94 }
95
96
97
98
100
101
103
105
107
111 "PAPI_create_eventset()",
retval);
112 }
113
117 "PAPI_add_event()",
retval);
118 }
119
123 }
124
128 }
129
130 temperature=(
values[0]/1000.0);
131
133 temperature,
135 );
136
140 "PAPI_cleanup_eventset()",
retval);
141 }
142
146 "PAPI_destroy_eventset()",
retval);
147 }
148 }
149 }
150
151
152
153
155
156
158
160
162
166 "PAPI_create_eventset()",
retval);
167 }
168
172 "PAPI_add_event()",
retval);
173 }
174
178 }
179
183 }
184
185 temperature=(
values[0]/1000.0);
186
188 temperature,
190 );
191
195 "PAPI_cleanup_eventset()",
retval);
196 }
197
201 "PAPI_destroy_eventset()",
retval);
202 }
203 }
204 }
205
206
207
209
210
212
214
216
220 "PAPI_create_eventset()",
retval);
221 }
222
226 "PAPI_add_event()",
retval);
227 }
228
232 }
233
237 }
238
241
245 "PAPI_cleanup_eventset()",
retval);
246 }
247
251 "PAPI_destroy_eventset()",
retval);
252 }
253 }
254
255 }
256 else {
257
258 }
259
261 }
262
264
265 return 0;
266}
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.
initialize the PAPI library.
Get the number of components available on the system.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
#define NUM_EVENTS
Shows "pretty" coretemp output.
char event_name[2][PAPI_MAX_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 name[PAPI_MAX_STR_LEN]
char disabled_reason[PAPI_HUGE_STR_LEN]
char long_descr[PAPI_HUGE_STR_LEN]