PMASORTINDOM(3)
π PMASORTINDOM β sort an instance domain π
okay bestie, welcome to pmaSortInDom(3), a lil function from the Performance Co-Pilot library functions manual. she's tiny, she's efficient, and she has β¨ opinions β¨ about sorting. let's get into it π«Ά
β¨ NAME β¨
pmaSortInDom β sort an instance domain, periodt π
πΈ C SYNOPSIS πΈ
okay so first you gotta pull in the headers, no cap:
#include <pcp/pmapi.h>
#include <pcp/libpcp.h>
#include <pcp/archive.h>
void pmaSortInDom(__pmLogInDom *lidp);
and then when you actually build it, you link like this:
cc ... -lpcp_archive -lpcp
(that's -lpcp_archive and -lpcp, both, don't skip either one π)
π CAVEAT π
bestie, read this part fr fr. this documentation is for internal Performance Co-Pilot (PCP) developer use only.
these interfaces are not part of the PCP APIs that are guaranteed to remain fixed across releases π like, they might not work, or they might provide different semantics at some point in the future. so if you're building something on top of them, just know the vibes could shift under you. lowkey iconic of them, highkey a warning. β οΈ
π¦ DESCRIPTION π¦
so here's the tea: the instance domain identified by lidp gets sorted in ascending internal instance identifier value π. and it's not just one array getting the glow-up β both the lidp->instlist[] array and the corresponding lidp->namelist[] array are sorted. they move together, as they should, main character energy π
now, why is this fast? because instance domains are usually already sorted β at their source, by a PMDA. so instead of doing something dramatic, pmaSortInDom uses a bubble sort π«§. yes, a bubble sort. and honestly? in this context she eats. π
here's the part that's genuinely so slay: if the caller is unsure whether the instance domain is sorted β but it actually is already sorted β then calling pmaSortInDom is as fast as checking if the instance domain is sorted. so likeβ¦ why waste time vibing on a vibe check when you could just call the function? when in doubt, simply call pmaSortInDom. that's it, that's the whole strategy π
π DIAGNOSTICS AND RETURN VALUES π
None. she returns nothing. she says nothing. she just sorts. silence, but make it effective π§
β SEE ALSO β
and that's the whole page, bestie!! π₯° this one came from the Performance Co-Pilot (PCP) library functions manual β PMASORTINDOM(3) β written and shipped by the PCP crew. go forth and sort 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: libpcp-archive1-dev 7.1.1-1
- ubuntu stonking: libpcp-archive1-dev 7.2.1-2build1
- Copyright (c) 2022 Ken McDonell. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms