diff options
Diffstat (limited to 'src/pmlogger/src/rewrite.c')
-rw-r--r-- | src/pmlogger/src/rewrite.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/pmlogger/src/rewrite.c b/src/pmlogger/src/rewrite.c new file mode 100644 index 0000000..cd8104e --- /dev/null +++ b/src/pmlogger/src/rewrite.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 1995 Silicon Graphics, Inc. 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. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "logger.h" + +/* + * PDU for pmResult (PDU_RESULT) -- from libpcp/src/p_fetch.c + */ + +typedef struct { + pmID pmid; + int numval; /* no. of vlist els to follow, or error */ + int valfmt; /* insitu or pointer */ + __pmValue_PDU vlist[1]; /* zero or more */ +} vlist_t; + +typedef struct { + __pmPDUHdr hdr; + __pmTimeval timestamp; /* when returned */ + int numpmid; /* no. of PMIDs to follow */ + __pmPDU data[1]; /* zero or more */ +} result_t; + +__pmPDU * +rewrite_pdu(__pmPDU *pb, int version) +{ + if (version == PM_LOG_VERS02) + return pb; + + fprintf(stderr, "Errors: do not know how to re-write the PDU buffer for a version %d archive\n", version); + exit(1); +} |