NAME
pmTraversePMNS - traverse the performance metrics name
space
C SYNOPSIS
#include <pcp/pmapi.h>
int pmTraversePMNS(const char *name, void (*domet
ric)(const char *))
cc ... -lpcp
DESCRIPTION
The routine pmTraversePMNS may be used to perform a depth-
first traversal of the Performance Metrics Name Space
(PMNS).
The traversal starts at the node identified by name - if
name is an empty string (i.e.""), the traversal starts at
the root of the PMNS. Usually name would be the pathname
of a non-leaf node in the PMNS.
For each leaf node (i.e. performance metric) found in the
traversal, the user-supplied routine dometric is called
with the full pathname of that metric in the PMNS as the
single argument. This argument is null-byte terminated,
and is constructed from a buffer that is managed inter
nally to pmTraversePMNS. Consequently the value is only
valid during the call to dometric - if the pathname needs
to be retained, it should be copied using strdup(3C)
before returning from dometric.
On success pmtraversePMNS returns the number of children
of name, which may be zero.
SEE ALSO
PMAPI(3) and pmGetChildren(3).
DIAGNOSTICS
PM_ERR_NOPMNS
Failed to access a PMNS for operation. Note that
if the application hasn't a priori called pmLoad
NameSpace(3) and wants to use the distributed PMNS,
then a call to pmTraversePMNS must be made inside a
current context.
PM_ERR_NAME
The initial pathname name is not valid in the cur
rent PMNS.
PM_ERR_*
Other diagnostics are for protocol failures when
Man(1) output converted with
man2html