summaryrefslogtreecommitdiff
path: root/man/man3/pmtypestr.3
diff options
context:
space:
mode:
Diffstat (limited to 'man/man3/pmtypestr.3')
-rw-r--r--man/man3/pmtypestr.393
1 files changed, 93 insertions, 0 deletions
diff --git a/man/man3/pmtypestr.3 b/man/man3/pmtypestr.3
new file mode 100644
index 0000000..4d86d4b
--- /dev/null
+++ b/man/man3/pmtypestr.3
@@ -0,0 +1,93 @@
+'\"macro stdmacro
+.\"
+.\" Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved.
+.\"
+.\" This program is free software; you can redistribute it and/or modify it
+.\" under the terms of the GNU General Public License as published by the
+.\" Free Software Foundation; either version 2 of the License, or (at your
+.\" option) any later version.
+.\"
+.\" This program is distributed in the hope that it will be useful, but
+.\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+.\" or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+.\" for more details.
+.\"
+.\"
+.TH PMTYPESTR 3 "PCP" "Performance Co-Pilot"
+.SH NAME
+\f3pmTypeStr\f1,
+\f3pmTypeStr_r\f1 \- convert a performance metric type into a string
+.SH "C SYNOPSIS"
+.ft 3
+#include <pcp/pmapi.h>
+.sp
+const char *pmTypeStr(int \fItype\fP);
+.br
+char *pmTypeStr_r(int \fItype\fP, char *\fIbuf\fP, int \fIbuflen\fP);
+.sp
+cc ... \-lpcp
+.ft 1
+.SH DESCRIPTION
+.de CW
+.ie t \f(CW\\$1\f1\\$2
+.el \fI\\$1\f1\\$2
+..
+Given a performance metric
+.IR type ,
+.B pmTypeStr
+produces a terse ASCII equivalent, appropriate for use in error and diagnostic
+messages.
+The
+.B pmTypeStr_r
+function does the same, but stores the result in a user-supplied buffer
+.I buf
+of length
+.IR buflen ,
+which should have room for at least 20 bytes.
+.PP
+The value for
+.I type
+is typically extracted from a
+.CW pmDesc
+structure, following a call to
+.BR pmLookupDesc (3)
+for a particular performance metric.
+.PP
+Examples are
+.B 32
+(for
+.I type
+equals
+.BR PM_TYPE_32 ),
+.B U64
+(for
+.I type
+equals
+.BR PM_TYPE_U64 ),
+.B AGGREGATE
+(for
+.I type
+equals
+.BR PM_TYPE_AGGREGATE ),
+etc.
+.PP
+The string value result for
+.B pmTypeStr
+is held in a single static buffer, so the returned value is
+only valid until the next call to
+.BR pmTypeStr .
+.SH NOTES
+.B pmTypeStr
+returns a pointer to a static buffer and hence is not thread-safe.
+Multi-threaded applications should use
+.B pmTypeStr_r
+instead.
+.SH SEE ALSO
+.BR PMAPI (3),
+.BR pmAtomStr (3),
+.BR pmConvScale (3),
+.BR pmExtractValue (3),
+.BR pmLookupDesc (3),
+.BR pmPrintValue (3)
+and
+.BR pmUnitsStr (3).