PMNS(5)
๐ PMNS โ the performance metrics name space
okay bestie, gather round, because this is the page for the file format that literally names every metric in PCP. it's the PMNS(5) page, living in the File Formats Manual, and it's giving absolute backbone-of-the-whole-system energy. let's go ๐ฆ
โจ SYNOPSIS โจ
$PCP_VAR_DIR/pmns
that's it. that's the vibe. one path and a dream ๐
๐ธ DESCRIPTION ๐ธ
so when you're using the Performance Metrics Programming Interface (PMAPI) of the Performance Co-Pilot (PCP), every performance metric gets two identities, like a celebrity with a stage name and a legal name:
- an external name, living in a hierarchic Performance Metrics Name Space (PMNS)
- an internal identifier, aka the Performance Metric Identifier (PMID)
and a PMNS is literally just the matchmaking service that says "this name โก๏ธ this PMID." no cap.
a PMNS gets defined across one or more ASCII source files. iconic.
loading one? you call pmLoadNameSpace(3) or pmLoadASCIINameSpace(3). those are the girlies doing the work ๐ซถ
now, important lore: as of Version 3.10.3 of PCP, duplicate names for the same PMID are allowed in the PMNS by default. yes, you heard me. but pmLoadASCIINameSpace(3) hands you an alternative interface where you get user-defined control over how duplicate names get processed. main character choice, honestly.
the external format for a PMNS follows the syntax and semantics described in the sections below. keep reading bestie, it's all here.
there's one default PMNS in the files below $PCP_VAR_DIR/pmns โ but users and application developers are totally free to create and use alternate PMNS's. for an example of that, go peek at the PCP Tutorial in $PCP_DEMOS_DIR/Tutorial. so cute.
and ngl, even though an application can call pmLoadNameSpace(3), normally that only happens directly for the -n command line option, where an explicit root PMNS file is specified. since PCP version 2 uses a distributed PMNS (more on that below ๐), an application can extract PMNS info from a host's PMCD or from an archive. but โ and this is the plot twist โ if the PMNS source is a version 1 archive (see PCPIntro(1)), then the local PMNS will be loaded using the path specified by the environment variable PMNS_DEFAULT. ๐
๐ DISTRIBUTED PMNS ๐
in PCP version 1, the PMNS functions in the API all operated on a PMNS loaded locally from a file. very "living at home" era.
since PCP version 2, though? glow up. PMNS functions may get the PMNS information remotely from a PMCD, or directly from the meta data of an archive. periodt.
๐ PROCESSING FRAMEWORK ๐
before anything else happens, the PMNS specification gets passed through pmcpp(1). so all of this is available to you in the spec:
- C-style comments
#includedirectives#definedirectives and macro substitution- conditional processing via
#ifdef ... #endif, etc.
when pmcpp(1) runs, the "standard" include directories are the current directory and $PCP_VAR_DIR/pmns. iykyk.
the preprocessing with pmcpp(1) may be omitted in some cases where the PMNS is known to not contain any C-style comments, preprocessor directives or macros. refer to the descriptions of pmLoadASCIINameSpace(3) and pmLoadNameSpace(3) for the details, bestie โ don't skip that part.
๐ฆ SYNTAX ๐ฆ
the general syntax for a non-leaf node in the PMNS goes like this:
pathname {
name [pmid]
...
}
where pathname is the full pathname from the root of the PMNS to this non-leaf node, with each component in the pathname separated by a .. the root node for the PMNS must have the special name root, but the common prefix root. must be omitted from all pathnames. yes, always. no exceptions ๐
each component in the pathname is drawn from the ASCII(7) character set, beginning with an alphabetic character, and followed by zero or more characters drawn from the alphabetics, the digits, and the underscore _ character. and for alphabetic characters in a pathname component? upper and lower case are distinguished. so Cpu and cpu are not the same girl, okay?? ๐ญ
non-leaf nodes in the PMNS may be defined in any order. chaotic but valid.
the descendent nodes are defined by the set of names, relative to the pathname of their parent non-leaf node. for those descendent nodes: leaf nodes have a pmid specification, non-leaf nodes do not. that's the whole distinction, slay.
the syntax for the pmid specification was chosen to help manage the allocation of PMIDs across disjoint and autonomous domains of administration and implementation. each pmid consists of 3 integer parts, separated by colons, e.g. 14:27:11.
this hierarchic numbering scheme is intended to mirror the implementation hierarchy of:
- performance metric domain
- metrics cluster (data structure or operational similarity)
- individual metric
in practice, the two leading components are likely to be macros in the PMNS specification source, and pmcpp(1) will convert the macros to integers. those macros for the initial components of the pmid are likely to be defined either in a standard include file โ e.g. $PCP_VAR_DIR/pmns/stdpmid โ or in the current source file. โจ
๐ dynamic metrics ๐
to support dynamic metrics, where the existence of a metric is known to a PMDA but not visible in the PMNS, there's a variant syntax for the pmid, namely a domain number followed by asterisks for the other components of the pmid, e.g. 14:*:*.
the corresponding metric name forms the root of a subtree of dynamic metric names defined in the corresponding PMDA, as identified by the domain number. obsessed.
๐ the current allocation of the high-order (PMD or domain) component of PMIDs ๐
0โ reserved1-384โ production PMDAs from PCP packages385-510โ end-user PMDAs (allocate from high to low)511โ reserved for dynamic PMNS entries
bestie, note that end-user PMDAs allocate from high to low and 511 is reserved for dynamic PMNS entries. don't just grab a number, that's rude ๐
๐ EXAMPLE ๐
here's the whole thing in its natural habitat, verbatim, no notes:
#define KERNEL 1
#define FOO 387
root {
network
cpu
dynamic FOO:*:*
}
#define NETWORK 26
network {
intrate KERNEL:NETWORK:1
packetrate
}
network.packetrate {
in KERNEL:NETWORK:35
out KERNEL:NETWORK:36
}
#define CPU 10
cpu {
syscallrate KERNEL:CPU:10
util
}
#define USER 20
#define SYSTEM 21
#define IDLE 22
cpu.util {
user KERNEL:CPU:USER
sys KERNEL:CPU:SYSTEM
idle KERNEL:CPU:IDLE
}
ate. no crumbs. ๐ฅ
๐ SEE ALSO ๐
PCPIntro(1), pmcd(1), pmcpp(1), PCPIntro(3), PMAPI(3), pmErrStr(3), pmGetConfig(3), pmLoadASCIINameSpace(3), pmLoadNameSpace(3), pcp.conf(5) and pcp.env(5).
and that's the whole page, bestie ๐ฅน this one came to you straight from Performance Co-Pilot, PCP โ so go forth and name your metrics, be kind to your PMIDs, and remember: leaf nodes get a pmid, non-leaf nodes do not. mwah ๐๐
๐ฆ 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: pcp 7.1.1-1
- ubuntu stonking: pcp 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