PMNAMEINDOMARCHIVE(3)

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

πŸ’– pmNameInDomArchive(3) β€” the glow-up guide πŸ’–

okay bestie, sit down, hydrate, and let me tell you about pmNameInDomArchive from the Library Functions Manual ✨ it's a lil PCP function that translates an instance identifier into an instance name, and honestly? it's giving librarian energy in the best way πŸ“šπŸ’…


✨ NAME ✨

pmNameInDomArchive β€” translate an instance identifier into an instance name πŸŽ€


🌸 C SYNOPSIS 🌸

#include <pcp/pmapi.h>

int pmNameInDomArchive(pmInDom indom, int inst, char **name);

cc ... -lpcp

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea πŸ“: as long as your current Performance Metrics Application Programming Interface (PMAPI) context is associated with a set of archives, pmNameInDomArchive will scan the union of all the instance domain metadata for the instance domain indom, hunt down the first instance whose internal instance identifier matches the one you passed in inst, and hand you back the full external instance identification through name. slay. πŸ’…

this routine is basically the specialized, archive-flavored version of the more general PMAPI routine pmNameInDom β€” same vibe, narrower scope, still iconic πŸ‘‘

the value for the instance domain indom is typically extracted from a pmDesc structure, right after you've called pmLookupDesc(3) for a particular performance metric. iykyk 🌟

⚠️ okay important one, don't skip this: the space for the value of name is allocated inside pmNameInDomArchive using malloc(3), and it is the responsibility of the caller to free(3) that space once it's no longer required. no leaks, bestie, we're not doing that today πŸ™ˆπŸ’€

pmNameInDomArchive returns zero on success. periodt. βœ…


πŸ’€ DIAGNOSTICS πŸ’€

  • PM_ERR_NOTARCHIVE β€” the current PMAPI context is not associated with a set of archives 😭
  • PM_ERR_INDOM_LOG β€” indom is not a defined instance domain identifier for the set of archives 🫠
  • PM_ERR_INST_LOG β€” the instance identifier inst is not known for the instance domain indom in the set of archives πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

PMAPI(3), pmGetConfig(3), pmGetInDomArchive(3), pmLookupInDomArchive(3), pmNameInDom(3), pcp.conf(5) and pcp.env(5). go read them, they're all part of the same friend group 🫢🌈


and that's the whole page, babe πŸŽ€ this one came to you from Performance Co-Pilot (PCP) as PMNAMEINDOMARCHIVE(3) β€” stan a well-maintained manpage, no cap βœ¨πŸ’œ

πŸ“¦ where this page comes from