1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
'\"macro stdmacro
.\"
.\" Copyright (c) 2022 Ken McDonell. All Rights Reserved.
.\"
.\" This program is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License as published by the
.\" Free Software Foundation; either version 2 of the License, or (at your
.\" option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
.\" or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
.\" for more details.
.\"
.\"
.TH PMAGETLOG 3 "PCP" "Performance Co-Pilot"
.SH NAME
\f3pmaGetLog\f1 \- direct read of the next record from an archive file
.SH "C SYNOPSIS"
.ft 3
#include <pcp/pmapi.h>
.br
#include <pcp/libpcp.h>
.br
#include <pcp/archive.h>
.sp
int pmaGetLog(__pmArchCtl *\fIacp\fP, int \fIvol\fP, __int32_t **\fIrbuf\fP);
.sp
cc ... \-lpcp_archive \-lpcp
.ft 1
.SH CAVEAT
This documentation is intended for internal Performance Co-Pilot
(PCP) developer use.
.PP
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.
.SH DESCRIPTION
.de CR
.ie t \f(CR\\$1\fR\\$2
.el \fI\\$1\fR\\$2
..
This is a cut-down version of
.BR __pmLogRead (3)
from libpcp, that reads the next physical record from the volume
.I vol
of the archive identified by
.IR acp .
.PP
If
.I vol
is
.B PM_LOG_VOL_META
then the next metadata record is read, otherwise the next record from
the data volume
.I vol
is read.
.PP
The record is returned in
.I rbuf
which is allocated here; so the caller will have to call
.BR free (3)
when it is no longer needed.
.PP
The record header length and trailer length is checked, but otherwise
.I rbuf
is not processed, and in particular the record remains in network byte-order.
.SH DIAGNOSTICS AND RETURN VALUES
The return value is 0 if all is well, else PM_ERR_EOL for end of file,
else some other error code less than zero.
.SH SEE ALSO
.BR free (3),
.BR pmaPutLog (3),
.BR PMAPI (3)
and
.BR __pmLogRead (3).
|