Go to the source code of this file.
◆ ERROR_RETURN
◆ NUM_EVENTS
◆ main()
Definition at line 13 of file PAPI_add_remove_event.c.
14{
17
18
20
21
22
24
26
27
28
29
30
31
32
33
34
37
38
39
42
43
46
47
50
51
52 number = 0;
55
56 printf("There are %d events in the event set\n", number);
57
58
59
62
63
65 for (
i = 0;
i < 2000000;
i++)
66 {
68 }
69
70
71
74
75 printf(
"The total instructions executed for the first loop are %lld \n",
values[0] );
76 printf(
"The total cycles executed for the first loop are %lld \n",
values[1]);
77
78
80 for (
i = 0;
i < 2000000;
i++)
81 {
83 }
84
85
88
89 printf(
"Total instructions executed are %lld \n",
values[0] );
90 printf(
"Total cycles executed are %lld \n",
values[1]);
91
92
95 printf("Removing PAPI_TOT_INS from the eventset\n");
96
97
98 number = 0;
101
102 printf("There is only %d event left in the eventset now\n", number);
103
104
106
107 exit(0);
108}
#define ERROR_RETURN(retval)
add PAPI preset or native hardware event to an event set
Create a new empty PAPI EventSet.
initialize the PAPI library.
list the events in an event set
Read hardware counters from an event set.
removes a hardware event from a PAPI event set.
Finish using PAPI and free all related resources.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
static long long values[NUM_EVENTS]