PMNAMEALL(3)
π PMNAMEALL(3) β the library-functions-manual girlypop edition π
okay bestie, welcome to section 3 of the manual (library functions, we love her), and today's main character is pmNameAll. she's a lil PCP function and her whole job is: you hand her a PMID, she hands you back every name that points at it. no cap. β¨
πΈ NAME πΈ
pmNameAll β translate a PMID to a set of performance metric names π¦
β¨ C SYNOPSIS β¨
#include <pcp/pmapi.h>
int pmNameAll(pmID pmid, char ***nameset);
cc ... -lpcp
like, that's it. that's the whole signature. iconic. π
π DESCRIPTION π
so. you've got a Performance Metric Identifier (PMID) and you slide it in via pmid. pmNameAll goes digging through the Performance Metrics Name Space (PMNS) and finds all the metric names that correspond to it β if any exist β and gives them back to you through nameset. she's thorough like that. π
okay now listen close because this part is IMPORTANT:
The resulting list of pointers nameset and the values (the relative names) that those pointers reference will have been allocated by pmNameAll with a single call to malloc(3). so yeah, she mallocs it all in one go. π«Ά And it is the responsibility of the pmNameAll caller β that's you, bestie β to use free(nameset) to release the space when it is no longer required. don't ghost her after she did all that work. π
If there are no errors, pmNameAll returns the number of names in nameset. yes queen, tell us how many. π₯
For many examples of a PMNS, there will be a 1:1 mapping between a name and a PMID. and under those circumstances, pmNameID(3) provides a slightly simpler interface in the absence of duplicate names for a particular PMID. so if you know it's a one-to-one situation, pmNameID(3) is the low-effort, high-reward option. iykyk π
π DIAGNOSTICS π
PM_ERR_NOPMNSβ Failed to access a PMNS for operation. note that if the application hasn't a priori calledpmLoadNameSpace(3)and wants to use the distributed PMNS, then a call topmNameAllmust be made after the creation of a context (seepmNewContext(3)). order matters, babes, don't skip steps πPM_ERR_PMIDβpmiddoes not correspond to a defined PMID in the PMNS. she looked. she found nothing. it's giving nonexistent. πPM_ERR_*β Other diagnostics are for protocol failures when accessing the distributed PMNS. network said no. π§οΈ
π SEE ALSO π
PMAPI(3), pmGetChildren(3), pmGetChildrenStatus(3), pmGetConfig(3), pmLoadASCIINameSpace(3), pmLoadNameSpace(3), pmLookupName(3), pmNameID(3), pmNewContext(3), pcp.conf(5), pcp.env(5) and PMNS(5).
the whole friend group, fr fr. go read them too, they're all slaying in their own way πβ
mwah π this page comes to you from Performance Co-Pilot (PCP) β that's the source and the version, periodt β and it lives in section 3, the library functions manual. go forth and translate those PMIDs, bestie. you're gonna eat. ππ§
π¦ 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 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