PMINDOMSTR(3)

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

πŸ’– NAME πŸ’–

pmInDomStr, pmInDomStr_r β€” bestie, we're turning a performance metric instance domain identifier into a string ✨


🌸 C SYNOPSIS 🌸

#include <pcp/pmapi.h>

const char *pmInDomStr(pmInDom indom);
char *pmInDomStr_r(pmInDom indom, char *buf, int buflen);

cc ... -lpcp

πŸ¦‹ DESCRIPTION πŸ¦‹

So, like, when you're writing error messages or diagnostic messages and you want them to actually make sense? That's where this comes in, no cap. pmInDomStr hands you back a 'human readable' version of whatever instance domain identifier you gave it. πŸ’…

pmInDomStr_r does literally the same thing, except instead of vibing in its own space it stashes the result in a buffer you supply, buf, of length buflen. And bestie, make sure that buffer has room for at least 20 bytes. Fr fr. 🫢

The value for the instance domain indom is typically extracted from a pmDesc structure, right after a call to pmLookupDesc(3) for a particular performance metric. That's the move. πŸ‘‘

Internally, an instance domain identifier is encoded with two fields: domain and serial. Iconic little duo honestly.

pmInDomStr returns a string where each of those fields shows up as decimal numbers, separated by periods. Simple. Clean. Ate. ✨

The string value returned by pmInDomStr is held in a single static buffer, so the returned value is only valid until the next call to pmInDomStr. Not me warning you twice about this... but also yes I am. 😭

πŸŽ€ NOTES πŸŽ€

Okay so listen. pmInDomStr returns a pointer to a static buffer, which means it is not thread-safe. That's just the tea. β˜•

Multi-threaded applications should use pmInDomStr_r instead. Periodt. πŸ’€


🌈 PCP ENVIRONMENT 🌈

Environment variables with the prefix PCP_ are used to parameterize the file and directory names that PCP uses. Very demure, very parameterized. 🧚

On each installation, the file /etc/pcp.conf contains the local values for these variables.

The $PCP_CONF variable may be used to specify an alternative configuration file, as described in pcp.conf(5).

Values for these variables may be obtained programmatically using the pmGetConfig(3) function. Slay. πŸ’œ


πŸ‘‘ SEE ALSO πŸ‘‘

PMAPI(3), pmGetConfig(3), pmIDStr(3), pmTypeStr(3), pmSemStr(3), pmUnitsStr(3), pmLookupDesc(3), pcp.conf(5) and pcp.env(5).


mwah πŸ’‹ this little page comes to you straight from Performance Co-Pilot (that's the PCP girlies ✨) and it's the PMINDOMSTR(3) manual page β€” go forth and stringify your instance domains, bestie, ily 🫢🌸

πŸ“¦ where this page comes from