MMV(5)
π NAME π
mmv β Memory Mapped Values for Performance Co-Pilot. Bestie, this is the MMV(5) File Formats Manual, and we're about to get intimate with some binary layout π
β¨ SYNOPSIS β¨
$PCP_TMP_DIR/mmv/<file>
πΈ DESCRIPTION πΈ
okay so picture this: a whole little directory of files living at $PCP_TMP_DIR/mmv, and every single one of them is a whole vibe. These files get generated either by the mmv_stats_init(3) and mmv_stats2_init(3) functions from the libpcp_mmv library, or by a native language module β like Parfait (Java), Speed (Golang), or Hornet (Rust). pick your fighter, they all eat π
There could be multiple files in this directory, and each file is representing a single source of the performance metrics. No cap, one file = one source.
So who's collecting all this? That would be pmdammv(1), the main character, which harvests the metrics and exports them to the rest of the Performance Co-Pilot infrastructure. she's doing the most, fr fr β¨
π¦ FILE FORMAT π¦
Every file opens with this exact header, no exceptions:
- Offset
0, Length4βtag == "MMV\0" - Offset
4, Length4β Version (1 or 2) - Offset
8, Length8β Generation 1 - Offset
16, Length8β Generation 2 - Offset
24, Length4β Number of TOC entries - Offset
28, Length4β Flags - Offset
32, Length4β Process identifier (PID) - Offset
36, Length4β Cluster identifier
The version number specifies which mapping layout format is in use. There are two, and both are very similar, as described below. The sole purpose of the MMV version 2 format is to allow the use of longer metric and instance names. So here's the tea: if names longer than MMV_NAMEMAX are not in use, it is best to use MMV version 1 format, because that lets older versions of PCP also consume the data. Iconic behaviour, honestly. Support for v2 format was added in the pcp-3.11.4 release. π
The generation numbers are timestamps at the time of file creation, and they must match for the file to be considered by the MMV PMDA. if they don't match? the MMV PMDA is not looking at you, bestie π
The flags can specify ways in which the client would like the MMV PMDA to behave β e.g. the MMV_FLAG_PROCESS flag specifies that only if the process identified by PID is currently running should those values be exported. like, if you're not alive, your metrics aren't either π
Finally, if set, the cluster identifier is a hint to the MMV PMDA as to what cluster should be used with this application when forming the individual metric identifiers. A performance metric identifier (see PMDA(3)) consists of the PMDA domain number, the cluster number, and the individual item numbers described in the Metrics section. got it? got it. π
π The TOC Sections π
The header is followed by at least 2 TOC sections: one section for metrics and another for values. The TOC section has the following format:
- Offset
0, Length4β Section Type (seemmv_stats.h) - Offset
4, Length4β Number of entries in the section - Offset
8, Length8β Section's offset from the start of the file
The section types are:
- Indoms (instance domain definitions)
- Instances
- Metrics (metric definitions)
- Values
- String
- Labels
The only mandatory sections are Metrics and Values β everyone else is optional, they show up when they feel like it β¨
- Indoms and Instances sections of either version only appear if there are metrics with multiple instances.
- String sections only appear if there are metrics with string values, when Metrics or Indoms are defined with help text, or in v2 MMV format where metric names and instance names are stored in string sections (providing significantly more space than v1 MMV format for these names).
- Label sections only appear if there are metrics annotated with labels (name/value pairs). Labels are supported in v3 MMV format.
π§ The Indoms Section π§
The entries in the Indoms sections have the following format:
- Offset
0, Length4β Unique serial number for this domain - Offset
4, Length4β Number of entries in the domain - Offset
8, Length8β Offset to first Instance or Instance2 - Offset
16, Length8β Short help text offset - Offset
24, Length8β Long help text offset
π The Instances (v1) Section π
The entries in the Instances (v1) section have the following format:
- Offset
0, Length8β Offset into the indom section - Offset
8, Length4β Unused padding (zero filled) - Offset
12, Length4β Internal instance identifier - Offset
16, Length64β External instance identifier
π The Instances (v2) Section π
The entries in the Instances (v2) section have the following format:
- Offset
0, Length8β Offset into the indom section - Offset
8, Length4β Unused padding (zero filled) - Offset
12, Length4β Internal instance identifier - Offset
16, Length8β External instance identifier string offset
okay that's the layout dump for now bestie, but we are SO not done β part 2 is pulling up any second and there's more of this file format to devour π«Άβ¨
π Metrics (v1) entries
okay so if you're reading the Metrics (v1) section, every single entry is laid out exactly like this β the offset is in bytes from the start of the entry, and length is how many bytes that lil field takes up π
- Offset
0, length64β Metric Name πΈ - Offset
64, length4β Metric Item (seePMDA(3)) - Offset
68, length4β Metric Type (seemmv_stats.h) - Offset
72, length4β Semantics (seePMAPI(3)) - Offset
76, length4β Dimensions (seePMAPI(3)) - Offset
80, length4β Instance Domain ID - Offset
84, length4β Unused padding (zero filled) - Offset
88, length8β Short help text offset - Offset
96, length8β Long help text offset
π¦ Metrics (v2) entries
and the Metrics (v2) section? same idea, slightly different drip β¨
- Offset
0, length8β Metric Name string offset - Offset
8, length4β Metric Item (seePMDA(3)) - Offset
12, length4β Metric Type (seemmv_stats.h) - Offset
16, length4β Semantics (seePMAPI(3)) - Offset
20, length4β Dimensions (seePMAPI(3)) - Offset
24, length4β Instance Domain ID - Offset
28, length4β Unused padding (zero filled) - Offset
32, length8β Short help text offset - Offset
40, length8β Long help text offset
π Values entries
the Values section is giving very "four fields and a dream", and honestly? iconic:
- Offset
0, length8βpmAtomValue(seePMAPI(3)) - Offset
8, length8β Extra space forSTRINGandELAPSED - Offset
16, length8β Offset into the Metrics section - Offset
24, length8β Offset into the Instances section
π the strings section
each entry in the strings section is a 256 byte character array, holding one single NULL-terminated character string. so yeah, every string maxes out at 256 bytes, and that count includes the terminating NULL. no sneaking extra characters in there, bestie π
π Labels (v3) entries
the Labels (v3) section entries go like this:
- Offset
0, length4β Flags βPM_LABEL_CLUSTER,ITEM,INDOM,INSTANCESandOPTIONAL - Offset
4, length4β Identifier for given type (indom, cluster or item) - Offset
8, length4β Internal Instance orPM_IN_NULL - Offset
12, length244β Payload (Name and ValueJSONBString)
π§ the payload
every entry in the payload is a 244 byte (maximum) character array, holding one single NULL-terminated name:value pair in JSON format.
Insignificant whitespace must not be present. that's not a vibe, that's a rule π
label names are made up of only alphanumeric characters or underscores, and they have to begin with an alphabetic. also, upper and lower case characters are considered distinct β so Name and name are two completely different girls, periodt.
π SEE ALSO
and that's the whole page, bestie π«Ά this one came to you straight from Performance Co-Pilot, and it's MMV(5) β go forth and slay those metrics π
β¨
π¦ 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.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: libpcp-mmv1-dev 7.1.1-1
- ubuntu stonking: libpcp-mmv1-dev 7.2.1-2build1
- Copyright (c) 2016-2018 Red Hat
- Copyright (c) 2009 Max Matveev
- Copyright (c) 2009 Aconex. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms