1PAPI_start_counters(3) PAPI PAPI_start_counters(3)
2
3
4
6 PAPI_start_counters - PAPI High Level: start counting hardware events
7
8
10 C Interface
11 #include <papi.h>
12 int PAPI_start_counters(int *events, int array_len);
13 Fortran Interface
14 #include fpapi.h
15 PAPIF_start_counters(C_INT(*) events, C_INT array_len, C_INT check)
16
17
19 PAPI_start_counters() starts counting the events named in the events
20 array. This function cannot be called if the events array is already
21 running. The user must call PAPI_stop_counters to stop the events
22 explicitly if he/she wants to call this function again. It is the
23 user's responsibility to choose events that can be counted simultane‐
24 ously by reading the vendor's documentation. The length of the event
25 array should be no longer than the value returned by PAPI_num_coun‐
26 ters(3).
27
28
30 *events -- an array of codes for events such as PAPI_INT_INS or a
31 native event code
32
33 array_len -- the number of items in the *events array
34
35
37 On success, this function returns PAPI_OK.
38 On error, a non-zero error code is returned.
39
40
42 PAPI_EINVAL
43 One or more of the arguments is invalid.
44
45 PAPI_EISRUN
46 Counters already been started, you must call PAPI_stop_counters
47 before you call this function again.
48
49 PAPI_ESYS
50 A system or C library call failed inside PAPI, see the errno
51 variable.
52
53 PAPI_ENOMEM
54 Insufficient memory to complete the operation.
55
56 PAPI_ECNFLCT
57 The underlying counter hardware can not count this event and
58 other events in the EventSet simultaneously.
59
60 PAPI_ENOEVNT
61 The PAPI preset is not available on the underlying hardware.
62
63
65 /* Start counting events */
66 if (PAPI_start_counters(Events, num_hwcntrs) != PAPI_OK)
67 handle_error(1);
68
69
71 This function has no known bugs.
72
73
75 PAPI_create_eventset(3), PAPI_add_event(3), PAPI_stop_counters(3),
76 PAPI(3), PAPIF(3)
77
78
79
80PAPI Programmer's Reference September, 2004 PAPI_start_counters(3)