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

NAME

6       pmLoadASCIINameSpace - establish a local PMNS for an application
7

C SYNOPSIS

9       #include <pcp/pmapi.h>
10
11       int pmLoadASCIINameSpace(const char *filename, int dupok);
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 pmLoadASCIINameSpace or pmLoadNameSpace(3).  If the applica‐
19       tion wants 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 pmLoadASCI‐
25       INameSpace.
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
32       unless  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       pmLoadASCIINameSpace  is  a  variant of pmLoadNameSpace(3) in which the
37       dupok argument may be used to control the handling of multiple names in
38       the  PMNS that may be associated with a single Performance Metric Iden‐
39       tifier (PMID).  A value of 0  disallows  duplicates,  any  other  value
40       allows  duplicates  and  the latter is the default behaviour of pmLoad‐
41       NameSpace(3) as of Version 3.10.3 of PCP.
42
43       The other difference is that  when  pmLoadASCIINameSpace  is  used  and
44       filename  is  not  PM_NS_DEFAULT, the PMNS file will always be pre-pro‐
45       cessed with pmcpp(1) as described in PMNS(5).  This allows a PMNS  file
46       that  contains  C-style comments, pre-processor directives or macros to
47       be processed correctly before the PMNS is parsed.
48
49       pmLoadASCIINameSpace returns zero on success.
50

FILES

52       $PCP_VAR_DIR/pmns/root   the default local PMNS, when  the  environment
53                                variable PMNS_DEFAULT is unset
54

PCP ENVIRONMENT

56       Environment variables with the prefix PCP_ are used to parameterize the
57       file and directory names used by PCP.  On each installation,  the  file
58       /etc/pcp.conf  contains  the  local  values  for  these variables.  The
59       $PCP_CONF variable may be used to specify an alternative  configuration
60       file,  as  described in pcp.conf(5).  Values for these variables may be
61       obtained programmatically using the pmGetConfig(3) function.
62

SEE ALSO

64       PMAPI(3),   pmGetConfig(3),   pmLoadNameSpace(3),   pmTrimNameSpace(3),
65       pcp.conf(5), pcp.env(5) and PMNS(5).
66

DIAGNOSTICS

68       Syntax  and  other  errors  in  the parsing of the PMNS are reported on
69       stderr with a message of the form ``Error Parsing ASCII PMNS: ...''.
70
71       PM_ERR_DUPPMNS
72
73              It is an error to try to load more than one  PMNS,  or  to  call
74              either  pmLoadASCIINameSpace and/or pmLoadNameSpace(3) more than
75              once.
76
77       PM_ERR_PMNS
78
79              Syntax error in an ASCII format PMNS.
80
81
82
83Performance Co-Pilot                  PCP              PMLOADASCIINAMESPACE(3)
Impressum