1PMTYPESTR(3) Library Functions Manual PMTYPESTR(3)
2
3
4
6 pmTypeStr, pmTypeStr_r - convert a performance metric type into a
7 string
8
10 #include <pcp/pmapi.h>
11
12 const char *pmTypeStr(int type);
13 char *pmTypeStr_r(int type, char *buf, int buflen);
14
15 cc ... -lpcp
16
18 Given a performance metric type, pmTypeStr produces a terse ASCII
19 equivalent, appropriate for use in error and diagnostic messages. The
20 pmTypeStr_r function does the same, but stores the result in a user-
21 supplied buffer buf of length buflen, which should have room for at
22 least 20 bytes.
23
24 The value for type is typically extracted from a pmDesc structure, fol‐
25 lowing a call to pmLookupDesc(3) for a particular performance metric.
26
27 Examples are 32 (for type equals PM_TYPE_32), U64 (for type equals
28 PM_TYPE_U64), AGGREGATE (for type equals PM_TYPE_AGGREGATE), etc.
29
30 The string value result for pmTypeStr is held in a single static buf‐
31 fer, so the returned value is only valid until the next call to pmType‐
32 Str.
33
35 pmTypeStr returns a pointer to a static buffer and hence is not thread-
36 safe. Multi-threaded applications should use pmTypeStr_r instead.
37
39 PMAPI(3), pmAtomStr(3), pmConvScale(3), pmExtractValue(3),
40 pmLookupDesc(3), pmPrintValue(3) and pmUnitsStr(3).
41
42
43
44Performance Co-Pilot PCP PMTYPESTR(3)