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

NAME

6       PMDA  -  introduction  to  the Performance Metrics Domain Agent support
7       library
8

C SYNOPSIS

10       #include <pcp/pmapi.h>
11       #include <pcp/pmda.h>
12
13       cc ... -lpcp_pmda -lpcp
14

DESCRIPTION

16       To assist in  the  development  of  Performance  Metric  Domain  Agents
17       (PMDAs)  for  the Performance Co-Pilot (PCP), a procedural interface is
18       provided that extends the Performance Metrics  Application  Programming
19       Interface ( PMAPI(3)) library.  These procedures are designed to enable
20       a programmer to quickly build a PMDA  which  can  then  be  tested  and
21       refined.   However,  this  also  implies  that  a PMDA has a particular
22       structure which may not be suitable for all PMDA implementations.
23
24       Once you are familiar with the PCP and PMDA frameworks, you can quickly
25       implement  a  new  PMDA  with only a few data structures and functions.
26       This is covered in far greater detail in the Performance Co-Pilot  Pro‐
27       grammer's Guide.
28
29       A  PMDA  is  responsible for a set of performance metrics, in the sense
30       that it must respond to requests from  pmcd(1)  for  information  about
31       performance metrics, instance domains, and instantiated values.
32
33       This  man page contains sections of the simple PMDA which is located at
34       $PCP_PMDAS_DIR/simple.
35

COMMUNICATING WITH PMCD

37       Two approaches may be used for connecting a PMDA to a pmcd(1)  process.
38       A  Dynamic  Shared  Object  (DSO)  can  be  attached  by  pmcd(1) using
39       dlopen(3) when the pmcd(1) process is started.  A procedural  interface
40       referenced  through  a shared data structure is used to handle requests
41       from pmcd(1) to the PMDA .
42
43       The preferred approach is for a separate process (daemon)  to  communi‐
44       cate  with pmcd(1) using the Performance Data Units (PDU) Inter-Process
45       Communication (IPC) protocol.
46
47       All PMDAs are launched and controlled by the  pmcd(1)  process  on  the
48       local  host.  The requests from the clients are received by pmcd(1) and
49       forwarded to the appropriate  PMDAs.   Responses,  when  required,  are
50       returned  through pmcd(1) to the clients.  The requests (PDUs) that may
51       be  sent  to  a  PMDA  from   pmcd(1)   are   PDU_FETCH,   PDU_PROFILE,
52       PDU_INSTANCE_REQ,  PDU_DESC_REQ,  PDU_TEXT_REQ  and PDU_RESULT.  If the
53       PMDA implements any dynamic metrics it may also receive PDU_PMNS_CHILD,
54       PDU_PMNS_IDS, PDU_PMNS_NAMES and PDU_PMNS_TRAVERSE PDUs.
55

DEFAULT CALLBACKS FOR HANDLING PDUs

57       To  allow  a  consistent framework, pmdaMain(3) can be used by a daemon
58       PMDA to handle the communication protocol using the same ca