PAPI_read(3)
π NAME
okay so bestie, welcome to the PAPI_read(3) page from the PAPI manual. This one is literally βRead hardware counters from an event set.β Thatβs the whole main-character summary. β¨
β¨ SYNOPSIS
π§ C Interface:
#include <papi.h>
int PAPI_read(int EventSet, long_long * values );
πΈ Detailed Description
PAPI_read() copies the counters of the indicated event set into the provided array.
The counters continue counting after the read. Highkey note the differences between PAPI_read() and PAPI_accum(), specifically that PAPI_accum() resets the values array to zero.
PAPI_read() assumes an initialized PAPI library and a properly added event set. No cap. π«Ά
π Parameters
EventSetβ an integer handle for a PAPI Event Set as created byPAPI_create_eventset()*valuesβ an array to hold the counter values of the counting events
π Return values
PAPI_EINVALβ One or more of the arguments is invalid.PAPI_ESYSβ A system or C library call failed inside PAPI, see theerrnovariable.PAPI_ENOEVSTβ The event set specified does not exist.
π Examples
do_100events();
if (PAPI_read(EventSet, values) != PAPI_OK)
handle_error(1);
// values[0] now equals 100
do_100events();
if (PAPI_accum(EventSet, values) != PAPI_OK)
handle_error(1);
// values[0] now equals 300
values[0] = -100;
do_100events();
if (PAPI_accum(EventSet, values) != PAPI_OK)
handle_error(1);
// values[0] now equals 0
π See also
PAPI_accumPAPI_startPAPI_stopPAPI_reset
π Author
Generated automatically by Doxygen for PAPI from the source code.
okay thatβs the whole PAPI_read(3) moment, bestie. Version 7.2.0.0, dated Wed Jun 25 2025 19:30:48 β slay and goodbye π
β¨
π¦ where this page comes from
- nixos 26.05: papi 7.2.0
- nixpkgs unstable: papi 7.2.0
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- ubuntu resolute: libpapi-dev 7.2.0-2 Β· BSD-3-Clause
- ubuntu stonking: libpapi-dev 7.2.0-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms