PMC_EVENT_NAMES_OF_CLASS(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’… PMC_EVENT_NAMES_OF_CLASS πŸ’…

okay so bestie, welcome to PMC_EVENT_NAMES_OF_CLASS(3) β€” straight out of the Library Functions Manual, and she is serving hardware event realness, no cap. this is a libpmc girly and she's about to hand you a whole list of event names. let's get into it ✨


🌸 NAME 🌸

pmc_event_names_of_class β€” return a list of event names supported by a PMC class

like, she literally goes and fetches the event names for you. main character energy fr fr πŸŽ€


πŸ¦‹ LIBRARY πŸ¦‹

Performance Counters Library (libpmc, -lpmc)

that's the vibe check: you're linking against -lpmc. periodt. πŸ’…


✨ SYNOPSIS ✨

#include <pmc.h>

int
pmc_event_names_of_class(enum pmc_class cl, const char ***eventnames,
    int *nevents);

copy it exactly, bestie, character for character β€” this is not the moment to freestyle πŸ™ˆ


πŸ’– DESCRIPTION πŸ’–

so the function pmc_event_names_of_class() retrieves the hardware event names supported by the class of PMC hardware specified by argument cl. iconic behavior honestly.

it returns an array of const char * pointers to names of events supported by the specified class of PMC hardware. the location pointed to by argument nevents is set to the number of event names returned. so like, she tells you what the names are and how many there are. thoughtful queen πŸ‘‘

the returned array is allocated using malloc(3). so yes, it's yours now β€” you own that memory, don't just ghost it 🫢


πŸ”₯ RETURN VALUES πŸ”₯

the pmc_event_names_of_class() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

0 = slay. -1 = check errno, bestie, she's trying to tell you something 😭


πŸ’€ ERRORS πŸ’€

a call to pmc_event_names_of_class() may fail with the following errors:

  • [EINVAL] β€” Argument cl was invalid. like, that class does not exist, babes πŸ™ˆ
  • [ENOMEM] β€” Allocation of a memory area to hold the result failed. the memory said no πŸ’€

🌈 SEE ALSO 🌈

go read them, iykyk ⭐


and that's the whole page, bestie β€” no cap, every last detail intact πŸ’œ

mwah πŸ’‹ β€” this iconic little number is brought to you by Debian, dated November 23, 2007, and she still ate. don't forget to free() that array, ily, bye πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from