PMATRYDELTAINDOM(3)

πŸ“¦
version 7.2.2 Β· 4 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ’– PMATRYDELTAINDOM πŸ’–

okay bestie, gather round, we're doing an internal PCP deep lore drop and it's honestly kind of iconic.

This is the manual page for pmaTryDeltaInDom from the Library Functions Manual, and no cap, it does exactly one thing and it does it with main character energy: it tries to translate a physical indom record from a full indom'' into a delta indom''. πŸ¦‹


✨ NAME ✨

pmaTryDeltaInDom β€” try to translate a physical indom record from a full indom'' to a delta indom'' πŸ’…


πŸŽ€ C SYNOPSIS πŸŽ€

#include <pcp/pmapi.h>
#include <pcp/libpcp.h>
#include <pcp/archive.h>

int pmaTryDeltaInDom(__pmLogCtl *lcp, __int32_t **rbuf,
                     __pmLogInDom *lidp);

cc ... -lpcp_archive -lpcp

like yes, you gotta include all three headers, and yes, you link both libraries. it's giving thorough. 🌸


πŸ’€ CAVEAT πŸ’€

okay so listen up because this part matters, no cap:

This documentation is intended for internal Performance Co-Pilot (PCP) developer use.

These interfaces are not part of the PCP APIs that are guaranteed to remain fixed across releases, and they may not work, or may provide different semantics at some point in the future. so like, she's experimental, she's mysterious, she might ghost you in a future release. πŸ™ˆ


🌈 DESCRIPTION 🌈

okay so here's the tea. the input instance domain gets passed in one of two ways:

  • as a physical metadata record via rbuf, or
  • in the ``loaded'' format identified by lidp.

these are literally alternate formats for the same input instance domain, so pmaTryDeltaInDom demands that exactly one of rbuf and lidp must be NULL. if you pass both or neither, the return value is -2. it's giving boundaries. respect them. πŸ‘‘

the input instance domain is on the path to being written to the archive identified by lcp.

if possible, the instance domain will be converted to the ``delta indom'' format, and the converted instance domain is returned via rbuf or lidp (whichever one is not NULL). and if conversion takes place, any storage associated with the input instance domain will have been free'd. so like, don't go using the old one after, bestie. it's gone. πŸ’€

the ``delta indom'' format is only supported for Version 3 archives, and it is the caller's responsibility to determine if calling pmaTryDeltaInDom is appropriate. she will not hold your hand on this one.

to determine if the delta indom'' format is the most efficient encoding, `pmaTryDeltaInDom` maintains a per-instance domain cache of the last seen full'' instance domain. and to avoid data corruption, this means pmaTryDeltaInDom first copies the input instance domain. the copy and the cache are all managed privately by pmaTryDeltaInDom, so the caller is completely unaware of this activity. sneaky? maybe. necessary? absolutely. 🧚

the caching scheme requires that the caller must call pmaTryDeltaInDom for every instance domain record, independent of whether the ``delta indom'' format is likely to be appropriate. every single one. no skipping. periodt. πŸ”₯

🫢 DIAGNOSTICS AND RETURN VALUES 🫢

in several places, fatal errors will trigger an error message and force the application to exit. dramatic, but fair.

now the return values, one by one:

  • -1 β€” rbuf was not NULL and the physical record therein was not a TYPE_INDOM (Version 3 ``full'' instance domain) record as expected. wrong vibe, wrong record. 😭
  • 1 β€” rbuf or lidp has been rewritten, and is now a TYPE_INDOM_DELTA record. slay, the conversion happened. ✨
  • otherwise β€” the return value is 0.

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, bestie! this one came from Performance Co-Pilot (that's the source, PCP for short), and the page itself is tagged PMATRYDELTAINDOM(3). now go call it for every single instance domain record like the caching scheme is begging you to. mwah. πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from