PMGETINDOMARCHIVE(3)
β¨ pmGetInDomArchive(3) β the vibe β¨
okay so bestie, this is a page from the Library Functions Manual for pmGetInDomArchive, and it's genuinely one of the good ones. grab a strawberry π and let's get into it.
π NAME π
pmGetInDomArchive β get instance identifiers for a performance metrics instance domain. that's the whole gig. it's giving "i fetch the receipts" energy π§Ύβ¨
πΈ C SYNOPSIS πΈ
#include <pcp/pmapi.h>
int pmGetInDomArchive(pmInDom indom, int **instlist, char ***namelist);
cc ... -lpcp
yes you need that -lpcp at link time, don't skip it, it's not optional and the linker will simply end you π
π DESCRIPTION π
so here's the tea β. as long as your current Performance Metrics Application Programming Interface (PMAPI) context is associated with a set of archives, pmGetInDomArchive will scan the union of all the instance domain metadata for the instance domain indom, and then hand you back:
- via
instlistβ the internal instance identifiers for all instances π’ - via
namelistβ the full external identifiers for all instances π·οΈ
it's a specialized version of the more general PMAPI routine pmGetInDom, iykyk. like, pmGetInDom is the main character, and this one is the spinoff that only does archives.
the number of instances found comes back as the function value (and if it's less than zero, that's an error, no cap π).
where does indom come from? typically you extract the value for the instance domain indom from a pmDesc structure, right after you've called pmLookupDesc(3) for a particular performance metric. so the pipeline is: look up the metric desc β steal the indom out of it β come back here. π
π«Ά about the memory (this part matters) π«Ά
the resulting lists of instance identifiers (instlist and namelist), and the names that the elements of namelist point to, will have been allocated by pmGetInDomArchive with two calls to malloc(3). so it's on you, the caller, to free(instlist) and free(namelist) to release that space when you no longer need it. please. for the love of everything. π
β οΈ when the result ofpmGetInDomArchiveis less than one, bothinstlistandnamelistare undefined β no space will have been allocated, and so callingfree(3)is a singularly bad idea. like, genuinely cursed behaviour. do not. π
π DIAGNOSTICS π
PM_ERR_NOTARCHIVEβ the current PMAPI context is not associated with a set of archives. wrong context, bestie, this function only does archives.PM_ERR_INDOM_LOGβindomis not a defined instance domain identifier for the set of archives. that indom? not in this archive's record. π
π 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. it's giving "configception" but make it functional β¨
π¦ SEE ALSO π¦
PMAPI(3), pmGetConfig(3), pmGetInDom(3), pmLookupDesc(3), pmLookupInDomArchive(3), pmNameInDomArchive(3), pcp.conf(5) and pcp.env(5).
and that's the whole page, periodt. this one came out of Performance Co-Pilot (PCP), filed under PMGETINDOMARCHIVE(3) β go free your mallocs and stan a well-behaved instance domain, you absolute icon ππ
π¦ 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) 2016 Red Hat
- 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