PMUNPACKEVENTRECORDS(3) | Library Functions Manual | PMUNPACKEVENTRECORDS(3) |
pmUnpackEventRecords, pmUnpackHighResEventRecords - unpack event records
#include <pcp/pmapi.h>
int pmUnpackEventRecords(pmValueSet *vsp, int idx, pmResult ***rap);
int pmUnpackHighResEventRecords(pmValueSet *vsp, int idx, pmHighResResult ***hrap);
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_EVENT , and a pmHighResResult when using a metric of type PM_TYPE_HIGHRES_EVENT.
pmUnpackEventRecords and pmUnpackHighResEventRecords 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 pmHighResResult structures, one per event record and one metric per event parameter, and 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 pmHighResResult allows for nanosecond precision, whereas pmResult allows for microsecond resolution.
Some control information from the packed event records is unpacked into additional ``anonymous'' metrics as follows:
pmUnpackEventRecords returns the number of pmResult structures as the return value, which is >= 0 for success. Similarly, pmUnpackHighResEventRecords returns the number of pmHighResResult structures as the return value, which is >= 0 for success.
rap and the associated pmResult structures may be freed using the convenience function pmFreeEventResult(3).
Similarly, the hrap and the associated pmHighResResult structures may be freed using the convenience function pmFreeHighResEventResult.
The following errors are possible:
PCP | Performance Co-Pilot |