PMDANAME(3)

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

πŸ’… PMDANAME(3) β€” bestie edition πŸ’…

Library Functions Manual Β· pmdaName(3)

okay so bestie, buckle up, we're doing dynamic performance metric name translation and it's gonna be a whole vibe ✨


🌸 NAME 🌸

pmdaName β€” translate a PMID to a set of dynamic performance metric names πŸ¦‹


✨ C SYNOPSIS ✨

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

int pmdaName(pmID pmid, char ***nameset, pmdaExt *pmda);

cc ... -lpcp_pmda -lpcp

like, two includes, one function, one compile line. iconic, no notes πŸ’…


πŸ’– DESCRIPTION πŸ’–

So pmdaName is part of the Performance Metrics Domain Agent (PMDA) API (go read PMDA(3) if you haven't, bestie, I'll wait 🫢). It's the generic callback for translating a pmid into one or more dynamic metric names, which it hands back in nameset.

Now here's the tea β˜• β€” implementing dynamic performance metrics needs specific PMDA support, and honestly? It's an optional component of a PMDA. Like, most PMDAs do not support dynamic performance metrics. So pmdaName is literally just a skeleton implementation that returns PM_ERR_NAME. It's giving placeholder. It's giving "we'll get to it". 😭

But a PMDA that does support dynamic performance metrics will provide a private callback that replaces pmdaName β€” and the way you do that is by assignment to version.four.name of the pmdaInterface structure, iykyk β€” and that callback implements the translation from a pmid to a set of dynamic performance metric names returned via nameset.

And the behaviour, the return values, and the memory allocation rules for nameset? Same as pmNameAll(3). Periodt. Go look at that one, don't make me say it twice πŸŽ€


πŸŽ€ CAVEAT πŸŽ€

⚠️ bestie. listen. The PMDA must be using PMDA_INTERFACE_4 or later, as specified in the call to pmdaDSO(3) or pmdaDaemon(3). If you're on an older interface you're not gonna have a good time πŸ’€

πŸ‘‘ DIAGNOSTICS πŸ‘‘

pmdaName returns PM_ERR_PMID if the name is not recognized or cannot be translated. Otherwise it returns the number of metric names found β€” and most commonly that's just 1, because usually there's only one, bestie πŸ’œ


🌈 SEE ALSO 🌈


and that's the whole page, no cap 🫢 this little manual came from Performance Co-Pilot (PCP), it's PMDANAME(3), and it's been living in this library-functions-manual era since forever ago. go translate some names, bestie, you got this πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from