1PMSPECLOCALPMDA(3) Library Functions Manual PMSPECLOCALPMDA(3)
2
3
4
6 pmSpecLocalPMDA - process command-line argument for the table of DSO
7 PMDAs
8
10 #include "pmapi.h"
11 #include "libpcp.h"
12
13 char *pmSpecLocalPMDA(const char *spec);
14
15 cc ... -lpcp
16
18 For Performance Co-Pilot (PCP) applications, contexts of type PM_CON‐
19 TEXT_LOCAL are used by clients that wish to fetch metrics directly from
20 one or more PMDAs on the local host without involving pmcd(1).
21
22 pmSpecLocalPMDA provides a convenience wrapper to be used by applica‐
23 tions that wish to use a command line argument (usually with -K) to
24 control the DSO PMDAs that are available for a PM_CONTEXT_LOCAL con‐
25 text.
26
27 The spec argument specifies actions for one or more DSO PMDAs using up
28 to four fields separated by commas (``,''), namely:
29 - an opcode with one of the values add (add a new entry), del
30 (delete an existing entry) or clear (clear all entries from
31 the table).
32 - the PMDA's domain number
33 - the path to the PMDA DSO (may be absolute or relative to the
34 $PCP_VAR_DIR/pmdas directory and the DSO suffix is optional),
35 and
36 - the name of the PMDA's initialization routine.
37
38 All fields are required to add a new entry. To delete an entry
39 the opcode is required plus either or both of the domain number
40 and path fields. To clear all entries, only the opcode is
41 required.
42
43 If spec is parsed successfully, then the DSO table is updated
44 with the extracted fields.
45
47 On success, pmSpecLocalPMDA will return NULL.
48
49 On error or failure, pmSpecLocalPMDA will return a pointer to a
50 static error message.
51
53 Some examples of valid spec strings:
54
55 clear Delete all entries from the DSO table.
56
57 add,123,foo/foo_pmda,foo_init
58 Add the ``foo'' PMDA using domain 123. The PMDA's DSO is
59 most likely in below the directory $PCP_PMDAS_DIR and
60 named foo/foo_pmda.so (for ELF-style platforms) or
61 foo/foo_pmda.dylib (for BSD-style platforms) or
62 fooo_pmda.dll (for Windows-style platforms). The ini‐
63 tialization routine for the ``foo'' PMDA is foo_init().
64
65 del,123
66 Delete the entry for the DSO with domain 123.
67
68 del,,foo/foo_pmda
69 Delete the entry with a pathname to the DSO that matches
70 foo/foo_pmda.
71
72 del,123,foo/foo_pmda
73 Delete the entry for the DSO with either domain 123
74 and/or a pathname to the DSO that matches foo/foo_pmda.
75
77 pmcd(1), PMAPI(3) and pmNewContext(3).
78
79
80
81Performance Co-Pilot PMSPECLOCALPMDA(3)