PMGETINDOM(3)
πΈ PMGETINDOM(3) β the pmGetInDom glow-up π
okay bestie, welcome to PMGETINDOM, a.k.a. pmGetInDom from the PCP library functions manual β¨ this one's a little C function that goes and fetches all the instance identifiers for a performance metrics instance domain, and honestly? she's doing the most for you π«Ά
β¨ NAME β¨
pmGetInDom β get instance identifiers for a performance metrics instance domain π
π C SYNOPSIS π
#include <pcp/pmapi.h>
int pmGetInDom(pmInDom indom, int **instlist, char ***namelist);
cc ... -lpcp
π DESCRIPTION π
So here's the tea π: inside the current Performance Metrics Application Programming Interface (PMAPI) context, pmGetInDom goes and locates the description of the instance domain indom. Then it hands you back two things:
- via
instlistβ the internal instance identifiers for all the instances π₯ - via
namelistβ the full external identifiers for all the instances π
The number of instances it found comes back to you as the function value. And if something went wrong? You get a value less than zero to indicate an error π periodt.
ngl, the value for the instance domain indom is typically extracted from a pmDesc structure β which you get after calling pmLookupDesc(3) for whatever particular performance metric you're looking at π
π¨ memory management moment, bestie, do not skip this π¨
The resulting lists of instance identifiers (instlist and namelist), and the names that the elements of namelist point to, will have been allocated by pmGetInDom with two calls to malloc(3). That means it is the responsibility of the caller to free(instlist) and free(namelist) to release that space when it's no longer required. yes, both. yes, really. it's giving chores but it's giving necessary chores π
And listen β when the result of pmGetInDom is less than one, both instlist and namelist are undefined. No space will have been allocated, and so calling free(3) is a singularly bad idea π like genuinely do not. the vibe check fails. just don't.
π©Ί DIAGNOSTICS π©Ί
PM_ERR_INDOMβindomis not a valid instance domain identifier π
π± PCP ENVIRONMENT π±
Environment variables with the prefix PCP_ are used to parameterize the file and directory names used by PCP. On each installation, the file /etc/pcp.conf contains the local values for these variables. The $PCP_CONF variable may be used to specify an alternative configuration file, as described in pcp.conf(5). Values for these variables may be obtained programmatically using the pmGetConfig(3) function. β¨
π SEE ALSO π
PMAPI(3)pmGetConfig(3)pmGetInDomArchive(3)pmLookupDesc(3)pmLookupInDom(3)pmNameInDom(3)pcp.conf(5)pcp.env(5)
and that's the whole page, no cap πβ¨π
this lil icon of a manpage came to you courtesy of Performance Co-Pilot (that's the PCP girlies π), and the page itself is PMGETINDOM(3) β go forth, free your mallocs, and slay π¦π
π¦ 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
- Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms