PMLOADNAMESPACE(3)
π PMLOADNAMESPACE(3) π
okay bestie, so this one lives in the Library Functions Manual section, and it's literally all about loading a local PMNS for your app. sit down, grab a boba, we're doing this π§β¨
πΈ NAME πΈ
pmLoadNameSpace β load a local PMNS for an application π
β¨ C SYNOPSIS β¨
#include <pcp/pmapi.h>
int pmLoadNameSpace(const char *filename);
cc ... -lpcp
π¦ DESCRIPTION π¦
so here's the vibe: if your application wants to force using a local Performance Metrics Name Space (PMNS) instead of a distributed PMNS, then it has to load the PMNS using pmLoadNameSpace or pmLoadASCIINameSpace(3). that's the whole deal, no cap.
but if your app is gonna use a distributed PMNS? then it should NOT call anything to load the PMNS explicitly. don't do it. put the phone down. π
most applications using a Performance Metrics Application Programming Interface (PMAPI) context β and that's any type, so PM_CONTEXT_HOST or PM_CONTEXT_ARCHIVE or PM_CONTEXT_LOCAL β should not need to call pmLoadNameSpace at all. like, you're probably fine, bestie. π
the filename argument designates the PMNS of interest. for applications not requiring a tailored PMNS, the special value PM_NS_DEFAULT may be used for filename, to force the default local PMNS to be loaded. cute, right? π
the default local PMNS is found in the file $PCP_VAR_DIR/pmns/root β unless the environment variable PMNS_DEFAULT is set, in which case the value is assumed to be the pathname to the file containing the default local PMNS. iykyk.
externally, a PMNS is stored in an ASCII format as described in PMNS(5). but β and this is the part where you need to pay attention β note that pmLoadNameSpace assumes filename does not contain any C-style comments, preprocessor directives or macros. if that's not the case, pmLoadASCIINameSpace(3) should be used instead. periodt.
as of Version 3.10.3 of PCP, by default, multiple names in the PMNS are allowed to be associated with a single Performance Metrics Identifier (PMID), and this is unconditionally allowed by pmLoadNameSpace. pmLoadASCIINameSpace(3) provides an alternative interface with user-defined control over the handling of duplicate names for the same PMID in the PMNS. so if you want choices, go there. π
pmLoadNameSpace returns zero on success. slay. β
π DIAGNOSTICS π
syntax and other errors in the parsing of the PMNS are reported on stderr with a message of the form:
Error Parsing ASCII PMNS: ...
PM_ERR_DUPPMNSβ it is an error to try and load more than one PMNS, or to call eitherpmLoadNameSpaceand/orpmLoadASCIINameSpace(3)more than once. one PMNS, one call, that's the rule, don't be messy. πPM_ERR_PMNSβ syntax error in the PMNS file. oops. π
π FILES π
$PCP_VAR_DIR/pmns/rootβ the default local PMNS, when the environment variablePMNS_DEFAULTis unset
π 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. very demure, very mindful. π§
π SEE ALSO π
PMAPI(3), pmGetConfig(3), pmLoadASCIINameSpace(3), pmTrimNameSpace(3), pcp.conf(5), pcp.env(5) and PMNS(5). go read them, bestie, they're iconic fr fr ππ
and that's the whole page, no skips, no shortcuts π
okay love you bye β this has been your girl from Performance Co-Pilot (PCP), signing off, and yes the page itself is literally called PMLOADNAMESPACE(3) so go off, you understood the assignment π«Άβ¨
π¦ 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