---
name: "pmaSortInDom"
section: "3"
platform: "linux"
package: "pcp"
version: "7.2.2-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/pmaSortInDom"
---

# pmaSortInDom(3)

sort an instance domain

## NAME

**pmaSortInDom** - sort an instance domain

## C SYNOPSIS

**#include \<pcp/pmapi.h\>**\
 **#include \<pcp/libpcp.h\>**\
 **#include \<pcp/archive.h\>**

**void pmaSortInDom(\_\_pmLogInDom \****lidp***);**

**cc ... -lpcp\_archive -lpcp**

## CAVEAT

This documentation is intended for internal Performance Co-Pilot (PCP) developer use.

These interfaces are not part of the PCP APIs that are guaranteed to remain fixed across releases, and they may not work, or may provide different semantics at some point in the future.

## DESCRIPTION

The instance domain identified by *lidp* is sorted in ascending internal instance identifier value. Both the *lidp*-\>*instlist*\[\] array and the corresponding *lidp*-\>*namelist*\[\] array are sorted.

Since instance domains are usually sorted (at their source by a PMDA), a bubble sort is used. This means that if the caller is unsure if 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 when in doubt, simply call **pmaSortInDom**.

## DIAGNOSTICS AND RETURN VALUES

None.

## SEE ALSO

[**PMAPI**(3)](/PMAPI/3.md) and [**pmGetInDom**(3)](/pmGetInDom/3.md).
