1PMLOADNAMESPACE(3)         Library Functions Manual         PMLOADNAMESPACE(3)
2
3
4

NAME

6       pmLoadNameSpace - load a local PMNS for an application
7

C SYNOPSIS

9       #include <pcp/pmapi.h>
10
11       int pmLoadNameSpace(const char *filename);
12
13       cc ... -lpcp
14

DESCRIPTION

16       If  the  application  wants  to force using a local Performance Metrics
17       Name Space (PMNS) instead of a distributed PMNS then it must  load  the
18       PMNS using pmLoadNameSpace or pmLoadASCIINameSpace(3).  If the applica‐
19       tion is to use a distributed PMNS, then it should NOT make  a  call  to
20       load the PMNS explicitly.
21
22       Most  applications  using a Performance Metrics Application Programming
23       Interface (PMAPI) context (of any type, so PM_CONTEXT_HOST  or  PM_CON‐
24       TEXT_ARCHIVE  or PM_CONTEXT_LOCAL) should not need to call pmLoadNameS‐
25       pace.
26
27       The filename argument designates the PMNS of  interest.   For  applica‐
28       tions  not  requiring  a tailored PMNS, the special value PM_NS_DEFAULT
29       may be used for filename, to force the default local PMNS to be loaded.
30
31       The default local PMNS is found in the file $PCP_VAR_DIR/pmns/root  un‐
32       less  the  environment  variable PMNS_DEFAULT is set, in which case the
33       value is assumed to be the pathname to the file containing the  default
34       local PMNS.
35
36       Externally a PMNS is stored in an ASCII format as described in PMNS(5).
37       However, note that pmLoadNameSpace assumes filename  does  not  contain
38       any  C-style  comments,  pre-processor directives or macros; if this is
39       not the case, pmLoadASCIINameSpace(3) should be used instead.
40
41       As of Version 3.10.3 of PCP, by default, multiple names in the PMNS are
42       allowed  to  be associated with a single Performance Metrics Identifier
43       (PMID) and this is unconditionally allowed by pmLoadNameSpace.  pmLoad‐
44       ASCIINameSpace(3)  provides  an alternative interface with user-defined
45       control over the handling of duplicate names for the same PMID  in  the
46       PMNS.
47
48       pmLoadNameSpace returns zero on success.
49

DIAGNOSTICS

51       Syntax  and  other  errors  in  the parsing of the PMNS are reported on
52       stderr with a message of the form ``Error Parsing ASCII PMNS: ...''.
53
54       PM_ERR_DUPPMNS
55
56              It is an error to try and load more than one PMNS,  or  to  call
57              either  pmLoadNameSpace and/or pmLoadASCIINameSpace(3) more than
58              once.
59
60       PM_ERR_PMNS
61
62              Syntax error in the PMNS file.
63

FILES

65       $PCP_VAR_DIR/pmns/root   the default local PMNS, when  the  environment
66                                variable PMNS_DEFAULT is unset
67

PCP ENVIRONMENT

69       Environment variables with the prefix PCP_ are used to parameterize the
70       file and directory names used by PCP.  On each installation,  the  file
71       /etc/pcp.conf  contains  the  local  values  for  these variables.  The
72       $PCP_CONF variable may be used to specify an alternative  configuration
73       file,  as  described in pcp.conf(5).  Values for these variables may be
74       obtained programmatically using the pmGetConfig(3) function.
75

SEE ALSO

77       PMAPI(3), pmGetConfig(3), pmLoadASCIINameSpace(3),  pmTrimNameSpace(3),
78       pcp.conf(5), pcp.env(5) and PMNS(5).
79
80
81
82Performance Co-Pilot                  PCP                   PMLOADNAMESPACE(3)
Impressum