pmGetDerivedControl, pmSetDerivedControl
get and set controls for derived metrics
- Provided by: libpcp4-dev (Version: 7.1.1-1)
- Source: pcp
- Report a bug
get and set controls for derived metrics
#include <pcp/pmapi.h>
int pmGetDerivedControl(int what, int *valuep);
int pmSetDerivedControl(int what, int value);
cc ... -lpcp
These routines may be used to influence the behaviour of the derived metric services that are activated for global derived metrics using pmRegisterDerived(3), pmRegisterDerivedMetric(3) and pmLoadDerivedConfig(3), or per-context derived metrics using pmAddDerived(3) and pmAddDerivedMetric(3).
The what argument selects a control or option, the value argument provides a value for pmSetDerivedControl and the valuep argument is used to return the value for pmGetDerivedControl.
The what argument has one of the following values:
Both routines return 0 on success, else a value less than 0 that can be decoded using pmErrStr(3).
Some overloading of error codes is needed to accommodate the unusual semantics of these routines, as described below.
| Error | Meaning |
| PM_ERR_NAME | what is not one of the expected values |
| PM_ERR_ARG | the value provided to pmSetDerivedControl is not within the acceptable range |
| PM_ERR_NOCONTEXT | getting or setting PCP_DERIVED_CONTEXT_LIMIT only makes sense when there is a current PMAPI context |
| PM_ERR_AGAIN | pmSetDerivedControl request would violate precedence rules (see below) |
All of the controls and options that are exposed by pmSetDerivedControl can also be set in two other ways.
Given these options can be specified in multiple ways, possibly with different values, the precedence rules are if PCP_DERIVED_CONTROL is set, then that value is honoured, else the most recently set value from #control or pmSetDerivedControl is used.
PCPIntro(1), pmAddDerived(3), pmAddDerivedMetric(3), PMAPI(3), pmErrStr(3), pmLoadDerivedConfig(3), pmRegisterDerived(3), pmRegisterDerivedMetric(3) and PMNS(5).