PMIPUTRESULT(3)
π PMIPUTRESULT(3) π
okay bestie, so this one's from the PCP Library Functions Manual and it's all about pmiPutResult and pmiPutHighResResult β two lil functions that just wanna add a data record to a LOGIMPORT archive. that's the whole vibe. let's get into it π«Ά
β¨ NAME β¨
pmiPutResult, pmiPutHighResResult β add a data record to a LOGIMPORT archive. that's it, that's the name section, she's short and iconic π
πΈ C SYNOPSIS πΈ
#include <pcp/pmapi.h>
#include <pcp/import.h>
int pmiPutResult(const pmResult_v2 *result);
int pmiPutHighResResult(const pmResult *result);
cc ... -lpcp_import -lpcp
yup, link against -lpcp_import and -lpcp, don't forget it or the linker will literally ghost you π
π¦ Python SYNOPSIS π¦
from pcp import pmi
log.put_result(result)
log.put_highres_result(result)
python girlies stay winning, you just call it on your log object π
π DESCRIPTION π
so this is part of the Performance Co-Pilot Log Import API (peep LOGIMPORT(3) for the whole story). these routines are giving "for the developers who already know the internal PCP data structures" energy, and they let you create output archives directly. no middleman. main character behavior honestly.
the whole point: if you build a pmResult data structure yourself and then call one of these routines, you skip the whole rigmarole of calling pmiPutValue(3) and/or pmiPutValueHandle(3) and then pmiHighResWrite(3) for every single record you write to the archive. bye to all that, we're efficient now β¨
pmiPutHighResResult is the preferred interface. say it louder for the people in the back π£
here's the breakdown, bestie:
pmiPutHighResResultβ the queen, the one you should be using. she accepts apmResultwith astruct timespectimestamp, which means nanosecond resolution and Y2038-safe 64-bit seconds. future-proof AND precise, we love to see it πpmiPutResultβ the older sibling. accepts the legacypmResult_v2type with astruct timevaltimestamp, so we're talking microsecond resolution. still valid, just not the moment anymore.
now, important one, don't skip this: any metrics and instances showing up in result must have already been defined by earlier calls to pmiAddMetric(3) and pmiAddInstance(3). like, they have to exist first. no sneaking new ones in, okay?
the good news? both routines will handle it for you and arrange for any new metadata (that's metrics and/or instance domain changes) covered by result to be written to the PCP archive. so they do the admin work, you just vibe π
β οΈ and here's the sad part: because the pmResult data structure is genuinely complex, neither routine is available in the Perl interface to the LOGIMPORT services. perl besties, i'm so sorry, this one's not for us π
π DIAGNOSTICS π
both routines return zero on success β slay. otherwise you get a negative value, and you can turn that into an actual readable error message by calling pmiErrStr(3). never leave a negative return value un-investigated bestie, that's how you end up confused at 3am π₯²
π SEE ALSO π
the whole squad, go read them:
LOGIMPORT(3), PMAPI(3), pmiAddInstance(3), pmiAddMetric(3), pmiErrStr(3), pmiPutValue(3), pmiPutText(3), pmiPutLabel(3), pmiPutValueHandle(3), pmiSetTimezone(3), pmiHighResWrite(3) and pmiWrite(3).
and that's the whole page bestie!! π this came to you from the fine folks at Performance Co-Pilot, and you just read PMIPUTRESULT(3) β go forth and write those archives with nanosecond precision, no cap β¨π¦πΈπ
π¦ 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
- 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.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 stonking: libpcp4-dev 7.2.1-2build1
- Copyright (c) 2010 Ken McDonell. All Rights Reserved
- Copyright (c) 2018 Red Hat
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms