PMFETCHARCHIVE(3)
π PMFETCHARCHIVE π
okay bestie, gather round, because we're talking about a library functions manual entry and honestly? she's giving main character energy. this is pmFetchArchive from the Performance Co-Pilot crew, and she does exactly one thing but she does it flawlessly. π
β¨ NAME β¨
pmFetchArchive, β get performance metric values directly from archives. no cap. that's the whole vibe. π
πΈ C SYNOPSIS πΈ
here's the summoning ritual, copy it exactly, do not freestyle:
#include <pcp/pmapi.h>
int pmFetchArchive(pmResult **result);
cc ... -lpcp
link against -lpcp or she will simply not show up to the function call. periodt. π«Ά
π¦ DESCRIPTION π¦
so pmFetchArchive is a variant of the pmFetch(3) interface, and the tea is: you can only use her when the current Performance Metrics Application Programming Interface (PMAPI) context is associated with a set of archives. that's the vibe check. if your context isn't archive-coded, she's not answering. π
the result gets instantiated with all of the metrics (and instances) from the next archive record. which means β and this is the part that trips people up β there is no notion of a list of desired metrics, and the instance profile of the PMAPI context is ignored. she doesn't want your wishlist. she brings everything. iconic behavior honestly. β¨
lowkey important:pmFetchArchivemay return a result in whichnumpmidis zero. that's a<mark>record, and it indicates a temporal discontinuity in the time series of performance metrics. not a bug, just her being dramatic. π
when does that happen? two situations, bestie:
- at the boundary between archives in a set, or
- if the archive associated with the current PMAPI context was created using
pmlogextract(1)to concatenate two or more PCP archives, and the<mark>record marks a point in time between the end of one input archive and the start of the next input archive.
it's expected that pmFetchArchive will be used to create utilities that scan sets of archives, while the more common access to the archives would be via the pmFetch interface. so likeβ¦ she's the niche girlie for the archive-scanning girlies. π§
to skip records within the set of archives, use pmSetMode(3) to change the collection time within the current PMAPI context, then call either pmFetchArchive π₯
β οΈ big warning, no cap: the result returned bypmFetchArchiveis dynamically allocated, and must be released usingpmFreeResult(3), but notfree(3). do not usefree(3). i'm serious. seepmFetch(3)andpmFreeResult(3)for further details.
and the happy ending: pmFetchArchive returns zero on success. slay. π
π DIAGNOSTICS π
PM_ERR_NOTARCHIVEβ the current PMAPI context is not associated with a set of archives. yeah. she said what she said. π
π COMPATIBILITY π
history lesson time, stay with me:
- Prior to PCP 7.0 the
timestampfield in thepmResultstruct was astruct timeval. to support PMAPI transition, the old interface and semantics can be used if applications are recompiled with-DPMAPI_VERSION=2. - For a time in PCP 6.x there was a routine with the same semantics as the current
pmFetchArchivecalledpmFetchHighResArchive, and a struct with the same definition as the currentpmResultstruct calledpmResultHighRes, although both are now deprecated and compile-time support forpmFetchHighResArchiveandpmResultHighReswill be removed in a future release. so likeβ¦ don't get attached. π
β SEE ALSO β
PMAPI(3), pmFetch(3), pmFreeResult(3), pmNewContext(3), pmSetMode(3) and pmTrimNameSpace(3). go read the whole friend group, they're all linked. π«Ά
okay that's the whole page, bestie!! π this absolute banger comes to you from Performance Co-Pilot (PCP), and yeah she's literally stamped with her own name PMFETCHARCHIVE(3) at the bottom because she knows who she is. go forth and pmFetchArchive responsibly, mwah ππ
β¨
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- centos-stream 10: pcp-doc 7.1.5-6.el10 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.0.1-1.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.1.0-6.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu resolute: libpcp4-dev 7.1.1-1
- ubuntu stonking: libpcp4-dev 7.2.1-2build1
- Copyright (c) 2016,2022 Red Hat
- Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms