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

NAME

6       pmdaCacheStore,  pmdaCacheStoreKey,  pmdaCacheLookup,  pmdaCacheLookup‐
7       Name, pmdaCacheLookupKey, pmdaCacheOp, pmdaCachePurge,  pmdaCachePurge‐
8       Callback,  pmdaCacheResize - manage a cache of instance domain informa‐
9       tion for a PMDA
10

C SYNOPSIS

12       #include <pcp/pmapi.h>
13       #include <pcp/pmda.h>
14
15       int pmdaCacheStore(pmInDom indom, int flags, const char *name,
16               void *private);
17       int pmdaCacheStoreKey(pmInDom indom, int flags, const char *name,
18               int keylen, const void *key, void *private);
19       int pmdaCacheLookup(pmInDom indom, int inst, char **name,
20               void **private);
21       int pmdaCacheLookupName(pmInDom indom, const char *name, int *inst,
22               void **private);
23       int pmdaCacheLookupKey(pmInDom indom, const char *name, int keylen,
24               const void *key, char **oname, int *inst, void **private);
25       int pmdaCacheOp(pmInDom indom, int op);
26       int pmdaCachePurge(pmInDom indom, time_t recent);
27       int pmdaCachePurgeCallback(pmInDom indom, time_t recent, void
28               (*callback)(void *));
29       int pmdaCacheResize(pmInDom indom, int maximum);
30
31       cc ... -lpcp_pmda -lpcp
32

DESCRIPTION

34       The pmdaCache family of routines provide services to support the  main‐
35       tenance  of  complex  instance  domains for Performance Co-Pilot PMDAs.
36       There is potentially one cache of information for each instance domain,
37       and for each instance the cache maintains:
38       - external instance name (supplied by the PMDA)
39       - internal instance identifier (assigned by pmdaCacheStore or calculat‐
40         ed from a ``hint'' by pmdaCacheStoreKey)
41       - state, where active instances are visible and part of the current in‐
42         stance  domain, and inactive instances are hidden, but not forgotten;
43         pmdaCacheStore or pmdaCacheStoreKey may be used to change  the  state
44         of an instance
45       - an  optional  opaque  pointer to data that is associated with the in‐
46         stance, but maintained by the PMDA
47       - an optional opaque key that is  used  as  a  ``hint''  to  pmdaCache‐
48         StoreKey when guessing the initial internal instance identifier
49       - the last time the cache was saved and the instance had been marked as
50         active at some point since the previous cache load or save operation
51
52       The semantics of a PCP instance domain require a number of rules to  be
53       followed, namely:
54       1. Each  internal instance identifier must be unique and in the range 0
55          to 2^31 - 1.  This rule is enforced by the pmdaCache family of  rou‐
56          tines.
57       2. The  external  instance name must be unique.  When the instance name
58          contains a space, it is further constrained such that  the  name  to
59          the  left  of  the first space (the short name) must also be unique.
60          Refer to the INSTANCE NAME MATCHING section below.   The  PMDA  must
61          honor  this  rule,  the pmdaCache family of routines will detect at‐
62          tempts to violate this rule.
63       3. Where an external instance name corresponds to some object or  enti‐
64          ty,  there  is  an expectation that the association between the name
65          and the object is fixed, e.g. ``/dev/hda'' is always the name of the
66          same  disk on a particular system