17 {
18
22 char *uncore_event_tmp=NULL;
23 char uncore_event[BUFSIZ];
25 int uncore_cidx=-1;
27
28
30
32 printf("Testing the :cpu=0 way of attaching an uncore event to a core\n");
33 }
34
35
39 }
40
41
43 if (uncore_cidx<0) {
45 printf("perf_event_uncore component not found\n");
46 }
47 test_skip(__FILE__,__LINE__,
"perf_event_uncore component not found",0);
48 }
49
50
54 printf("perf_event_uncore component is disabled\n");
55 }
56 test_skip(__FILE__,__LINE__,
"uncore component disabled",0);
57 }
58
59
61 if (uncore_event_tmp==NULL) {
63 printf("uncore event name not available\n");
64 }
66 "PAPI does not support uncore on this processor",
68 }
69
70 sprintf(uncore_event,"%s:cpu=0",uncore_event_tmp);
71
72
76 }
77
78
82 printf("Error trying to use event %s\n", uncore_event);
83 }
85 }
86
87
91 }
92
93
95
96
100 }
101
103 printf("\tUsing event %s\n",uncore_event);
104 printf(
"\t%s: %lld\n",uncore_event,
values[0]);
105 }
106
108
109 return 0;
110}
add PAPI preset or native hardware event by name to an EventSet
Create a new empty PAPI EventSet.
returns the component index for the named component
get information about a specific software component
initialize the PAPI library.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
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 * get_uncore_event(char *event, int size)