summaryrefslogtreecommitdiff
path: root/man/man3/pmlocalpmda.3
blob: 2fc3085071fc5cbef35669f4185f01902a826e59 (plain)
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
'\"macro stdmacro
.TH PMLOCALPMDA 3 "" "Performance Co-Pilot"
.SH NAME
\f3__pmLocalPMDA\f1 \- change the table of DSO PMDAs for PM_CONTEXT_LOCAL contexts
.SH "C SYNOPSIS"
.ft 3
#include <pcp/pmapi.h>
.br
#include <pcp/impl.h>
.sp
.ad l
.hy 0
.in +8n
.ti -8n
int __pmLocalPMDA(int \fIop\fP, int \fIdomain\fP, const char *\fIname\fP, const\ char\ *\fIinit\fP);
.sp
.in
.hy
.ad
cc ... \-lpcp
.ft 1
.SH DESCRIPTION
PCP contexts of type
.B PM_CONTEXT_LOCAL
are used by clients that wish to fetch metrics directly from one or more PMDAs on
the local host without involving
.BR pmcd (1).
A PMDA that is to be used in this way must have been built as a
Dynamic Shared Object (DSO).
.P
Historically the table of PMDAs available for use with
.B PM_CONTEXT_LOCAL
was hardcoded to the following:
.IP * 2n
The PMDA (or PMDAs) that export the operating system performance data
and data about process activity.
.PD 0
.IP *
The
.B mmv
PMDA.
.IP *
The
.B sample
PMDA provided
.B $PCP_LITE_SAMPLE
or
.B $PMDA_LOCAL_SAMPLE
is set in the environment \- used mostly for QA and testing.
.PD
.PP
The initial table of PMDAs available for use with
.B PM_CONTEXT_LOCAL
is now generated dynamically from all those PMDAs that have been
installed as DSOs on the local host.
The one exception is the ``pmcd''
PMDA which only operates correctly in the address space of a running
.BR pmcd (1)
process and so is not available to an application using a
.B PM_CONTEXT_LOCAL
context.
.PP
.B __pmLocalPMDA
provides a number of services to amend the table of PMDAs
available for use with
.BR PM_CONTEXT_LOCAL .
.P
The
.I op
argument specifies the what should be done and takes one of the following
values and actions:
.IP PM_LOCAL_ADD 16n
Append an entry to the table for the PMDA with a Performance Metrics Domain
(PMD) of
.IR domain ,
the path to the DSO PMDA is given by
.I path
and the PMDA's initialization routine is
.IR init .
.IP PM_LOCAL_DEL
Removes all entries in the table where the
.I domain
matches, or the
.I path
matches.  Setting the arguments
.I domain
to \-1 or
.I path
to
.B NULL
to force matching on the
.I other
argument.
The
.I init
argument is ignored.
.IP PM_LOCAL_CLEAR
Remove all entries from the table.  All the other arguments are ignored
in this case.
.P
The
.IR domain ,
.I name
and
.I init
arguments have similar syntax and semantics to the associated fields
in the
.BR pmcd (1)
configuration file.
The one difference is the
.I path
argument which is used by
.B __pmLocalPMDA
to find a likely looking DSO by searching in this order:
.B $PCP_PMDAS_DIR\c
/\c
.IR path ,
.IR path ,
.B $PCP_PMDAS_DIR\c
/\c
.I path\c
\&.\c
.I dso-suffix
and finally
.I path\c
\&.\c
.I dso-suffix
(\c
.I dso-suffix
is the local platform specific default file name suffix for a DSO, e.g.
.B so
for Linux,
.B dylib
for Mac OS X,
.B dll
for Windows,
etc.).
.SH "RETURN VALUE"
In most cases,
.B __pmLocalPMDA
returns 0
to indicate success.
If
.I op
is invalid, then the return value is
.B PM_ERR_CONV
else if there is no matching table entry found for a
.B PM_LOCAL_DEL
operation, PM_ERR_INDOM is returned.
.SH SEE ALSO
.BR pmcd (1),
.BR PMAPI (3),
.BR pmNewContext (3)
and
.BR __pmSpecLocalPMDA (3).