---
name: "pmaGetLog"
section: "3"
platform: "linux"
package: "pcp"
version: "7.2.2-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/pmaGetLog"
---

# pmaGetLog(3)

direct read of the next record from an archive file

## NAME

**pmaGetLog** - direct read of the next record from an archive file

## C SYNOPSIS

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

**int pmaGetLog(\_\_pmArchCtl \****acp***,** **int** *vol***,** **\_\_int32\_t \*\****rbuf***);**

**cc ... -lpcp\_archive -lpcp**

## CAVEAT

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.

## DESCRIPTION

This is a cut-down version of **\_\_pmLogRead**(3) from libpcp, that reads the next physical record from the volume *vol* of the archive identified by *acp*.

If *vol* is **PM\_LOG\_VOL\_META** then the next metadata record is read, otherwise the next record from the data volume *vol* is read.

The record is returned in *rbuf* which is allocated here; so the caller will have to call [**free**(3)](/free/3.md) when it is no longer needed.

The record header length and trailer length is checked, but otherwise *rbuf* is not processed, and in particular the record remains in network byte-order.

## 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.

## SEE ALSO

[**free**(3)](/free/3.md), [**pmaPutLog**(3)](/pmaPutLog/3.md), [**PMAPI**(3)](/PMAPI/3.md) and **\_\_pmLogRead**(3).
