GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCBD / V1-5-0 > lcbd / rad750
#include <string.h>
#include "PBI/Attribute.h"
#include "LCBD/LCBD_stats.h"
#include "LCBD/LCBD_msgs.h"
#include "LCBD_p.h"
#include "PBS/MTX.ih"
#include <stdio.h>
Functions | |
static __inline void | update_32 (unsigned int *dst, unsigned int *ledger, const unsigned int *cur, int cnt) |
Updates the 32-bit oriented statistics by adding the current statistics to the ledger and storing the result both in the ledger and the destination. | |
static __inline void | update_evt_proto (LCBD_stats_evt_proto *dst, LCBD_stats_evt_proto *ledger, const LCBD_stats_evt_proto *cur, int cnt) |
Updates the event protocol statistics of the EVT block. | |
static __inline void | sub_32 (unsigned int *c, const unsigned int *a, const unsigned int *b, int cnt) |
Sums the 32-bit oriented statistics of the ISR/RESULT & EVT block. | |
static __inline void | sub_evt_proto (LCBD_stats_evt_proto *c, const LCBD_stats_evt_proto *b, const LCBD_stats_evt_proto *a, int cnt) |
Sums the event protocol statistics of the EVT block. | |
static void | update (LCBD_stats *dst, LCBD_stats *ledger, const LCBD_stats *cur) |
Updates the statistics by adding the cur to the ledger and storing the result both in the ledger and the dst. | |
unsigned int | LCBD_stats_init (LCBD_scb *scb) |
Initializes the statistics control block. | |
unsigned int | LCBD_stats_destroy (LCBD_scb *scb) |
Destroys the statistics control block. | |
unsigned int | LCBD_stats_get (const LCBD lcb, LCBD_stats *stats) |
Retrieves a copy of the current statistics. | |
unsigned int | LCBD_stats_clr (LCBD lcb) |
Clears the statistics block. | |
void | LCBD_stats_sub (LCBD_stats *result, const LCBD_stats *stats, const LCBD_stats *base) |
Convenience function to subtract a baseline statistics block from another statistics block, storing in a destination block. | |
static void | putSeparator (int type) |
Puts a separator line out. | |
static void | putRow (const char t0, const char *title, const unsigned int *cnts, int stride) |
Internal routine to format one row of the LCBD_evt_stats display. | |
static __inline void | putEvtProtoTitle (void) |
Internal routine to output the title line for the event protocol statitics. | |
static void | putEvtProtoRow (const char *title, unsigned int rcnts, unsigned long long int rwrds, unsigned int fcnts, unsigned int fcall, unsigned long long int fwrds) |
Internal routine to format one row of the LCBD_stats_evt_proto display. | |
static __inline void | putEvtHandler (const LCBD_stats_evt *evt) |
Outputs the LCBD_stats_evt that are accumulated in the event handler. | |
static __inline void | putEvtTickle (const LCBD_stats_evt_tickle *tickle) |
Outputs the LCBD_evt_tickle statistics. | |
static __inline void | putEvtProto (const LCBD_stats_evt_proto *proto) |
Outputs that portion of the event statistics that is by protocol. | |
void | LCBD_stats_tim_show (const LCBD_stats_tim *tim) |
Shows (prints to standard output) the collection time data. | |
void | LCBD_stats_isr_show (const LCBD_stats_isr *isr) |
Shows (prints to the terminal) a display of the statistics gathered in the LCBD ISR routine. | |
void | LCBD_stats_rst_show (const LCBD_stats_rst *rst) |
Shows (prints to the terminal) a display of the statistics gathered in the LCBD RESULTs handler routine. | |
void | LCBD_stats_evt_show (const LCBD_stats_evt *evt) |
Shows (prints to the terminal) a display of the statistics gathered in the LCBD EVENTs handler routine. | |
void | LCBD_stats_show (const LCBD_stats *stats) |
Shows (prints at the terminal) all three statistics blocks. |
CVS $Id
unsigned int LCBD_stats_clr | ( | LCBD | lcb | ) |
Clears the statistics block.
lcb | The LCB driver handle |
unsigned int LCBD_stats_destroy | ( | LCBD_scb * | scb | ) |
Destroys the statistics control block.
LCBD_OK,on | success | |
Anything | else, failure |
scb | Pointer to the statistics control block to destroy |
void LCBD_stats_evt_show | ( | const LCBD_stats_evt * | evt | ) |
Shows (prints to the terminal) a display of the statistics gathered in the LCBD EVENTs handler routine.
evt | The event statistics |
unsigned int LCBD_stats_get | ( | const LCBD | lcb, | |
LCBD_stats * | stats | |||
) |
Retrieves a copy of the current statistics.
Status. | The only real way this routine can fail is if the locking mutex has not been initialized or it has been corrupted. |
lcb | The LCB driver handle | |
stats | Area to copy the latest statistics into |
unsigned int LCBD_stats_init | ( | LCBD_scb * | scb | ) |
Initializes the statistics control block.
LCBD_OK,on | success | |
LCBD_STATSIFL,on | failure |
scb | Pointer to the statistics control block to initialize |
void LCBD_stats_isr_show | ( | const LCBD_stats_isr * | isr | ) |
Shows (prints to the terminal) a display of the statistics gathered in the LCBD ISR routine.
isr | The driver statistics block |
void LCBD_stats_rst_show | ( | const LCBD_stats_rst * | rst | ) |
Shows (prints to the terminal) a display of the statistics gathered in the LCBD RESULTs handler routine.
rst | The results statistics block |
void LCBD_stats_show | ( | const LCBD_stats * | stats | ) |
Shows (prints at the terminal) all three statistics blocks.
stats | The statistics block to display |
void LCBD_stats_sub | ( | LCBD_stats * | result, | |
const LCBD_stats * | stats, | |||
const LCBD_stats * | base | |||
) |
Convenience function to subtract a baseline statistics block from another statistics block, storing in a destination block.
result | The results of the subtraction | |
stats | The statistics block to subtract from | |
base | The baseline statistics block to subtract. |
void LCBD_stats_tim_show | ( | const LCBD_stats_tim * | tim | ) |
Shows (prints to standard output) the collection time data.
tim | The collection time structure to display |
static __inline void putEvtProto | ( | const LCBD_stats_evt_proto * | proto | ) | [static] |
Outputs that portion of the event statistics that is by protocol.
proto | The event statistics by protocol to output |
static void putEvtProtoRow | ( | const char * | title, | |
unsigned int | rcnts, | |||
unsigned long long int | rwrds, | |||
unsigned int | fcall, | |||
unsigned int | fcnts, | |||
unsigned long long int | fwrds | |||
) | [static] |
Internal routine to format one row of the LCBD_stats_evt_proto display.
title | The title line | |
rcnts | The number of packets received | |
rwrds | The number of 32-bit words received | |
fcall | The number of calls to LCBD_evt_free | |
fcnts | The number of packets actually freed | |
fwrds | The number of 32-bit words freed |
static __inline void putEvtTickle | ( | const LCBD_stats_evt_tickle * | tickle | ) | [static] |
Outputs the LCBD_evt_tickle statistics.
tickle | The LCBD_evt_tickle statisttics to output |
static void putRow | ( | const char | t0, | |
const char * | title, | |||
const unsigned int * | cnts, | |||
int | stride | |||
) | [static] |
Internal routine to format one row of the LCBD_evt_stats display.
t0 | Leading legend character | |
title | The title of this row | |
cnts | The array of 4 counts to output | |
stride | The number of elements between each cnt |
static void putSeparator | ( | int | type | ) | [static] |
Puts a separator line out.
type | The type of separator |
static __inline void sub_32 | ( | unsigned int * | c, | |
const unsigned int * | a, | |||
const unsigned int * | b, | |||
int | cnt | |||
) | [static] |
Sums the 32-bit oriented statistics of the ISR/RESULT & EVT block.
c | The destination statistics block | |
a | The statistics to subtract from | |
b | The statistics to subtract | |
cnt | The number of 32-bit integers to sum |
static __inline void sub_evt_proto | ( | LCBD_stats_evt_proto * | c, | |
const LCBD_stats_evt_proto * | b, | |||
const LCBD_stats_evt_proto * | a, | |||
int | cnt | |||
) | [static] |
Sums the event protocol statistics of the EVT block.
c | The destination event protocol statistics block | |
b | The event protocol statistics to subtract from | |
a | The event protocol statistics to subtract | |
cnt | The number of evt proto records to subtract |
static void update | ( | LCBD_stats * | dst, | |
LCBD_stats * | ledger, | |||
const LCBD_stats * | cur | |||
) | [static] |
Updates the statistics by adding the cur to the ledger and storing the result both in the ledger and the dst.
dst | The destination statistics block | |
ledger | The ledger, or running total block | |
cur | The current contribution to the running sum |
static __inline void update_32 | ( | unsigned int * | dst, | |
unsigned int * | ledger, | |||
const unsigned int * | cur, | |||
int | cnt | |||
) | [static] |
Updates the 32-bit oriented statistics by adding the current statistics to the ledger and storing the result both in the ledger and the destination.
dst | The destination statistics block | |
ledger | The ledger, or running total block | |
cur | The current contribution to the running sum | |
cnt | The number of 32-bit integers to sum |
static __inline void update_evt_proto | ( | LCBD_stats_evt_proto * | dst, | |
LCBD_stats_evt_proto * | ledger, | |||
const LCBD_stats_evt_proto * | cur, | |||
int | cnt | |||
) | [static] |
Updates the event protocol statistics of the EVT block.
dst | The destination protocol statistics block | |
ledger | The ledger, or running total procotol block | |
cur | The current contribution to the running sum | |
cnt | The number of proto records to update |