PMADDPROFILE(3)

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

πŸ’– PMADDPROFILE(3) πŸ’–

Library Functions Manual · PCP girlie edition ✨


🌸 NAME 🌸

pmAddProfile β€” bestie, this is the one that adds instance(s) to the current PMAPI instance profile 🫢


✨ C SYNOPSIS ✨

#include <pcp/pmapi.h>

int pmAddProfile(pmInDom indom, int numinst, int *instlist);

cc ... -lpcp

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so. the set of instances for performance metrics that come back from a pmFetch(3) call? you can filter or restrict that whole thing using an instance profile. it's giving VIP list πŸ’…

there's literally one instance profile for each context your app creates at the Performance Metrics Application Programming Interface (PMAPI(3)), and each instance profile can include instances from one or more instance domains (go look at pmLookupDesc(3), iykyk).

pmAddProfile is the move when you wanna add new instance specifications to the instance profile of the current PMAPI context. no cap.

in the simplest variant, the list of instances identified by the instlist argument for the indom instance domain get added to the instance profile. that list of instance identifiers holds numinst values. periodt.

the indom value would normally be extracted from a call to pmLookupDesc(3) for a particular performance metric, and the instances in instlist would typically be determined by calls to pmGetInDom(3) or pmLookupInDom(3). iconic pipeline honestly 🌈

to select all instances in all instance domains, use:

pmAddProfile(PM_INDOM_NULL, 0, (int *)0)
this is the only case where indom may be equal to PM_INDOM_NULL. πŸ™ˆ

and if numinst is zero, or instlist is NULL, then all instances in indom are selected. easy ✨


πŸ’€ CAVEAT πŸ’€

ngl, you can add non-existent instance domains and non-existent instances to an instance profile. and none of the routines that use the instance profile will ever issue an error if you do this. the cost of checking, when checking is possible, outweighs any benefits. so like… the vibes are trusting, but the vibes are also not checking. 😭


πŸ‘‘ DIAGNOSTICS πŸ‘‘

  • PM_ERR_PROFILESPEC β€” indom was PM_INDOM_NULL and instlist was not empty. caught you πŸ’…

🌈 SEE ALSO 🌈

PMAPI(3), pmDelProfile(3), pmFetch(3), pmGetInDom(3), pmLookupDesc(3), pmLookupInDom(3), pmNewContext(3), pmUseContext(3) and pmWhichContext(3).


Performance Co-Pilot πŸŽ€ PCP πŸŽ€ PMADDPROFILE(3)

that's the whole page bestie, go add some instances to that profile and slay πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from