15#define EVENTS_TO_TRY 16
18int main(
int argc,
char **argv ) {
24 char uncore_base[BUFSIZ];
25 char uncore_event[BUFSIZ];
46 printf(
"perf_event_uncore component not found\n");
48 test_skip(__FILE__,__LINE__,
"perf_event_uncore component not found",0);
53 if ( hwinfo == NULL ) {
63 printf(
"No event available\n");
71 printf(
"We only support Intel for now\n");
78 printf(
"Trying for %d sockets\n",hwinfo->
sockets);
79 printf(
"threads %d cores %d ncpus %d\n", hwinfo->
threads,hwinfo->
cores,
89 printf(
"Using core %d for socket %d\n",core_to_use,
i);
104 test_fail(__FILE__, __LINE__,
"PAPI_assign_eventset_component",
retval);
117 printf(
"Problem with PAPI_CPU_ATTACH\n");
120 "this test; trying to PAPI_CPU_ATTACH; need to run as root",
129 retval = snprintf(uncore_event, BUFSIZ,
"%s%d::%s",uncore_base,j,
event_name);
131 fprintf(
stderr,
"Event full name \"%s%d::%s\" has been truncated to \"%s\"\n",uncore_base,j,
event_name, uncore_event);
139 printf(
"Added %s for socket %d\n",uncore_event,
i);
147 for(j=0;j<max_cbox;j++) {
149 printf(
"Starting EventSet %d\n",
EventSet[j][
i]);
155 printf(
"Error starting socket %d cbox %d\n",
i,j);
166 for(j=0;j<max_cbox;j++) {
170 printf(
"Error stopping socket %d cbox %d\n",
i,j);
180 printf(
"Socket %d\n",
i);
181 for(j=0;j<max_cbox;j++) {
add PAPI preset or native hardware event by name to an EventSet
Assign a component index to an existing but empty EventSet.
Create a new empty PAPI EventSet.
returns the component index for the named component
get information about the system hardware
initialize the PAPI library.
Set PAPI library or event set options.
Finish using PAPI and free all related resources.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
char event_name[2][PAPI_MAX_STR_LEN]
#define PAPI_VENDOR_INTEL
static long long values[NUM_EVENTS]
Return codes and api definitions.
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_cbox_event(char *event_name, char *uncore_base, int size)
A pointer to the following is passed to PAPI_set/get_opt()