PAPI_remove_named_event(3)

πŸ’… PAPI_remove_named_event(3) β€” the "bye bestie" page πŸ’…

okay so this is a page from the PAPI manual, bestie, and it's lowkey so useful. It's all about PAPI_remove_named_event β€” the function that removes a named hardware event from a PAPI event set. Think of it as the un-invite button for an event you already added to your set πŸŽ€


✨ NAME ✨

PAPI_remove_named_event β€” removes a named hardware event from a PAPI event set. periodt πŸ’…


🌸 SYNOPSIS 🌸

Detailed Description πŸ¦‹

so listen. A hardware event can be either a PAPI Preset or a native hardware event code β€” those are the two flavors, iykyk.

  • Wanna see the list of PAPI preset events? Check out PAPI_presets, or just run the papi_avail utility that ships in the PAPI distribution ✨
  • You can also pass PAPI Presets to PAPI_query_event to find out if they even exist on the underlying architecture πŸ‘€
  • Wanna see the native events your current platform actually has? Run papi_native_avail from the PAPI distribution 🌈

C Interface πŸŽ€

#include <papi.h>
 int PAPI_remove_named_event( int  EventSet, const char *EventName );

Parameters 🫢

  • EventSet β€” an integer handle for a PAPI event set, as created by PAPI_create_eventset
  • EventName β€” a defined event such as PAPI_TOT_INS, or a native event

Return values ⭐

  • PAPI_OK β€” Everything worked. slay πŸ’–
  • PAPI_EINVAL β€” One or more of the arguments is invalid.
  • PAPI_ENOINIT β€” The PAPI library has not been initialized.
  • PAPI_ENOEVST β€” The EventSet specified does not exist.
  • PAPI_EISRUN β€” The EventSet is currently counting events. 😭
  • PAPI_ECNFLCT β€” The underlying counter hardware can not count this event and other events in the EventSet simultaneously. not the conflict πŸ’€
  • PAPI_ENOEVNT β€” The PAPI preset is not available on the underlying hardware. rude, honestly πŸ™ˆ

Example πŸ’œ

char EventName = "PAPI_TOT_INS";
int EventSet = PAPI_NULL;
int ret;

// Create an empty EventSet
ret = PAPI_create_eventset(&EventSet);
if (ret != PAPI_OK) handle_error(ret);

// Add Total Instructions Executed to our EventSet
ret = PAPI_add_named_event(EventSet, EventName);
if (ret != PAPI_OK) handle_error(ret);

// Start counting
ret = PAPI_start(EventSet);
if (ret != PAPI_OK) handle_error(ret);

// Stop counting, ignore values
ret = PAPI_stop(EventSet, NULL);
if (ret != PAPI_OK) handle_error(ret);

// Remove event
ret = PAPI_remove_named_event(EventSet, EventName);
if (ret != PAPI_OK) handle_error(ret);

See also πŸ‘‘

  • PAPI_remove_event
  • PAPI_query_named_event
  • PAPI_add_named_event

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for PAPI from the source code. (not a human, just a very efficient little bot 🧚)


aaaand that's the whole page, bestie!! πŸ“ this doc is Version 7.2.0.0, dated Wed Jun 25 2025 19:30:48 β€” so go forth and remove those named events with main character energy πŸ’…βœ¨πŸ”₯