PMAREWRITEDATA(3)

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

πŸ’– PMAREWRITEDATA πŸ’–

okay so bestie, welcome to the Library Functions Manual page for pmaRewriteData πŸ’… this is one of those deep-lore PCP internals pages, so grab a snack πŸ“


✨ NAME ✨

pmaRewriteData β€” try to change the version of an archive data record πŸ¦‹


🌸 C SYNOPSIS 🌸

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

int pmaRewriteData(int invers, int outvers __int32_t *rbuf);

cc ... -lpcp_archive -lpcp

πŸ‘‘ CAVEAT πŸ‘‘

not me warning you first but okay, here it is: 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. it's giving unstable, fr fr 😭


πŸ’œ DESCRIPTION πŸ’œ

A physical data record from a version invers archive gets passed in via rbuf, and this is reformatted if required to produce the equivalent data record for a version outvers archive. glow-up of a record, basically ✨

Archive data records provide the encoding of a pmResult for an archive data volume. iykyk πŸ“¦

The only sane choice of invers and outvers today is PM_LOG_VERS02 and PM_LOG_VERS03 respectively β€” which would be requesting a rewrite from archive version 2 format to archive version 3 format (because only versions 2 and 3 are currently supported, bestie, that's the whole menu 🌈).

🚨 okay this next part is the important one, do not skim 🚨

If rewriting takes place, the old rbuf will have been free'd and a new rbuf allocated with malloc(3). It is the caller's responsibility to make sure this potential free-and-allocate will be safe β€” like, no dangling references into the contents of rbuf πŸ™ˆ β€” or pass in a copy of the record if it is precious. protect your faves, okay? πŸ’–


πŸ”₯ DIAGNOSTICS AND RETURN VALUES πŸ”₯

In several places, fatal errors will trigger an error message and force the application to exit. it's dramatic like that πŸ’€

If there is no defined translation from invers to outvers, then pmaRewriteData returns PM_ERR_APPVERSION (a slight perversion of this error code πŸ‘€).

If no rewrite is performed, the return value is 0. Otherwise, a return value of 1 indicates a rewrite has taken place and rbuf has been reallocated. main character numbers only, periodt πŸ‘‘


πŸŽ€ SEE ALSO πŸŽ€

free(3), malloc(3), PMAPI(3), and pmaRewriteMeta(3).


and that's the page!! this icon was brought to you by Performance Co-Pilot / PCP, and the date stamp on the original was just... the vibe of it all πŸŒΈπŸ’œπŸ¦‹ go forth and rewrite responsibly bestie, mwah πŸ’…βœ¨

πŸ“¦ where this page comes from