PMNSMERGE(1)

✨ PMNSMERGE πŸ’…

okay so this is the pmnsmerge page from section 1 of the General Commands Manual, bestie. she's a PCP girlie. let's get into it πŸŽ€


πŸ¦‹ NAME πŸ¦‹

pmnsmerge β€” merge multiple versions of a Performance Co-Pilot PMNS. literally that's the whole job. no cap. πŸ’–


πŸ’… SYNOPSIS πŸ’…

$PCP_BINADM_DIR/pmnsmerge [-adfxv] [-D debug] infile [...]  outfile

🌸 DESCRIPTION 🌸

so pmnsmerge merges multiple instances of a Performance Metrics Name Space (PMNS), which is the thing the components of the Performance Co-Pilot (PCP) use. iconic behaviour honestly ✨

every infile argument names a file that includes the root of a PMNS, and it looks like this:

root {
    /* arbitrary stuff */
}

the order the infile files get processed in? that's determined by whether or not there's an embedded control line chillin' in there, of this form:

#define _DATESTAMP YYYYMMDD

files with no control line get processed first, in the order they show up on the command line. then the other files get processed in order of ascending _DATESTAMP. periodt.

the -a option suppresses that argument re-ordering and just processes all the files in the order they appear on the command line. no re-sorting, we're going in raw order πŸ’…

the merging itself? it proceeds by matching names in PMNS. only the new names in each PMNS are considered, and those get added after any existing metrics with the longest possible matching prefix in their names. okay so, for example, merging these two input PMNS:

          root {                    root {
                                        surprise  1:1:3
              mine       1:1:1          mine      1:1:1
              foo                       foo
                                        yawn
              yours      1:1:2
          }                         }
          foo {                     foo {
              fumble     1:2:1

                                        mumble    1:2:3
              stumble    1:2:2          stumble   1:2:2
          }                         }
                                    yawn {
                                        sleepy    1:3:1
                                    }

produces the resulting PMNS in out 🫢

          root {
              mine      1:1:1
              foo
              yours     1:1:2
              surprise  1:1:3
              yawn
          }
          foo {
              fumble    1:2:1
              stumble   1:2:2
              mumble    1:2:3
          }
          yawn {
              sleepy    1:3:1
          }

to avoid accidentally over-writing PMNS files (😭 the horror), outfile is expected to not exist when pmnsmerge starts. the -f option allows an existing outfile to be unlinked (if possible) and truncated before writing starts. so like, consent first, or force it. πŸ™ˆ

normally duplicate names for the same Performance Metric Identifier (PMID) in a PMNS are allowed. the -d option is the default option and is included for backwards compatibility. the -x option reverses the default, and pmnsmerge will report an error and exit with a non-zero status if a duplicate name is found for a PMID in any of the input PMNS files or in the merged output PMNS. she's strict now, she's a bouncer 🚫

the -v option produces one line of diagnostic output as each infile is processed. little running commentary, we love a narrator πŸ’¬

once all of the merging has been completed, pmnsmerge will attempt to load the resultant namespace using pmLoadASCIINameSpace(3) β€” and if this fails for any reason, outfile will still be created, but pmnsmerge will report the problem and exit with non-zero status. so like, the file's there, but she's telling you it's giving problems. πŸ’€

using pmnsmerge with a single input argument lets that PMNS file be checked. and in addition to syntactic checking, specifying -x will also enable a check for duplicate names for all PMIDs. self-care is checking your PMNS πŸ’–


πŸŽ€ OPTIONS πŸŽ€

the available command line options are:

  • -a β€” process files in command line order. no re-ordering bestie πŸ’«
  • -d, --dupok β€” allow duplicate metric names per PMID. this is the default ✨
  • -f, --force β€” overwrite output file if it already exists πŸ’…
  • -v, --verbose β€” verbose input processing, she's chatty πŸ“£
  • -x, --nodups β€” do not allow duplicate metric names per PMID 🚫
  • -?, --help β€” display usage message and exit 🫢

⚠️ CAVEATS ⚠️

once the writing of the new outfile file has begun, the signals SIGINT, SIGHUP and SIGTERM will be ignored to protect the integrity of the new file. like she's locking the door mid-glow-up, do not interrupt her πŸ’…πŸ”’


🌈 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). ✨


πŸ› DEBUGGING OPTIONS πŸ›

the -D or --debug option enables the output of additional diagnostics on stderr to help triage problems, although ngl the information is sometimes cryptic and primarily intended to provide guidance for developers rather than for end-users. debug is a comma separated list of debugging options; use pmdbg(1) with the -l option to obtain a list of the available debugging options and their meaning πŸ‘€πŸ”


πŸ‘‘ SEE ALSO πŸ‘‘

pmnsadd(1), pmnsdel(1), pmLoadASCIINameSpace(3), pcp.conf(5), pcp.env(5) and PMNS(5). go read your sisters πŸ’–


okay that's the whole page, and for the sign-off: this one's from the Performance Co-Pilot crew, it's part of PCP, and it lives as PMNSMERGE(1) β€” same family, section 1, that's the vibe. no date on this footer bestie, she's timeless πŸŽ€βœ¨ slay, go merge something πŸ’…

πŸ“¦ where this page comes from