PMDAINTERFACEMOVED(3)

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

πŸ’– PMDAINTERFACEMOVED(3) πŸ’–

okay so bestie, welcome to the Library Functions Manual section of your life πŸŽ€ this one is short, sweet, and honestly kind of a sleeper hit β€” it's about putting your pmdaInterface structure back together after you've ✨relocated✨ it.


🌸 NAME 🌸

pmdaInterfaceMoved β€” reset internal state of a pmdaInterface structure


✨ C SYNOPSIS ✨

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

void pmdaInterfaceMoved(pmdaInterface *dispatch);

cc ... -lpcp_pmda -lpcp

like yes, that's the whole signature, she's a one-liner and she ate πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the situation. you already called either pmdaDaemon(3) or pmdaDSO(3) to initialize your pmdaInterface structure. iconic. BUT β€” and this is the plot twist 😭 β€” if the caller then needs to relocate or move that structure for literally any reason, you have to call pmdaInterfaceMoved with the new base address of the pmdaInterface routine, and that new address is what you hand over as dispatch.

what does she do for you? pmdaInterfaceMoved will re-establish the internal integrity of the pmdaInterface structure at the new location. and the timing matters, bestie β€” you gotta do this before any other routine in libpcp_pmda is called. no cap. do it first or things get weird πŸ‘‘


πŸ’€ CAVEAT πŸ’€

The PMDA must be using PMDA_INTERFACE_2 or later.

like, non-negotiable. older interface versions are not invited to this party 🚫


πŸ‘€ SEE ALSO πŸ‘€


and that's the whole vibe, bestie β€” this page came to you from Performance Co-Pilot (PCP), filed under PMDAINTERFACEMOVED(3). go move that struct and slay πŸ«Άβœ¨πŸ’œ

πŸ“¦ where this page comes from