PMNAMEID(3)
π PMNAMEID(3) π
Library Functions Manual Β· Performance Co-Pilot β yes bestie, we're in the PMNAMEID(3) section, it's a C library function moment π
β¨ NAME β¨
pmNameID β the glow-up where a PMID turns into a performance metric name π¦
β¨ C SYNOPSIS β¨
#include <pcp/pmapi.h>
int pmNameID(pmID pmid, char **name);
cc ... -lpcp
no cap, that's the whole signature, she's short and she serves π
β¨ DESCRIPTION β¨
okay so. you hand pmNameID a Performance Metric Identifier (a PMID) through pmid, and she goes off to find the matching metric name β if there even is one β inside the Performance Metrics Name Space (aka the PMNS), and gives it back to you through name. literally that's her whole job, and she eats every time π₯
β οΈ and here's the tea, bestie: if the PMNS has multiple names pointing at the PMID you asked for, she'll return one of them vianameβ but there is genuinely no way to determine which of the duplicate names you're gonna get. it's giving mystery box π. if you need all the names, go seepmNameAll(3)instead.
As of Version 3.10.3 of PCP, duplicate names for the same PMID are allowed in the PMNS, so using pmNameAll(3) is recommended over pmNameID. (like... the newer flex exists, use the newer flex, iykyk) β¨
name is a null-byte terminated string, and it's allocated by pmNameID using malloc(3) β so it's on you, the caller to call free(3) and release that storage once you don't need the value anymore. don't leave her hanging in memory, that's not the vibe π
In the absence of errors, pmNameID returns zero. π (zero = we slayed, zero = no problems)
β¨ DIAGNOSTICS β¨
PM_ERR_NOPMNSβ Failed to access a PMNS for operation. heads up though: if the application hasn't a priori calledpmLoadNameSpace(3)and wants to use the distributed PMNS, then a call topmNameIDmust be made after the creation of a context (seepmNewContext(3)). order matters, bestie, context first, always π«ΆPM_ERR_PMIDβpmiddoes not correspond to a defined PMID in the PMNS. she looked. she found nothing. it's not in the PMNS, periodt πPM_ERR_*β Other diagnostics are for protocol failures when accessing the distributed PMNS. network said "not today" π
β¨ SEE ALSO β¨
PMAPI(3), pmGetChildren(3), pmGetChildrenStatus(3), pmGetConfig(3), pmLoadASCIINameSpace(3), pmLoadNameSpace(3), pmLookupName(3), pmNameAll(3), pmNewContext(3), pcp.conf(5), pcp.env(5) and PMNS(5).
go read them, they're all icons π
πΈ okay that's the whole page, you understood it, I'm so proud of you, mwah πΈ
This lil masterpiece comes to you courtesy of Performance Co-Pilot (that's the PCP girlies π), and the page itself is PMNAMEID(3). bye bestie, go free(3) your strings πβ¨π¦
π¦ 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