QMCINDOM(3)
π QMCINDOM(3) β the QmcIndom era π
okay bestie, sit down, we're learning the QmcIndom page from the Library Functions Manual and honestly? it's giving backend royalty π
β¨ NAME β¨
QmcIndom β a container for a instance domain description π
πΈ C++ SYNOPSIS πΈ
#include <QmcIndom.h>
c++ ... -lpcp_qmc -lpcp
link it, compile it, slay it π
π¦ DESCRIPTION π¦
So a QmcIndom object is literally a whole representation of a PMAPI(3) instance domain. And when we say "representation" we mean it's got the full description of every instance in that instance domain. the whole roster, no cap π«Ά
And a QmcInstance? That's the structure that describes each individual instance in the instance domain. Here's the tea, it includes:
- internal identifier. And heads up β if this is less than zero, the instance gets treated as a NULL entry in the instance table. so watch out for that π
- external name
- reference count, i.e. the number of
QmcMetricobjects that are referring to this instance - the likely position of the instance in the
pmResultfrom apmFetch(3). And fun fact: this is also used to indicate the position of the next NULL instance in the instance table, if this entry is also NULL π - a flag indicating if the instance was in the last
pmGetInDom(3)
And the QmcIndom object itself? It's got a list of QmcInstance structures, plus a bunch of flags and counters, all there to support dynamic instance domains β you know, the ones where instances may come and go with each fetch β and to make profile generation efficient. iconic behavior honestly π
π CONSTRUCTORS π
QmcIndom::QmcIndom(int type, QmcDesc &desc);β callspmGetInDom(3)andpmGetInDomArchive(3)for host and archive contexts to obtain the entire instance list for the instance domain of type and identified in desc. it's literally just fetching the whole squad for you π«Ά
π DYNAMIC INDOMS π
okay this part is highkey complex so stay with me bestie π
Supporting dynamic instance domains for live contexts is complicated, because so many metrics may be referencing any of the instances in the domain. So the instance list may end up sparse, since the position of instances in the list has to be maintained. it's a whole thing β¨
Here's how the update goes. When the instance domain is updated, instances may be removed from the list if they are not in the new instance list (as returned by pmGetInDom(3)) and are not referenced by any metrics. Then each instance in the new list is compared with the old list to figure out which instances are still active, and any new instances need to be added. An instance is considered the same if both the internal and external identifiers are the same. And new instances get inserted into positions of deleted instances first, before being appended to the list. recycling era β»οΈ
β οΈ heads up: this algorithm is expensive β potentially O(N^2). not the vibe we wanted but it's the vibe we got π
bool changed() const;β returnstrueif the instance domain may have changed in the last fetch πvoid newFetch();β reset the flags that may have indicated that the instance domain had changed. This is called byQmcContext::fetch.void hasChanged();β set the flags to indicate that the instance domain may have changed. This is called byQmcMetric::extractValues.int update();β update the instance domain as described above. On subsequent calls, before the next fetch, this method will remove any instances that are no longer referenced without updating the instance list with apmGetInDom(3)call.uint_t numInsts() const;β returns the number of instances that are not NULL.uint_t numActiveInsts() const;β returns the number of instances that are active according to the lastQmcIndom::updatecall.uint_t listLen() const;β returns the length of the instance list, including NULL instances.
π PROFILES π
the algorithm for determining the most compact profile uses the number of instances (_instances.length()), the number of referenced instances (_count), the number of active instances (_numActive) and the number of referenced active instances (_numActiveRef). here's the whole flow, verbatim, no edits π
if (all active instances are referenced
or there are no active instances)
request all instances implicitly
else if (the number of referenced instances
is less than the number of active
instances that are not referenced)
delete all instances from profile
add all referenced instances
else
add all instances to profile
delete all instances that are not referenced
bool diffProfile() const;β returnstrueif the profile has potentially changed since the last call toQmcIndom::genProfile.int genProfile();β generates a new profile for the instance domain. aPMAPI(3)error code is returned if the profile failed.
π₯ DIAGNOSTICS π₯
Error messages are generated using pmprintf(3) but they are not flushed. so it's your responsibility, bestie β you gotta call pmflush(3) to output any messages. don't leave them hanging π
Additional diagnostics may be activated by adding the options pmc and/or indom to the global debugging specification, as described in pmSetDebug(3). iykyk β¨
π BUGS π
Users have no control over the algorithm used to generate the profile. and in the case of proc metrics, an implicit profile could be generated if all process instances are required β even though this will result in no values being returned in the fetch. not the ending we deserved tbh π
β SEE ALSO β
PMAPI(3), QMC(3), QmcContext(3), QmcDesc(3), QmcMetric(3), pmFetch(3), pmflush(3), pmGetInDom(3), pmGetInDomArchive(3) and pmprintf(3).
and that's the whole page, bestie!! this one came to you from Performance Co-Pilot, courtesy of SGI, and it's filed under QMCINDOM(3). go forth and manage your instance domains, you absolute icon π«Άπ
π¦ 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