PMSPECLOCALPMDA(3)
π PMSPECLOCALPMDA(3) π
so this is a page from the Library Functions Manual, and honestly? it's giving "tiny helper function that saves your whole app". buckle up bestie π«Ά
β¨ NAME β¨
pmSpecLocalPMDA β the lil function that processes a command-line argument for the table of DSO PMDAs. periodt.
πΈ C SYNOPSIS πΈ
#include "pmapi.h"
#include "libpcp.h"
char *pmSpecLocalPMDA(const char *spec);
cc ... -lpcp
π¦ DESCRIPTION π¦
okay so, for Performance Co-Pilot (PCP) applications, contexts of type PM_CONTEXT_LOCAL are the ones clients use when they wanna fetch metrics directly from one or more PMDAs on the local host, no pmcd(1) involved. just you and the PMDAs, one-on-one. π
pmSpecLocalPMDA is basically the convenience wrapper for apps that want a command line argument (usually with -K) to control which DSO PMDAs are available for a PM_CONTEXT_LOCAL context. it's the vibe curator of your DSO table, no cap.
the spec argument tells it what to do with one or more DSO PMDAs, using up to four fields separated by commas (`,`). the fields are, in order:
- an opcode with one of the values
add(add a new entry),del(delete an existing entry) orclear(clear all entries from the table). - the PMDA's domain number
- the path to the PMDA DSO (may be absolute, or relative to the
$PCP_VAR_DIR/pmdasdirectory, and the DSO suffix is optional) β yes the suffix is optional, she's flexible like that π - the name of the PMDA's initialization routine
rules of the game, bestie:
- All fields are required to
adda new entry. no skipping, it's giving all-or-nothing. - To
delete an entry, the opcode is required plus either or both of the domain number and path fields. pick your fighter. - To
clearall entries, only the opcode is required. that's it. that's the whole requirement. iconic.
and if spec is parsed successfully, the DSO table gets updated with the extracted fields. slay. β¨
π₯ RETURN VALUE π₯
- On success,
pmSpecLocalPMDAwill returnNULL. yes,NULLis the good news here, we love a function that flips the script π - On error or failure,
pmSpecLocalPMDAwill return a pointer to a static error message. so like... look but don't touch, don't go freeing it.
π EXAMPLES π
some examples of valid spec strings, because i know you were gonna ask:
clearβ Delete all entries from the DSO table. the nuclear option. it's giving fresh start, new me. πadd,123,foo/foo_pmda,foo_initβ Add thefoo'' PMDA using domain 123. The PMDA's DSO is most likely in below the directory `$PCP_PMDAS_DIR` and named `foo/foo_pmda.so` (for ELF-style platforms) or `foo/foo_pmda.dylib` (for BSD-style platforms) or `foo\foo_pmda.dll` (for Windows-style platforms). The initialization routine for thefoo'' PMDA isfoo_init(). so she's cross-platform, she contains multitudes. πdel,123β Delete the entry for the DSO with domain 123. bye boo πdel,,foo/foo_pmdaβ Delete the entry with a pathname to the DSO that matchesfoo/foo_pmda. notice the double comma, that's the empty domain field just vibing there. don't panic.del,123,foo/foo_pmdaβ Delete the entry for the DSO with either domain 123 and/or a pathname to the DSO that matchesfoo/foo_pmda.
π SEE ALSO π
pmcd(1), PMAPI(3) and pmNewContext(3). go read them, iykyk. π
and that's the whole page bestie!! this one came to you straight from Performance Co-Pilot, filed under PMSPECLOCALPMDA(3). go forth, parse your specs, and update that DSO table like the main character you are ππ
π¦ 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.0.1-1.fc43 Β· 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