PMDATEXT(3)

πŸ“¦
version 7.2.2 Β· 3 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ’– PMDATEXT(3) β€” the pmdaText glow-up πŸ’–

okay so bestie, welcome to the Library Functions Manual entry for PMDATEXT(3). This is the lil function that goes and fetches the help text for a metric, and honestly? She's serving. Let's get into it. πŸŽ€


✨ NAME ✨

pmdaText β€” pull the metric help text out for a PMDA 🫢


🌸 C SYNOPSIS 🌸

#include <pcp/pmapi.h>
#include <pcp/pmda.h>

int pmdaText(int ident, int type, char **buffer, pmdaExt *pmda);

cc ... -lpcp_pmda -lpcp

πŸ’… DESCRIPTION πŸ’…

So, context: this is part of the Performance Metrics Domain Agent (PMDA) API β€” go peek at PMDA(3) if you haven't, iykyk. pmdaText uses the standard PMDA(3) data structures to hand you back the help text for metric ident, dropped right into buffer. ✨

Important: that help text has to live in help text files that were made with newhelp(1), and the associated files get opened automatically by pmdaInit(3). No cap, it just does it for you. πŸ™ˆ

You can set the path to the (basename of the) help text files when you call pmdaDSO(3) or pmdaDaemon(3) β€” and the -h command line option in pmdaGetOpt(3) can override that. πŸ’«

Now, the encoding of ident? It follows the same internal scheme used down below the routines pmLookupText(3) and pmLookupInDomText(3). Basically, ident encodes either a metric identifier or an instance domain identifier, and which one depends on the value of type. πŸ‘‘

The type argument is a bit mask that says how to read ident and what form of help text you want. Here's the tea:

  • PM_TEXT_PMID β€” means ident is a metric identifier
  • PM_TEXT_INDOM β€” means ident is an instance domain identifier

…and then plus one of these:

  • PM_TEXT_ONELINE β€” for the one line help text
  • PM_TEXT_HELP β€” for the full help text

And about buffer? It's managed internally (usually it's cached, she's cozy), so do NOT release or free it if you're the caller of pmdaText. Hands off, bestie. πŸ™…β€β™€οΈ


⚠️ CAVEAT ⚠️

The PMDA has to be using PMDA_INTERFACE_2 or later, as specified in the call to pmdaDSO(3) or pmdaDaemon(3). Older than that? Not it. πŸ’€

🩺 DIAGNOSTICS 🩺

If the requested help text just could not be obtained, pmdaText will return PM_ERR_TEXT. Sad girl hours. 😭


πŸ‘€ SEE ALSO πŸ‘€


And that's the whole page, bestie β€” brought to you by Performance Co-Pilot (that's the source, and the version is PCP), under the title PMDATEXT(3). Go forth and read your help text. Slay. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from