pmUnpackHighResEventRecords, pmUnpackEventRecords
unpack event records
- Provided by: libpcp4-dev (Version: 7.2.1-2)
- Source: pcp
- Report a bug
unpack event records
#include <pcp/pmapi.h>
int pmUnpackHighResEventRecords(pmValueSet *vsp,
int idx, pmResult ***hrap);
int pmUnpackEventRecords(pmValueSet *vsp,
int idx, pmResult_v2 ***rap);
cc ... -lpcp
Event records are encoded as a packed array of records within a pmResult using a container metric with a value of type PM_TYPE_HIGHRES_EVENT and a pmResult_v2 when using a metric with a value of type PM_TYPE_EVENT.
pmUnpackHighResEventRecords and pmUnpackEventRecords may be used to unpack event records from a metric value identified by vsp and idx. If the metric has a singular value, idx should be 0, else the ordinal instance value identified by idx will be unpacked, i.e. vsp->vlist[idx]. The unpacked records are turned into either pmResult or pmResult_v2 structures, one per event record and one metric per event parameter, and hrap or rap is returned as a pointer to an array (NULL pointer terminated) of pointers to the result structures.
The only difference between the two result types is the timestamp scale; the pmResult allows for nanosecond precision, whereas pmResult_v2 allows for microsecond resolution.
Some control information from the packed event records is unpacked into additional ``anonymous'' metrics as follows:
pmUnpackHighResEventRecords returns the number of pmResult structures as the return value, which is >= 0 for success. Similarly, pmUnpackEventRecords returns the number of pmResult_v2 structures as the return value, which is >= 0 for success.
hrap and the associated pmResult structures may be freed using the convenience function pmFreeHighResEventResult(3).
Similarly, rap and the associated pmResult_v2 structures may be freed using the convenience function pmFreeEventResult(3).
The following errors are possible: