1PMADDPROFILE(3) Library Functions Manual PMADDPROFILE(3)
2
3
4
6 pmAddProfile - add instance(s) to the current PMAPI instance profile
7
9 #include <pcp/pmapi.h>
10
11 int pmAddProfile(pmInDom indom, int numinst, int *instlist);
12
13 cc ... -lpcp
14
16 The set of instances for performance metrics returned from a pmFetch(3)
17 call may be filtered or restricted using an instance profile. There is
18 one instance profile for each context the application creates at the
19 Performance Metrics Application Programming Interface (PMAPI(3)), and
20 each instance profile may include instances from one or more instance
21 domains (see pmLookupDesc(3)).
22
23 pmAddProfile may be used to add new instance specifications to the in‐
24 stance profile of the current PMAPI context.
25
26 In the simplest variant, the list of instances identified by the in‐
27 stlist argument for the indom instance domain are added to the instance
28 profile. The list of instance identifiers contains numinst values.
29
30 The indom value would normally be extracted from a call to pm‐
31 LookupDesc(3) for a particular performance metric, and the instances in
32 instlist would typically be determined by calls to pmGetInDom(3) or pm‐
33 LookupInDom(3).
34
35 To select all instances in all instance domains, use
36
37 pmAddProfile(PM_INDOM_NULL, 0, (int *)0)
38
39 This is the only case where indom may be equal to PM_INDOM_NULL. If
40 numinst is zero, or instlist is NULL, then all instances in indom are
41 selected.
42
44 It is possible to add non-existent instance domains and non-existent
45 instances to an instance profile. None of the routines that use the
46 instance profile will ever issue an error if you do this. The cost of
47 checking, when checking is possible, outweighs any benefits.
48
50 PM_ERR_PROFILESPEC
51 indom was PM_INDOM_NULL and instlist was not empty
52
54 PMAPI(3), pmDelProfile(3), pmFetch(3), pmGetInDom(3), pmLookupDesc(3),
55 pmLookupInDom(3), pmNewContext(3), pmUseContext(3) and pmWhichCon‐
56 text(3).
57
58
59
60Performance Co-Pilot PCP PMADDPROFILE(3)