PMUSECONTEXT(3)
PMUSECONTEXT(3) π
okay so this is a page from the Library Functions Manual bestie, and it's all about pmUseContext from the Performance Co-Pilot (PCP) world π
β¨ NAME β¨
pmUseContext β change current PMAPI context π
πΈ C SYNOPSIS πΈ
#include <pcp/pmapi.h>
int pmUseContext(int handle);
cc ... -lpcp
π¦ DESCRIPTION π¦
So here's the tea: if you're an application using the Performance Metrics Application Programming Interface (PMAPI, yes queen π), you can juggle several concurrent contexts at once. Each one is tied to a source of performance metrics β like pmcd(1) running on some host, or an archive of performance metrics as created by pmlogger(1). Multiple vibes, multiple sources, all at the same time, no cap. β¨
Calling pmUseContext sets the current PMAPI context to the one identified by handle. And bestie, that handle value must be one returned from an earlier call to pmNewContext(3) or pmDupContext(3). Like, you can't just make one up, okay? π
Now here's the part that's giving main character energy: below the PMAPI, every context your application uses gets saved in its most recently modified state. So pmUseContext restores the context to the state it was in the last time the context was used β not the state of the context back when it was first established. It's giving "we pick up right where we left off," and honestly? Obsessed. π
π DIAGNOSTICS π
PM_ERR_NOCONTEXTβhandledoes not identify a valid PMAPI context π (literally it doesn't know her)
π SEE ALSO π
PMAPI(3), pmDestroyContext(3), pmDupContext(3), pmNewContext(3) and pmWhichContext(3). Go read those too, they ate. π₯
k bye ily, this was Performance Co-Pilot (PCP) content, PMUSECONTEXT(3), and yes it really is that iconic π«Άβ¨
π¦ 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.0.1-1.fc43 Β· 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) 2000-2004 Silicon Graphics, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms