PMIPUTLABEL(3)
β¨ PMIPUTLABEL β¨
okay bestie, welcome to pmiPutLabel π β that's section 3 of the Library Functions Manual, and she is lowkey the moment you get to label everything in your output archive. let's get into it π«Ά
πΈ NAME πΈ
pmiPutLabel β add labels to the output archive. yes, literally just that. she labels. she's iconic. π
π C SYNOPSIS π
#include <pcp/pmapi.h>
#include <pcp/import.h>
int pmiPutLabel(unsigned int type, unsigned int id,
unsigned int instance, const char *name,
const char *value);
cc ... -lpcp_import -lpcp
π¦ Perl SYNOPSIS π¦
use PCP::LogImport;
pmiPutLabel($type, $id, $instance, $name, $value);
π Python SYNOPSIS π
from pcp import pmi
log.pmiPutLabel(type, id, instance, name, value)
π DESCRIPTION π
so here's the tea β β as part of the Performance Co-Pilot Log Import API (peep LOGIMPORT(3) for the whole lore), pmiPutLabel adds a label for the global context, or for a given domain, cluster, item, instance domain or instance. it's giving "tag everything so future you knows what's what" π·οΈβ¨
the type has to be one of these, no substitutions bestie:
PM_LABEL_CONTEXTPM_LABEL_DOMAINPM_LABEL_CLUSTERPM_LABEL_ITEMPM_LABEL_INDOMPM_LABEL_INSTANCES
if type is PM_LABEL_CONTEXT, then id and instance are just... not it, they're ignored π. otherwise, id should match a domain, cluster, metric or instance domain that you defined earlier in a call to pmiAddMetric(3).
if type is PM_LABEL_INSTANCES, then instance should match an instance number of the selected domain. otherwise instance gets ignored, she's not needed π
name is a string holding the name of the label you're adding.
value is a string holding the value of that label.
important: no data gets written until you callpmiWrite(3)!! so the move is callingpmiPutLabela bunch of times to stack up several labels, and then callingpmiWrite(3). accumulate first, write later, that's the whole vibe β¨
π DIAGNOSTICS π
pmiPutLabel returns zero on success β slay π β otherwise it returns a negative value, which you can turn into an actual error message by calling pmiErrStr(3). not me getting a negative return and needing emotional support π
π SEE ALSO π
LOGIMPORT(3)pmiAddInstance(3)pmiAddMetric(3)pmiErrStr(3)pmiPutResult(3)pmiPutValue(3)pmiPutValueHandle(3)pmiPutText(3)pmiWrite(3)
and that's the whole page, bestie π mwah π this one came to you courtesy of Performance Co-Pilot and the PMIPUTLABEL(3) energy β go forth and label responsibly ππ
π¦ 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) 2018 Red Hat
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms