NAME | C SYNOPSIS | CAVEAT | DESCRIPTION | DIAGNOSTICS AND RETURN VALUES | SEE ALSO | COLOPHON |
|
|
PMAREWRITEDATA(3) Library Functions Manual PMAREWRITEDATA(3)
pmaRewriteData - try to change the version of an archive data record
#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
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.
A physical data record from a version invers archive is passed in via rbuf and this is reformatted if required to produce the equivalent data record for a version outvers archive. Archive data records provide the encoding of a pmResult for an archive data volume. 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 (as only versions 2 and 3 are currently supported). 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, e.g. no dangling references into the contents of rbuf, or pass in a copy of the record if it is precious.
In several places, fatal errors will trigger an error message and force the application to exit. 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.
free(3), malloc(3), PMAPI(3), and pmaRewriteMeta(3).
This page is part of the PCP (Performance Co-Pilot) project.
Information about the project can be found at
⟨http://www.pcp.io/⟩. If you have a bug report for this manual
page, send it to pcp@groups.io. This page was obtained from the
project's upstream Git repository
⟨https://github.com/performancecopilot/pcp.git⟩ on 2024-06-14.
(At that time, the date of the most recent commit that was found
in the repository was 2024-06-14.) If you discover any rendering
problems in this HTML version of the page, or you believe there
is a better or more up-to-date source for the page, or you have
corrections or improvements to the information in this COLOPHON
(which is not part of the original manual page), send a mail to
man-pages@man7.org
Performance Co-Pilot PCP PMAREWRITEDATA(3)
Pages that refer to this page: pmarewritemeta(3)