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

# pmNameID(3)

translate a PMID to a performance metric name

## NAME

**pmNameID** - translate a PMID to a performance metric name

## C SYNOPSIS

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

**int pmNameID(pmID** *pmid***, char \*\****name***);**

**cc ... -lpcp**

## DESCRIPTION

Given a Performance Metric Identifier (PMID) via *pmid*, **pmNameID** will determine the corresponding metric name, if any, in the Performance Metrics Name Space (PMNS), and return this via *name*.

If the PMNS contains multiple names associated with the requested PMID, one of these will be returned via *name*, but there is no way to determine which of the duplicate names this will be.  See [**pmNameAll**(3)](/pmNameAll/3.md) if all of the corresponding names are required.

As of Version 3.10.3 of PCP, duplicate names for the same PMID **are** allowed in the PMNS, so using [**pmNameAll**(3)](/pmNameAll/3.md) is recommended over **pmNameID**.

*name* is a null-byte terminated string, allocated by **pmNameID** using [**malloc**(3)](/malloc/3.md) and it is the caller's responsibility to call [**free**(3)](/free/3.md) to release the storage when the value is no longer required.

In the absence of errors, **pmNameID** returns zero.

## DIAGNOSTICS

- **PM\_ERR\_NOPMNS**

  Failed to access a PMNS for operation. Note that if the application hasn't a priori called [**pmLoadNameSpace**(3)](/pmLoadNameSpace/3.md) and wants to use the distributed PMNS, then a call to **pmNameID** must be made after the creation of a context (see [**pmNewContext**(3)](/pmNewContext/3.md)).

- **PM\_ERR\_PMID**

  *pmid* does not correspond to a defined PMID in the PMNS.

- **PM\_ERR\_\***

  Other diagnostics are for protocol failures when accessing the distributed PMNS.

## SEE ALSO

[**PMAPI**(3)](/PMAPI/3.md), [**pmGetChildren**(3)](/pmGetChildren/3.md), [**pmGetChildrenStatus**(3)](/pmGetChildrenStatus/3.md), [**pmGetConfig**(3)](/pmGetConfig/3.md), [**pmLoadASCIINameSpace**(3)](/pmLoadASCIINameSpace/3.md), [**pmLoadNameSpace**(3)](/pmLoadNameSpace/3.md), [**pmLookupName**(3)](/pmLookupName/3.md), [**pmNameAll**(3)](/pmNameAll/3.md), [**pmNewContext**(3)](/pmNewContext/3.md), [**pcp.conf**(5)](/pcp.conf/5.md), [**pcp.env**(5)](/pcp.env/5.md) and [**PMNS**(5)](/PMNS/5.md).
