1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
'\"macro stdmacro
.\"
.\" Copyright (c) 2000 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 PMLOOKUPNAME 3 "PCP" "Performance Co-Pilot"
.SH NAME
\f3pmLookupName\f1 \- translate performance metric names into PMIDs
.SH "C SYNOPSIS"
.ft 3
#include <pcp/pmapi.h>
.sp
.nf
int pmLookupName(int \fInumpmid\fP, char **\fInamelist\fP, pmID *\fIpmidlist\fP);
.fi
.sp
cc ... \-lpcp
.ft 1
.SH DESCRIPTION
.PP
Given a list in
.I namelist
containing
.I numpmid
full pathnames for performance metrics from a Performance Metrics Name
Space (PMNS),
.B pmLookupName
returns the list of associated
Performance Metric Identifiers (PMIDs) via
.IR pmidlist .
.PP
The result from
.B pmLookupName
will be the number of names translated in the absence of errors, else
an error code less than zero.
When errors are encountered, the corresponding value in
.I pmidlist
will be PM_ID_NULL.
.PP
Note that the error protocol guarantees there is a 1:1 relationship
between the elements of
.I namelist
and
.IR pmidlist ,
hence both lists contain exactly
.I numpmid
elements.
For this reason, the caller is expected to have pre-allocated a suitably
sized array for
.IR pmidlist .
.SH SEE ALSO
.BR PMAPI (3),
.BR pmGetChildren (3),
.BR pmGetChildrenStatus (3),
.BR pmGetConfig (3),
.BR pmLoadNameSpace (3),
.BR pmNameID (3),
.BR pmNewContext (3),
.BR pcp.conf (5)
and
.BR pcp.env (5).
.SH DIAGNOSTICS
.IP \f3PM_ERR_TOOSMALL\f1
.I numpmid
must be at least 1
.IP \f3PM_ERR_NOPMNS\f1
Failed to access a PMNS for operation.
Note that if the application hasn't a priori called
.BR pmLoadNameSpace (3)
and wants to use the distributed PMNS, then a call to
.B pmLookupName
must be made after the creation of a context (see
.BR pmNewContext (3)).
.IP \f3PM_ERR_NAME\f1
One or more of the elements of
.I namelist
does not correspond to a valid metric name in the PMNS.
.IP \f3PM_ERR_NONLEAF\f1
A name referred to a node in the PMNS but it was
not a leaf node.
.IP \f3PM_ERR_*\f1
Other diagnostics are for protocol failures when
accessing the distributed PMNS.
|