Blame man/man3/PAPI_stop_counters.3

Packit 577717
.TH "PAPI_stop_counters" 3 "Mon Dec 18 2017" "Version 5.6.0.0" "PAPI" \" -*- nroff -*-
Packit 577717
.ad l
Packit 577717
.nh
Packit 577717
.SH NAME
Packit 577717
PAPI_stop_counters \- 
Packit 577717
.PP
Packit 577717
Stop counting hardware events and reset values to zero\&.  
Packit 577717
Packit 577717
.SH SYNOPSIS
Packit 577717
.br
Packit 577717
.PP
Packit 577717
.SH "Detailed Description"
Packit 577717
.PP 
Packit 577717
Packit 577717
.PP
Packit 577717
.nf
Packit 577717
@par C Interface:
Packit 577717
\#include <papi.h> @n
Packit 577717
int PAPI_stop_counters( long long *values, int array_len );
Packit 577717
Packit 577717
.fi
Packit 577717
.PP
Packit 577717
.PP
Packit 577717
\fBParameters:\fP
Packit 577717
.RS 4
Packit 577717
\fI*values\fP an array where to put the counter values 
Packit 577717
.br
Packit 577717
\fIarray_len\fP the number of items in the *values array
Packit 577717
.RE
Packit 577717
.PP
Packit 577717
\fBPostcondition:\fP
Packit 577717
.RS 4
Packit 577717
After this function is called, the values are reset to zero\&.
Packit 577717
.RE
Packit 577717
.PP
Packit 577717
\fBReturn values:\fP
Packit 577717
.RS 4
Packit 577717
\fIPAPI_EINVAL\fP One or more of the arguments is invalid\&. 
Packit 577717
.br
Packit 577717
\fIPAPI_ENOTRUN\fP The EventSet is not started yet\&. 
Packit 577717
.br
Packit 577717
\fIPAPI_ENOEVST\fP The EventSet has not been added yet\&.
Packit 577717
.RE
Packit 577717
.PP
Packit 577717
The \fBPAPI_stop_counters()\fP function stops the counters and copies the counts into the *values array\&. The counters must have been started by a previous call to \fBPAPI_start_counters()\fP\&.
Packit 577717
.PP
Packit 577717
.PP
Packit 577717
.nf
Packit 577717
int Events[2] = { PAPI_TOT_CYC, PAPI_TOT_INS };
Packit 577717
long long values[2];
Packit 577717
if ( PAPI_start_counters( Events, 2 ) != PAPI_OK )
Packit 577717
    handle_error(1);
Packit 577717
your_slow_code();
Packit 577717
if ( PAPI_stop_counters( values, 2 ) != PAPI_OK )
Packit 577717
    handle_error(1);
Packit 577717
 *  
Packit 577717
.fi
Packit 577717
.PP
Packit 577717
.PP
Packit 577717
\fBSee Also:\fP
Packit 577717
.RS 4
Packit 577717
\fBPAPI_read_counters()\fP \fBPAPI_start_counters()\fP \fBPAPI_set_opt()\fP 
Packit 577717
.RE
Packit 577717
.PP
Packit 577717
Packit 577717
Packit 577717
.SH "Author"
Packit 577717
.PP 
Packit 577717
Generated automatically by Doxygen for PAPI from the source code\&.