25{
26
27 int retval,cid,numcmp,coretemp_cid=-1;
30 int code;
32 int total_events=0;
33 int r;
35
36
38
39
43 }
44
46 printf("Trying all coretemp events\n");
47 }
48
50
51 for(cid=0; cid<numcmp; cid++) {
52
55 "PAPI_get_component_info failed\n", 0);
56 }
57
58 if (strstr(cmpinfo->
name,
"coretemp")) {
59 coretemp_cid=cid;
61 printf("Found coretemp component at cid %d\n", coretemp_cid);
62 }
63
68 "Component disabled\n", 0);
69 }
70 }
71 }
72
73 if (coretemp_cid==-1) {
74 test_skip(__FILE__,__LINE__,
"No coretemp component found",0);
75 }
76
77
79
81
85 printf("Error translating %#x\n",code);
87 "PAPI_event_code_to_name",
retval );
88 }
89
91
93
97 "PAPI_create_eventset()",
retval);
98 }
99
103 "PAPI_add_event()",
retval);
104 }
105
109 }
110
114 }
115
117
121 "PAPI_cleanup_eventset()",
retval);
122 }
123
127 "PAPI_destroy_eventset()",
retval);
128 }
129
130 total_events++;
132 }
133
134 if (total_events==0) {
135 test_skip(__FILE__,__LINE__,
"No coretemp events found",0);
136 }
137
139
140 return 0;
141}
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
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
Tests basic coretemp functionality.
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]