1PMIDSTR(3) Library Functions Manual PMIDSTR(3)
2
3
4
6 pmIDStr, pmIDStr_r - convert a performance metric identifier into a
7 string
8
10 #include <pcp/pmapi.h>
11
12 const char *pmIDStr(pmID pmid);
13 char *pmIDStr_r(pmID pmid, char *buf, int buflen);
14
15 cc ... -lpcp
16
18 For use in error and diagnostic messages, pmIDStr returns a `human
19 readable' version of the specified Performance Metric Identifier
20 (PMID). The pmIDStr_r function does the same, but stores the result in
21 a user-supplied buffer buf of length buflen, which should have room for
22 at least 20 bytes.
23
24 Internally, a PMID is encoded as follows;
25
26 typedef struct {
27 int pad:2;
28 unsigned int domain:8;
29 unsigned int cluster:12;
30 unsigned int item:10;
31 } __pmID_int;
32
33 pmIDStr returns a string with each of the domain, cluster and item sub‐
34 fields appearing as decimal numbers, separated by periods.
35
36 The string value result from pmIDStr is held in a single static buffer,
37 so the returned value is only valid until the next call to pmIDStr.
38
40 pmIDStr returns a pointer to a static buffer and hence is not thread-
41 safe. Multi-threaded applications should use pmIDStr_r instead.
42
44 Environment variables with the prefix PCP_ are used to parameterize the
45 file and directory names used by PCP. On each installation, the file
46 /etc/pcp.conf contains the local values for these variables. The
47 $PCP_CONF variable may be used to specify an alternative configuration
48 file, as described in pcp.conf(5). Values for these variables may be
49 obtained programmatically using the pmGetConfig(3) function.
50
52 PMAPI(3), pmGetConfig(3), pmInDomStr(3), pmLookupDesc(3), pcp.conf(5)
53 and pcp.env(5).
54
55
56
57Performance Co-Pilot PCP PMIDSTR(3)