PMDADSO(3)

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

πŸ’– PMDADSO(3) β€” the pmdaDSO era πŸ’–

okay bestie, welcome to the PMDADSO page from the Library Functions Manual ✨ this is where your little Performance Co-Pilot agent gets told "you're gonna live inside a DSO now, babe" πŸ¦‹


🌸 NAME 🌸

pmdaDSO β€” get your PMDA all set up to run as a DSO, no cap πŸ’…


✨ C SYNOPSIS ✨

#include <pcp/pmapi.h>
#include <pcp/pmda.h>

int pmdaDSO(pmdaInterface *dispatch, int interface, char *name,
            char *helptext);

cc ... -lpcp_pmda -lpcp

πŸ‘‘ DESCRIPTION πŸ‘‘

So pmdaDSO initializes the pmdaInterface structure to use the interface extensions, assuming the PMDA(3) is gonna be run as a DSO. it's giving "getting ready for the group chat" energy fr fr 🫢

The pmdaInterface structure gets initialized with these:

  • name β€” the name of the agent. that's it, that's the vibe πŸ’–
  • helptext β€” the default path to the help text (peep pmdaText(3) πŸ‘€). If no help text is installed, or you're simply not using pmdaText(3), then set this to NULL. Otherwise the helptext gets copied, which means the storage associated with helptext may be released after the call to pmdaDSO. so like, you don't have to keep it alive, bestie πŸŽ€

The callbacks get initialized to pmdaProfile(3), pmdaFetch(3), pmdaDesc(3), pmdaText(3), pmdaInstance(3) and pmdaStore(3). all of them. the whole squad ✨

The interface structure also contains the domain of the PMDA(3), which is defined in the pmcd(1) configuration file. That domain is what initializes the metric and instance descriptors (see pmdaInit(3)) 🌈


🚨 CAVEAT 🚨

okay this part is important, listen up πŸ“’

The PMDA must be using PMDA_INTERFACE_2 or later. periodt.

Once pmdaDSO has been called, it is expected that the pmdaInterface structure pointed to by dispatch will remain accessible to the routines in libpcp_pmda. Translation: not reclaimed off the stack, not freed, not otherwise released, etc. 😭 If the caller needs to move or relocate the pmdaInterface structure for any reason, then after the move pmdaInterfaceMoved(3) must be called to re-establish the internal integrity of the pmdaInterface structure at the new location β€” and that has to happen before any other routine in libpcp_pmda is called. no skipping steps, iykyk πŸ’€


πŸ’… DIAGNOSTICS πŸ’…

  • Incompatible version of pmcd detected β€” when pmcd(1) creates the pmdaInterface structure, the dispatch.comm.version field is set to the highest protocol that pmcd(1) understands. This message means the pmcd(1) process does not understand the protocol used by pmdaDSO. awkward πŸ™ˆ
  • Unable to allocate memory for pmdaExt structure β€” and on top of that, dispatch->status is set to a value less than zero. so, negative. not great πŸ”₯

πŸ” SEE ALSO πŸ”

pmcd(1), PMAPI(3), PMDA(3), pmdaDaemon(3), pmdaInit(3), pmdaInterfaceMoved(3) and pmdaText(3) 🧚


and that's the whole page, bestie β€” go forth and DSO responsibly πŸ’œ

this one's from Performance Co-Pilot, under the PCP banner, and it's the PMDADSO(3) page, dated right there in the footer πŸŽ€ mwah, bye! πŸ’–βœ¨

πŸ“¦ where this page comes from