QMCCONTEXT(3)
π QMCCONTEXT(3) π
okay bestie, welcome to the QMCCONTEXT page β it lives in the Library Functions Manual and it's literally all about being the container for a PMAPI(3) context and all its lil metrics. π«Ά
β¨ NAME β¨
QmcContext β a container for a PMAPI(3) context and its metrics. periodt. π
πΈ C++ SYNOPSIS πΈ
#include <QmcContext.h>
c++ ... -lpcp_qmc -lpcp
no cap, that's the whole vibe. π
π¦ DESCRIPTION π¦
so a QmcContext object is a container for one single PMAPI(3) context. one. singular. main character energy, but only one of them. β¨
and it keeps a whole list of stuff that's using that context, so we don't end up making the same things over and over like some kind of chaos gremlin:
- all the metric descriptors, aka
QmcDesc - instance domains, aka
QmcIndom - metrics, aka
QmcMetric
the whole point is to minimize the duplication of these objects. it's giving organized. it's giving efficient. we love that for us. π
π CONSTRUCTORS π
bestie listen β aQmcContextobject should be constructed through theQmcGroup::useinterface. that's the way. don't do it some other way. π
π₯ DESCRIPTOR LOOKUP π₯
okay so here's the tea: the metric and instance domain descriptors get cached by the QmcContext object. why? because we're not about to create duplicate QmcDesc(3) and QmcIndom(3) objects, and we're definitely not about to make extra PMAPI(3) calls just to build them again. π€
also the mapping from metric names to pmIDs is maintained too, so we can dodge pmLookupName(3) calls entirely. iykyk. π
int lookupDesc(const char *name, pmID& id);β searches for the metric name in the name list, then sets id to the pmID it already knows about. if it's not found, it hits uppmLookupName(3) to get that mapping. and if that call fails, it returns the PMAPI(3) error code. slay. β¨int lookupDesc(const char *name, uint_t& desc, uint_t& indom);β finds the index desc and indom pointing at theQmcDescobject and theQmcIndomobject for the metric name. then you can use those indexes withQmcContext::descandQmcContext::indomto grab references to the actual objects. and if the metric descriptor or instance domain couldn't be obtained, it hands you back a PMAPI(3) error code. πint lookupDesc(pmID pmid, uint_t& desc, uint_t& indom);β same deal but starting from the metric pmid instead of a name. finds the index desc and indom to theQmcDescobject and theQmcIndomobject for that pmid, and those indexes work withQmcContext::descandQmcContext::indomto get references to the real objects. returns a PMAPI(3) error code if the metric descriptor or instance domain couldn't be obtained. iconic. π
π DIAGNOSTICS π
error messages get generated using pmprintf(3)... but ngl, they are not flushed. it is the responsibility of the user to call pmflush(3) to actually output any of those messages. so if you're sitting there like "where are my errors bestie" β that's on you. π«
you can also activate additional diagnostics by adding the options pmc and/or optfetch to the global debugging specification, as described in pmSetDebug(3). go off. π
π SEE ALSO π
PMAPI(3), QMC(3), QmcDesc(3), QmcGroup(3), QmcIndom(3), QmcMetric(3), pmflush(3), pmLookupName(3) and pmprintf(3).
and that's the whole page, bestie!! πβ¨ this came from the Performance Co-Pilot era over at SGI, and yeah it's literally titled QMCCONTEXT(3) β go forth and cache responsibly. ππ¦π
π¦ 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) 2005 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