PMCONTEXTWALK(3)
π PMCONTEXTWALK(3) β the Library Functions Manual glow-up π
okay so bestie, pull up a chair, because we're about to talk about __pmContextWalk β yes, from the Library Functions Manual section 3, and yes, she's serving internal-PCP realness. this one's for the devs who live inside the guts of Performance Co-Pilot, iykyk. π«Ά
β¨ NAME β¨
__pmContextWalk β traversal of all PMAPI contexts π
like, all of them. every single active one. one by one. no cap.
β¨ C SYNOPSIS β¨
#include "pmapi.h"
#include "libpcp.h"
void (*__pmContextWalkCallback)(void *handle, __pmContext *ctxp);
int __pmContextWalk(void *handle, __pmContextWalkCallback callback,
cc ... -lpcp
that's the whole thing, character for character, don't come for me. π
π¨ CAVEAT π¨
okay listen. this documentation is intended for internal Performance Co-Pilot (PCP) developer use. it's giving backstage-pass energy, not general-admission energy. ποΈ
these interfaces are not part of the PCP APIs that are guaranteed to remain fixed across releases. and likeβ¦ they may not work, or they may provide different semantics at some point in the future. so don't build your whole personality on them, bestie. π
fr fr, treat this like a situationship, not a marriage.
π DESCRIPTION π
__pmContextWalk provides a thread-safe and lock-safe way of processing each active PMAPI context in turn. she's careful. she's considerate. she locks properly so you don't have to worry. queen behavior. π
for each valid PMAPI context, callback is called with handle passed in from the __pmContextWalk caller, and ctxp pointing to a context for which the c_lock lock has been acquired. π
the handle argument is a pointer to an arbitrary object that may be shared between the __pmContextWalk caller and the callback routine β but it is not otherwise accessed by __pmContextWalk, so it could be NULL. do whatever you want with it, she doesn't care. π
the per-context c_lock is released by __pmContextWalk after callback is called, and should not be unlocked by callback. like, hands off the lock, babe, she's got it. β
for the duration of the call to __pmContextWalk, all context initiation (via pmNewContext(3), pmDupContext (3) or pmReconnectContext(3)) and teardown (via pmDestroyContext(3)) is blocked. π everyone wait their turn, it's called manners.
πΈ RETURN VALUES πΈ
__pmContextWalk returns the number of contexts processed β and hence the number of times callback was called. so if you got a big number, she was busy. πͺ
else, a negative value suitable for reporting with pmErrStr(3). negative = something went sideways, go ask pmErrStr(3) what's up. π
π₯ SEE ALSO π₯
go read those too, bestie, they're all part of the same friend group. π¦
and that's the tea! this page came to you straight from Performance Co-Pilot / PCP β the PMCONTEXTWALK(3) icon herself. stay safe out there with your contexts, don't unlock locks you don't own, and remember: internal APIs are for the girlies who read the caveats. periodt. πβ¨π
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- centos-stream 10: pcp-doc 7.1.5-6.el10 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.1.0-6.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu resolute: libpcp4-dev 7.1.1-1
- ubuntu stonking: libpcp4-dev 7.2.1-2build1
- Copyright (c) 2025 Ken McDonell
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms