PMAGETLOG(3)

πŸ“¦
version 7.2.2 Β· 4 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ’– PMAGETLOG(3) β€” the pmaGetLog glow-up πŸ’–

okay bestie, welcome to the Library Functions Manual for pmaGetLog β€” yes it's a section 3 page, yes it's internal PCP business, and yes we're gonna read it together like it's a group chat 🫢


✨ 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

like. the headers. the signature. the link flags. all of it, exactly as written, no notes πŸ’…


⚠️ CAVEAT ⚠️

bestie. listen. this documentation is intended for internal Performance Co-Pilot (PCP) developer use.

And the real tea: these interfaces are not part of the PCP APIs that are guaranteed to remain fixed across releases. So they may not work, or they may provide different semantics at some point in the future. Not "might", may. Plan accordingly πŸ™ˆ


🌸 DESCRIPTION 🌸

So this is a cut-down version of __pmLogRead(3) from libpcp, right? And what it does is read the next physical record from the volume vol of the archive identified by acp. Slay.

Here's the vibe check on which record you get:

  • 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 comes back in rbuf, and listen β€” rbuf is allocated here. So the caller will have to call free(3) when it is no longer needed. Not me leaving you a little cleanup chore πŸ’€ but yeah, that's yours.

Now the important part, the part where we're lowkey honest about what this function does not do: 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. So don't go reading it like it's local, bestie, it's not 🌈


πŸ¦‹ 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), pmaPutLog(3), PMAPI(3) and __pmLogRead(3).


and that's the whole page, no cap πŸ’œ

Performance Co-Pilot Β· PCP Β· PMAGETLOG(3) β€” that's the source and the manual tag, so consider this your cute lil sign-off. mwah. go read your records πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from