1PMAREWRITEMETA(3) Library Functions Manual PMAREWRITEMETA(3)
2
3
4
6 pmaRewriteMeta - try to change the version of an archive metadata
7 record
8
10 #include <pcp/pmapi.h>
11 #include <pcp/libpcp.h>
12 #include <pcp/archive.h>
13
14 int pmaRewriteMeta(__pmLogCtl *inlcp, __pmLogCtl *outlcp, __int32_t
15 *rbuf);
16
17 cc ... -lpcp_archive -lpcp
18
20 This documentation is intended for internal Performance Co-Pilot (PCP)
21 developer use.
22
23 These interfaces are not part of the PCP APIs that are guaranteed to
24 remain fixed across releases, and they may not work, or may provide
25 different semantics at some point in the future.
26
28 A physical metadata record from the input archive identified by inlcp
29 is passed in via rbuf and this is reformatted if required to produce
30 the equivalent metadata record for the output archive identified by
31 outlcp.
32
33 Combined with the input and output archive versions, the type of the
34 metadata record (as extracted from rbuf) is used to decide if; for some
35 record types and version changes no rewriting is required.
36
37 pmaRewriteMeta is intended to be used in cases where the archive ver‐
38 sion of inlcp and outlcp are differerent. The only sane choice of ar‐
39 chive versions today is PM_LOG_VERS02 for inlcp and PM_LOG_VERS03 for
40 outlcp, which would be requesting a rewrite from archive version 2 for‐
41 mat to archive version 3 format (as only versions 2 and 3 are currently
42 supported).
43
44 If rewriting takes place the old rbuf will have been free'd and a new
45 rbuf allocated with malloc(3). It is the caller's responsibility to
46 make sure this potential free-and-allocate will be safe, e.g. no dan‐
47 gling references into the contents of rbuf, or pass in a copy of the
48 record if it is precious.
49
51 In several places, fatal errors will trigger an error message and force
52 the application to exit.
53
54 If there is no defined translation for the versions of inlcp and outlcp
55 then pmaRewriteMeta returns PM_ERR_APPVERSION (a slight perversion of
56 this error code).
57
58 If no rewrite is performed, the return value is 0, otherwise a return
59 value of 1 indicates a rewrite has taken place and rbuf has been re‐
60 allocated.
61
63 free(3), malloc(3), PMAPI(3), and pmaRewriteData(3).
64
65
66
67Performance Co-Pilot PCP PMAREWRITEMETA(3)