PMSEMSTR(3)
π PMSEMSTR(3) π
okay so bestie, this is a page from the Library Functions Manual β yes, that library manual, the one for the library functions π
and today's main character is pmSemStr (plus its little sibling pmSemStr_r, we love a duo).
β¨ NAME β¨
pmSemStr, pmSemStr_r β convert a performance metric semantic into a string π¦
πΈ C SYNOPSIS πΈ
#include <pcp/pmapi.h>
const char *pmSemStr(int sem);
char *pmSemStr_r(int sem, char *buf, int buflen);
cc ... -lpcp
like, yes, you gotta link with -lpcp, don't forget, she's the whole point π«Ά
π DESCRIPTION π
so basically, you hand pmSemStr a performance metric semantic and she gives you back a terse ASCII equivalent β the kind of string you'd actually want to shove into an error message or a diagnostic message. it's giving "short, sweet, useful" β¨
pmSemStr_r does exactly the same thing, no cap, except she stores the result in a user-supplied buffer called buf, and that buffer has length buflen. and like β heads up β that buffer should have room for at least 20 bytes. 20. at least. don't be stingy with her π
where does sem even come from though? bestie, it's typically extracted from a pmDesc structure, after you've called pmLookupDesc(3) for whichever performance metric you care about. so like, pmLookupDesc(3) first, then pull the semantic out of the pmDesc, then vibe check it with pmSemStr. the pipeline is iconic π
some examples so you get the flavor:
counterβ for whensemequalsPM_SEM_COUNTERπdiscreteβ for whensemequalsPM_SEM_DISCRETEπ²instantβ for whensemequalsPM_SEM_INSTANTβ‘- and
etc.β yeah there's more, that's the vibe π
π§ NOTES π§
both of these routines are safe to call from threaded applications. periodt. no asterisk, no fine print, go off π
β SEE ALSO β
PMAPI(3)pmAtomStr(3)pmConvScale(3)pmExtractValue(3)pmLookupDesc(3)pmPrintValue(3)pmIDStr(3)pmInDomStr(3)pmTypeStr(3)pmUnitsStr(3)
ngl the whole*Strfamily is lowkey a whole friend group andpmSemStris just the one who tells you what a semantic is in human words. obsessed π
and that's the whole page bestie!! this came to you courtesy of Performance Co-Pilot (PCP), and yeah the manual itself is labeled PMSEMSTR(3) because we keep the branding consistent around here ππΈβ¨
π¦ 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,2018 Red Hat
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms