18{
24 char error_message[BUFSIZ];
25
26
28
30 printf("\nTrying all pre-defined events:\n");
31 }
32
33
37 }
38
39
43 }
44
45
47
49 continue;
50
51 if ( !( info.
count ) )
52 continue;
53
55
59 printf(
"Error adding event %s\n",info.
symbol);
61 printf("Probably NMI watchdog related\n");
62 }
63 }
65 sprintf(error_message,
"Problem adding %s (probably NMI Watchdog related)",info.
symbol);
66 }
67 else {
68 sprintf(error_message,
"Problem adding %s",info.
symbol);
69 }
71 err_count++;
72 } else {
76 err_count++;
77 } else {
81 err_count++;
82 } else {
83 if (!
quiet) printf(
"successful\n" );
85 }
86 }
90 }
91 }
95
97 printf(
"Successfully added, started and stopped %d events.\n",
count );
98 }
99
100 if ( err_count ) {
101 if (!
quiet) printf(
"Failed to add, start or stop %d events.\n", err_count );
102 }
103
105 test_fail( __FILE__, __LINE__,
"No events added", 1 );
106 }
107
109
110 return 0;
111
112}
add PAPI preset or native hardware event to an event set
Create a new empty PAPI EventSet.
Empty and destroy an EventSet.
Get the event's name and description info.
initialize the PAPI library.
Produces a string on standard error, describing the last library error.
removes a hardware event from a PAPI event set.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
static long long values[NUM_EVENTS]
#define PAPI_MAX_PRESET_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 test_warn(const char *file, int line, const char *call, int retval)
char symbol[PAPI_HUGE_STR_LEN]