PMDELPROFILE(3)

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

πŸ’– PMDELPROFILE(3) β€” Library Functions Manual πŸ’–

okay bestie, welcome to the Library Functions Manual for pmDelProfile, and no we are not gatekeeping this one. it's giving "spring cleaning for your instance profile" and honestly? iconic. 🧹✨


✨ NAME ✨

pmDelProfile β€” delete instance(s) from the current PMAPI instance profile πŸ’…


🌸 C SYNOPSIS 🌸

#include <pcp/pmapi.h>

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

cc ... -lpcp

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: when you call pmFetch(3), the set of instances you get back for your performance metrics can be filtered or restricted using something called an instance profile. yes bestie, a profile. main character behaviour. πŸ‘‘

every single context that your app creates at the Performance Metrics Application Programming Interface (PMAPI) gets its own instance profile β€” one per context, no sharing, no borrowing, we respect boundaries here 🫢 β€” and each one of those profiles can hold instances from one or more instance domains (peep pmLookupDesc(3) if you wanna know more about those).

pmDelProfile is the function you call when you wanna delete instance specifications from the instance profile of the current PMAPI context. bye bye, deleted, blocked, unfollowed 🚫

in the simplest variant, the list of instances that the instlist argument points at β€” for the indom instance domain β€” gets removed from the instance profile. and that list of instance identifiers contains numinst values. simple as. ✨

where does indom come from, you ask? normally you'd pull it out of a call to pmLookupDesc(3) for a particular performance metric, and the instances sitting in instlist would typically be figured out by calling pmGetInDom(3) or pmLookupInDom(3). teamwork makes the dream work fr fr. 🌈

now for the special cases, and listen up because this part matters:

  • if indom equals PM_INDOM_NULL and numinst is zero, then all instance domains are selected for deletion. every single one. gone. πŸ’€
  • if instlist is NULL, then all instances in the selected domain(s) get removed from the profile.

and if you wanna disable literally every available instance in every domain? hit it with:

pmDelProfile(PM_INDOM_NULL, 0, NULL)

that's the only situation where indom is allowed to be PM_INDOM_NULL. the only one. don't be out here passing PM_INDOM_NULL in other combos, bestie, it's not that kind of function. πŸ™ˆ


⚠️ CAVEAT ⚠️

okay so this is lowkey wild but it's real and we need to talk about it: you can delete non-existent instance domains and non-existent instances from an instance profile. and none of the routines that use the instance profile will ever throw an error if you do this. not one. 😭

the reasoning, per the original tea, is that the cost of checking β€” when checking is even possible β€” outweighs any benefits. so yeah. the vibes are "we trust you, bestie" and honestly that's a lot of trust. proceed accordingly. 🫢

so like... don't expect a little error message to catch you. it won't. the silence is the feature.

🩺 DIAGNOSTICS 🩺

  • PM_ERR_PROFILESPEC β€” this one shows up when indom was PM_INDOM_NULL and instlist was not empty. that's the mismatch, that's the crime, that's the error. 🚨

πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page, no notes. this manual page came to you straight from Performance Co-Pilot β€” that's the PCP girlies, you know the ones β€” and it's filed under PMDELPROFILE(3). go forth and delete responsibly, bestie. slay. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from