table of contents
PAPI_stop_counters(3) | PAPI | PAPI_stop_counters(3) |
NAME¶
PAPI_stop_counters - PAPI High Level: stop counting hardware events and reset values to zero
SYNOPSIS¶
C Interface
#include <papi.h> int PAPI_stop_counters(long_long *values, int array_len);
Fortran Interface
PAPIF_stop_counters(C_LONG_LONG(*) values, C_INT array_len, C_INT check) #include fpapi.h
DESCRIPTION¶
PAPI_stop_counters()
This function stops the counters and copies the counts into the values array. The counters must have been started by a previous call to PAPI_start_counters(). After this function is called, the values are reset to zero.
ARGUMENTS¶
*values -- an array where to put the counter values
array_len -- the number of items in the *values array
RETURN VALUES¶
On success, this function returns PAPI_OK.
On error, a non-zero error code is returned.
ERRORS¶
- PAPI_EINVAL
- One or more of the arguments is invalid.
- PAPI_ENOTRUN
- The eventset is not started yet.
- PAPI_ENOEVST
- The eventset has not been added yet.
EXAMPLES¶
int Events[2] = { PAPI_TOT_CYC, PAPI_TOT_INS };
long_long values[2];
/* Start counting events */
if (PAPI_start_counters(Events, 2) != PAPI_OK)
handle_error(1);
your_slow_code();
/* Stop counting events */
if (PAPI_stop_counters(values, 2) != PAPI_OK)
handle_error(1);
BUGS¶
This function has no known bugs.
SEE ALSO¶
PAPI_start_counters(3),PAPI_set_opt(3), PAPI_read_counters(3),PAPI"(3),"PAPIF(3)
September, 2004 | PAPI Programmer's Reference |