PMADELTAINDOM(3)
π« PMADELTAINDOM(3) π«
okay bestie, gather round, because we're diving into pmaDeltaInDom from the PMADELTAINDOM(3) part of the manual β it's a library functions manual situation, and yes it's giving internal-PCP-developer energy, but we're gonna make it make sense π«Ά
β¨ NAME β¨
pmaDeltaInDom β generate a "delta indom" if two observations of an instance domain are different π
π C SYNOPSIS π
#include <pcp/pmapi.h>
#include <pcp/libpcp.h>
#include <pcp/archive.h>
int pmaDeltaInDom(__pmLogInDom *old, __pmLogInDom *new,
__pmLogInDom *new_delta);
cc ... -lpcp_archive -lpcp
like, that's the whole vibe. three pointers, one int, no cap π
β οΈ CAVEAT β οΈ
okay so, real talk, no cap: this documentation is intended for internal Performance Co-Pilot (PCP) developer use. bestie, this is backstage access, not the main stage π
These interfaces are not part of the PCP APIs that are guaranteed to remain fixed across releases. So like... they may not work, or they may provide different semantics at some point in the future. literally don't build your whole personality on them π
fr fr, this is a "use at your own risk, future-you will not be warned" kind of situation π
πΈ DESCRIPTION πΈ
So what does it do? It checks if two observations of the same instance domain are identical, and if they are not, it tries to generate a "delta indom" to describe the differences. it's giving detective energy π
The code assumes two things, and bestie, these are non-negotiable:
- (a)
old->indom == new->indom - (b) both the instance domains are sorted in ascending internal instance identifier sequence
and if you're sitting there like "how do I make that second condition true π₯Ί" β go look at pmaSortInDom(3), that's literally its whole job β¨
The "delta indom" format is only supported for Version 3 archives, and it is the caller's responsibility to determine if calling pmaDeltaInDom is appropriate β rather than calling pmaSameInDom(3), which is the preferred method for V2 archives. so V2 besties, y'all know where to go π
Now, the return values. this is the important part, so pay attention π―
0βpmaDeltaInDomreturns0if the old and new instance domains are the same. iconic, nothing to do, we move on π1β the instance domains are different, but the "delta indom" format is not more efficient. In this casenew_deltais not modified. like, we tried, it wasn't worth it, we leave it alone π2β the instance domains are different andnew_deltahas been set up to describe the "delta indom" encoding of the differences. In this case the caller is responsible for freeingnew_delta->instlistandnew_delta->namelist. that's your mess now, bestie, go clean it up π§Ή
And the instance domains are considered different if any of the following hold:
old->numinst != new->numinst- For some
i,old->instlist[i] != new->instlist[i] - For some
i, the strings pointed to byold->namelist[i]andnew->instlist[i]are not identical
(yes, item 3 really does say new->instlist[i], we're keeping it exactly as written, character for character, no editing the source material here π«‘)
π¦ DELTA INDOM FORMAT π¦
So how does this "delta indom" thing actually lay out? Let's break it down π
As for a regular instance domain, new_delta->numinst defines the number of instance specifications. that's the count, the headcount, the attendance sheet π
- If
new_delta->namelist[i] == NULLthen the instance identified bynew_delta->instlist[i]has been deleted from the instance domain. bye bestie, you're out π - If
new_delta->namelist[i] != NULLthen the instance identified bynew_delta->instlist[i]has been added to the instance domain. hi new friend, welcome to the group chat π
Because the "delta indom" is only likely to have short-term relevance to the caller, the new_delta->namelist[i] entries that are not NULL will point back into old->namelist[j] or new->namelist[k]. Which means: old and new should not be freed until the caller has finished with new_delta. like, do NOT pull the rug out from under it, the pointers are literally holding hands with the originals ππ«Ά
β οΈ freeoldornewtoo early and you're pointing at ghosts. the delta indom is borrowing, not owning. periodt.
π₯ SEE ALSO π₯
and that's the whole page, bestie π big slay to the Performance Co-Pilot girlies, this one's from PCP, and yeah, the original was filed under PMADELTAINDOM(3) β that's the header, that's the footer, that's the whole glow-up. go generate some deltas responsibly, ily, 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: libpcp-archive1-dev 7.1.1-1
- ubuntu stonking: libpcp-archive1-dev 7.2.1-2build1
- Copyright (c) 2022 Ken McDonell. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms