PAPI_hl_read(3)

Hey bestie! Welcome to the PAPI_hl_read(3) page from the PAPI manual πŸ’– This one is lowkey the β€œgrab the delta since the region started” moment, and yes, it’s iconic.

🌸 NAME 🌸

PAPI_hl_read β€” read performance events inside of a region and store the difference to the corresponding beginning of the region. That’s the whole assignment, periodt. πŸ’…

✨ SYNOPSIS ✨

πŸ’– Detailed Description πŸ’–

Okay so here’s the C interface, bestie β€” keep it cute and keep it exact:

πŸ’» C Interface: πŸ’»

#include <papi.h>
int PAPI_hl_read( const char* region );

πŸŽ€ Parameters πŸŽ€

  • region β€” a unique region name corresponding to PAPI_hl_region_begin. Yes, it has to match, bestie. 🌈

🚦 Return values 🚦

  • PAPI_OK β€” the good one, slay ✨
  • PAPI_ENOTRUN β€” the EventSet is currently not running or couldn’t be determined. 😭
  • PAPI_ESYS β€” a system or C library call failed inside PAPI; see the errno variable. πŸ”₯
  • PAPI_EMISC β€” PAPI has been deactivated due to previous errors. πŸ’€
  • PAPI_ENOMEM β€” insufficient memory. πŸ˜΅β€πŸ’«

PAPI_hl_read reads performance events inside of a region and stores the difference to the corresponding beginning of the region. It’s giving β€œcalculate the region difference” energy, no cap. πŸ’«

Heads up: it assumes that PAPI_hl_region_begin was called before. Do not skip the begin, bestie. 🫢

πŸ§ͺ Example πŸ§ͺ

Here’s the example, exactly as it is β€” copy it with your whole chest:

int retval;

retval = PAPI_hl_region_begin("computation");
if ( retval != PAPI_OK )
    handle_error(1);

 //Do some computation here

retval = PAPI_hl_read("computation");
if ( retval != PAPI_OK )
    handle_error(1);

 //Do some computation here

retval = PAPI_hl_region_end("computation");
if ( retval != PAPI_OK )
    handle_error(1);

πŸ‘€ See also πŸ‘€

  • PAPI_hl_region_begin
  • PAPI_hl_region_end
  • PAPI_hl_stop

πŸ’– Author πŸ’–

The author line is literally: Generated automatically by Doxygen for PAPI from the source code. Iconic, honestly. πŸŽ€


This page is from PAPI version 7.2.0.0 and is dated Wed Jun 25 2025 19:30:48. Bye bestie, go read those performance events! πŸ’…πŸ’–