PMLOCALPMDA(3)
π PMLOCALPMDA(3) β the __pmLocalPMDA glow-up π
okay bestie, so this one is a library functions manual page, and before you ask β yes it's giving internal-dev energy, not public-API energy. Let's get into it. π¦
β¨ NAME β¨
__pmLocalPMDA β change the table of DSO PMDAs for PM_CONTEXT_LOCAL contexts
Like, it literally just rearranges which PMDAs your local context can see. That's the whole vibe. π
πΈ C SYNOPSIS πΈ
#include "pmapi.h"
#include "libpcp.h"
int __pmLocalPMDA(int op, int domain, const char *name,
const char *init);
and when you build it:
cc ... -lpcp
no cap, that's the whole setup. π
π¨ CAVEAT π¨
bestie. listen. this documentation is intended for internal Performance Co-Pilot (PCP) developer use. π
These interfaces are not part of the PCP APIs that are guaranteed to remain fixed across releases, and they may not work, or may provide different semantics at some point in the future. So likeβ¦ don't build your whole personality on them, okay? π
π DESCRIPTION π
PCP contexts of type PM_CONTEXT_LOCAL are what clients use when they wanna fetch metrics directly from one or more PMDAs on the local host without involving pmcd(1). And a PMDA that's gonna be used this way must have been built as a Dynamic Shared Object (DSO). that's the rule, periodt. β¨
Historically, the table of PMDAs available for use with PM_CONTEXT_LOCAL was hardcoded to the following:
- The PMDA (or PMDAs) that export the operating system performance data and data about process activity.
- The mmv PMDA.
- The sample PMDA provided
$PCP_LITE_SAMPLEor$PMDA_LOCAL_SAMPLEis set in the environment β used mostly for QA and testing.
The initial table of PMDAs available for use with PM_CONTEXT_LOCAL is now generated dynamically from all those PMDAs that have been installed as DSOs on the local host. π The one exception is the ``pmcd'' PMDA, which only operates correctly in the address space of a running pmcd(1) process and so is not available to an application using a PM_CONTEXT_LOCAL context. not invited to the party, sorry not sorry. π
__pmLocalPMDA provides a number of services to amend the table of PMDAs available for use with PM_CONTEXT_LOCAL. π«Ά
The op argument specifies the what should be done and takes one of the following values and actions:
PM_LOCAL_ADDβ Append an entry to the table for the PMDA with a Performance Metrics Domain (PMD) of domain, the path to the DSO PMDA is given by path and the PMDA's initialization routine is init. β¨PM_LOCAL_DELβ Removes all entries in the table where the domain matches, or the path matches. Setting the arguments domain to-1or path toNULLto force matching on the other argument. The init argument is ignored. ποΈPM_LOCAL_CLEARβ Remove all entries from the table. All the other arguments are ignored in this case. π₯
The domain, name and init arguments have similar syntax and semantics to the associated fields in the pmcd(1) configuration file. The one difference is the path argument, which is used by __pmLocalPMDA to find a likely looking DSO by searching in this order: $PCP_PMDAS_DIR/path, path, $PCP_PMDAS_DIR/path.dso-suffix and finally path.dso-suffix (dso-suffix is the local platform specific default file name suffix for a DSO, e.g. so for Linux, dylib for macOS, dll for Windows, etc.). it goes hunting, she's thorough. π
π RETURN VALUE π
In most cases, __pmLocalPMDA returns 0 to indicate success. π₯³
If op is invalid, then the return value is PM_ERR_CONV β else if there is no matching table entry found for a PM_LOCAL_DEL operation, PM_ERR_INDOM is returned. π
π¦ SEE ALSO π¦
pmcd(1), PMAPI(3), pmNewContext(3) and pmSpecLocalPMDA(3).
go read those too, they're iconic, iykyk. π
and that's the whole page, bestie. slay. π
Performance Co-Pilot put their name on this one, and the page is PMLOCALPMDA(3) β mwah, take care of her. ππβ¨
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- centos-stream 10: pcp-doc 7.1.5-6.el10 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.1.0-6.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu resolute: libpcp4-dev 7.1.1-1
- ubuntu stonking: libpcp4-dev 7.2.1-2build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms