GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> QSSP / V1-1-1 > qssp / linux-gcc
#include <QSSP/QSTD.h>
#include <QSSP/QSSP_span.h>
#include <QSSP/QSTD_labels.h>
#include <QSTD_versions.h>
#include <QSTD_pvtdefs.h>
#include <dprintf.h>
#include <QSP/QFCP_cache.h>
#include <QSD/QFR_file.h>
#include <QSD/QFC_member.h>
#include <EFC/EFS_ids.h>
#include <LSF/LSF.h>
#include <LSF/LSF_scan.h>
#include <LSF/LSF_reason.h>
#include <LDT/BFU.h>
#include <string.h>
#include <stdlib.h>
Defines | |
| #define | RND_8(_v) ((_v + 7) & ~0x7) |
Typedefs | |
| typedef const unsigned int *(* | DecodeSampleV0 )(QSTD *qstd, QSTD_sampleV0 *sample, const unsigned int *dat, unsigned char bridge) |
| Signature to decode a statistics sample from the input data. | |
Functions | |
| static __inline QFCP_cache * | qstd_file_cache_get (void) |
| Returns a pointer to the file cache. | |
| static const unsigned int * | decode_statsV0_norm (QSTD *qstd, QSTD_statisticsV0 *stats, const unsigned int *dat, unsigned char bridge) |
| Decodes a normal (not differenced) statistics record. | |
| static const unsigned int * | decode_statsV0_diff (QSTD *qstd, QSTD_statisticsV0 *stats, const unsigned int *dat, unsigned char bridge) |
| Decodes the statistics in difference format. | |
| static const unsigned int * | decode_sampleV0_0 (QSTD *qstd, QSTD_sampleV0 *sample, const unsigned int *dat, unsigned char bridge) |
| Decodes a format 0 sample record. | |
| static const unsigned int * | decode_sampleV0_1 (QSTD *qstd, QSTD_sampleV0 *sample, const unsigned int *dat, unsigned char bridge) |
| Decodes a format 1 sample record. | |
| static const unsigned int * | decode_sampleV0_2 (QSTD *qstd, QSTD_sampleV0 *sample, const unsigned int *dat, unsigned char bridge) |
| Decodes a format 2 sample record. | |
| QSTD * | QSTD_alloc (void *must_be_null) |
| Allocates and constructs a QSTD handle. | |
| QSTD * | QSTD_construct (QSTD *qstd, void *must_be_null) |
| The constructor for a QSTD control structure. | |
| void | QSTD_destruct (QSTD *qstd) |
| The destructor for a QSTD control structure. | |
| const QSTD_ctx * | QSTD_ctxGet (const QSTD *qstd) |
| Locates the statistics context (meta-data). | |
| int | QSTD_sizeof (void *must_be_null) |
| Returns the size, in bytes, of a QSTD control structure. | |
| const LSF_contribution * | QSTD_updateAtDatagram (QSTD *qstd, const LSF_datagram *dgm) |
| Updates the context at datagram time. | |
| int | QSTD_updateAtContribution (QSTD *qstd, const LSF_contribution *ctb) |
| Updates the context at datagram time. | |
| static __inline void | qstd_sampleV0_add (QSTD_sampleV0 *dst, const QSTD_sampleV0 *src) |
| Adds the source sample to the destination sample. | |
| static __inline int | qstd_sampleV0_decode (QSTD *qstd, unsigned int type_id, unsigned char bridge, const unsigned int *dat) |
| Decodes the statistics data. | |
| int | QSTD_updateAtRecord (QSTD *qstd, const LSF_record *rec) |
| Updates the context at record time. | |
CVS $Id: QSTD.c,v 1.6 2011/03/29 00:14:57 russell Exp $
| const unsigned int *(* DecodeSampleV0)(QSTD *qstd, QSTD_sampleV0 *sample, const unsigned int *dat, unsigned char bridge) |
Signature to decode a statistics sample from the input data.
| qstd | The QSTD context handle | |
| sample | The structure to receive the decoded data from | |
| dat | The input data | |
| bridge | The bridge word, contains decoding options |
| static const unsigned int * decode_sampleV0_0 | ( | QSTD * | qstd, | |
| QSTD_sampleV0 * | sample, | |||
| const unsigned int * | dat, | |||
| unsigned char | bridge | |||
| ) | [static] |
Decodes a format 0 sample record.
| qstd | The decoding context | |
| sample | The data structure to receive the decoded statistics | |
| dat | The statistics data | |
| bridge | The record's bridge word |
References _QSTD::cumulative, decode_statsV0_norm(), _QSTD::diff, QSSP_spanV0DecodeTwo(), _QSTD_sampleV0::span, _QSTD_sampleV0::stats, and _QSTD_sample::v0.
Referenced by qstd_sampleV0_decode().
| static const unsigned int * decode_sampleV0_1 | ( | QSTD * | qstd, | |
| QSTD_sampleV0 * | sample, | |||
| const unsigned int * | dat, | |||
| unsigned char | bridge | |||
| ) | [static] |
Decodes a format 1 sample record.
| qstd | The decoding context | |
| sample | The data structure to receive the decoded statistics | |
| dat | The statistics data | |
| bridge | The record's bridge word |
References _QSTD::cumulative, decode_statsV0_norm(), _QSTD::diff, QSSP_spanV0DecodeOne(), _QSTD_sampleV0::span, _QSTD_sampleV0::stats, and _QSTD_sample::v0.
Referenced by qstd_sampleV0_decode().
| static const unsigned int * decode_sampleV0_2 | ( | QSTD * | qstd, | |
| QSTD_sampleV0 * | sample, | |||
| const unsigned int * | dat, | |||
| unsigned char | bridge | |||
| ) | [static] |
Decodes a format 2 sample record.
| qstd | The decoding context | |
| sample | The data structure to receive the decoded statistics | |
| dat | The statistics data | |
| bridge | The record's bridge word |
References _QSTD::cumulative, decode_statsV0_diff(), _QSTD::diff, QSSP_spanV0DecodeDiff(), _QSTD_sampleV0::span, _QSTD_sampleV0::stats, and _QSTD_sample::v0.
Referenced by qstd_sampleV0_decode().
| static const unsigned int * decode_statsV0_diff | ( | QSTD * | qstd, | |
| QSTD_statisticsV0 * | stats, | |||
| const unsigned int * | dat, | |||
| unsigned char | bridge | |||
| ) | [static] |
Decodes the statistics in difference format.
| qstd | The decoding context | |
| stats | The data structure to receive the decoded statistics | |
| dat | The statistics data | |
| bridge | The record's bridge word |
References _QSTD_statisticsV0::cnts, _QSTD_statisticsV0::nonzero, _QSTD::sample, _QSTD_sampleV0::stats, and _QSTD_sample::v0.
Referenced by decode_sampleV0_2().
| static const unsigned int * decode_statsV0_norm | ( | QSTD * | qstd, | |
| QSTD_statisticsV0 * | stats, | |||
| const unsigned int * | dat, | |||
| unsigned char | bridge | |||
| ) | [static] |
Decodes a normal (not differenced) statistics record.
| qstd | The decoding context | |
| stats | The data structure to receive the decoded statistics | |
| dat | The statistics data | |
| bridge | The record's bridge word |
References _QSTD_statisticsV0::cnts, and _QSTD_statisticsV0::nonzero.
Referenced by decode_sampleV0_0(), and decode_sampleV0_1().
| QSTD * QSTD_alloc | ( | void * | must_be_null | ) |
Allocates and constructs a QSTD handle.
| must_be_null | Reserved for future use. |
References QSTD_construct().
The constructor for a QSTD control structure.
| qstd | The control structure to be constructed. If NULL, a control structure will be allocated | |
| must_be_null | Reserved for future use. |
References _QSTD_ctx::com, _QSTD::ctx, _QSTD::cumulative, _QSTD_ctx::cumulative, _QSTD::free, _QSTD::labelsHandlers, QSSP_ctxConstruct(), _QSTD_ctx::qstd, qstd_file_cache_get(), QSTD_labelsHandlersDefGet(), QSTD_sizeof(), QSTD_versionsHandlersDefGet(), and _QSTD::versionsHandlers.
Referenced by QSTD_alloc().
Locates the statistics context (meta-data).
| qstd | The statistics context |
References _QSTD::ctx.
| void QSTD_destruct | ( | QSTD * | qstd | ) |
The destructor for a QSTD control structure.
| qstd | The control structure to be destructed. |
References _QSTD::free.
| static __inline QFCP_cache * qstd_file_cache_get | ( | void | ) | [static] |
Returns a pointer to the file cache.
References RND_8.
Referenced by QSTD_construct().
| static __inline void qstd_sampleV0_add | ( | QSTD_sampleV0 * | dst, | |
| const QSTD_sampleV0 * | src | |||
| ) | [static] |
Adds the source sample to the destination sample.
| dst | The destination sample | |
| src | The source sample |
References _QSTD_statisticsV0::cnts, QSSP_spanV0Complete(), QSTD_TYPE_K_CUMULATIVE_END, _QSTD_sampleV0::span, _QSTD_sampleV0::stats, and _QSTD_sampleV0::type.
Referenced by qstd_sampleV0_decode().
| static __inline int qstd_sampleV0_decode | ( | QSTD * | qstd, | |
| unsigned int | type_id, | |||
| unsigned char | bridge, | |||
| const unsigned int * | dat | |||
| ) | [static] |
Decodes the statistics data.
| If | not negative, then the sample type (QSTD_TYPE_K) | |
| If | negative |
| qstd | The QSTD context handle | |
| type_id | 0 = just the set of values 1 = the difference between the current and last set | |
| bridge | bit 0 0 = normal record; 1 = global record | |
| dat | The statistics data |
References _QSTD::ctx, _QSTD::cumulative, _QSTD_ctx::current, decode_sampleV0_0(), decode_sampleV0_1(), decode_sampleV0_2(), QSSP_spanV0Complete(), qstd_sampleV0_add(), QSTD_TYPE_K_CUMULATIVE_BEG, QSTD_TYPE_K_INCREMENTAL, _QSTD::sample, _QSTD_sampleV0::span, _QSTD_sampleV0::type, and _QSTD_sample::v0.
Referenced by QSTD_updateAtRecord().
| int QSTD_sizeof | ( | void * | must_be_null | ) |
Returns the size, in bytes, of a QSTD control structure.
| must_be_null | Parameter reserved for future use |
Referenced by QSTD_construct().
| int QSTD_updateAtContribution | ( | QSTD * | qstd, | |
| const LSF_contribution * | ctb | |||
| ) |
Updates the context at datagram time.
| If | have a statistics sample contribution, the number of records in the contribution. | |
| >0,if | have a record contributor | |
| =0,if | have the contribution context | |
| -1,if | unrecognized |
| qstd | The statistics context to update. | |
| ctb | The statistics contribution |
| const LSF_contribution * QSTD_updateAtDatagram | ( | QSTD * | qstd, | |
| const LSF_datagram * | dgm | |||
| ) |
Updates the context at datagram time.
| qstd | The statistics context to update. | |
| dgm | The statistics datagram |
References _QSTD_ctx::com, _QSTD_ctxVersions::conditions, _QSTD::ctx, _QSTD::cumulative, _QSSP_ctx::dgm, _QSSP_ctx::files, _QSTD_ctx::labels, _QSTD::labelsHandlers, _QSTD_ctxVersions::master, QSSP_ctxUpdateAtDatagram(), QSTD_labelsHandlersResolveFull(), QSTD_VERSION_K_CONDITIONS, QSTD_VERSION_K_SAMPLE, QSTD_versionsGet(), QSTD_versionsHandlersResolveFull(), _QSTD_ctxVersions::sample, _QSTD_ctx::version, _QSTD::versions, and _QSTD::versionsHandlers.
| int QSTD_updateAtRecord | ( | QSTD * | qstd, | |
| const LSF_record * | rec | |||
| ) |
Updates the context at record time.
| Non-negative | values indicate are one of the QSTD_type's | |
| Negative | values indicate an unsuccessful update |
| qstd | The statistics context to update. | |
| rec | The statistics record |
References _QSTD::ctx, qstd_sampleV0_decode(), _QSTD_ctxVersions::sample, and _QSTD_ctx::version.
1.5.8