GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> MSG / dev > test_msg_mt / rhel5-64
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <PBS/MBA.h>
#include <PBS/PTS.h>
#include <PBS/QI.h>
#include <PBS/TASK.h>
#include <MSG/MSG_pubdefs.h>
#include <MSG/MSG_msgs.h>
#include <MSG/MTS_msgs.h>
#include <MSG_prvdefs.h>
#include <MSG_tstdefs.h>
Classes | |
struct | _MSG_TestOpt |
Structure to hold a task setup block for shotgun testing. More... | |
struct | _MSG_TaskTx |
Structure to hold per task transmission statistics. More... | |
struct | _MSG_TaskRx |
Structure to hold per task reception statistics. More... | |
struct | _MSG_AllRx |
Structure to hold overall counters used in shotgun testing. More... | |
struct | _MSG_TaskOpt |
Structure to hold a task setup block for shotgun testing. More... | |
struct | _MSG_CountPair |
Structure to hold start and reset instrumentation blocks. More... | |
struct | _MSG_CountGrab |
Structure to hold a collection of instrumentation blocks. More... | |
Defines | |
#define | MSG_L_SECS ( 10 ) |
Number of seconds for which to accumulate. | |
#define | MSG_N_TASK ( 8 ) |
Number of tasks to spawn. | |
#define | MSG_M_TASK ( 0x00000044 ) |
Mask of tasks to report from interrupt. | |
#define | MSG_M_TWOBEG ( 0x00000001 ) |
Two begin blackouts in a row. | |
#define | MSG_M_TWOEND ( 0x00000002 ) |
Two end blackouts in a row. | |
#define | MSG_M_BEGDED ( 0x00000004 ) |
A begin gap message marked not reported. | |
#define | MSG_M_BADMSG ( 0x00000008 ) |
Unexpected message code back from MSG_report. | |
#define | MSG_M_BADTSK ( 0x00000010 ) |
Task number out of range. | |
#define | MSG_M_BADTRC ( 0x00000020 ) |
Bad trace number. | |
#define | MSG_M_NULTBD ( 0x00000040 ) |
TBD pointer is null. | |
Typedefs | |
typedef struct _MSG_TestOpt | MSG_TestOpt |
Typedef for struct _MSG_TestOpt. | |
typedef struct _MSG_TaskTx | MSG_TaskTx |
Typedef for struct _MSG_TaskTx. | |
typedef struct _MSG_TaskRx | MSG_TaskRx |
Typedef for struct _MSG_TaskRx. | |
typedef struct _MSG_AllRx | MSG_AllRx |
Typedef for struct _MSG_AllRx. | |
typedef struct _MSG_TaskOpt | MSG_TaskOpt |
Typedef for struct _MSG_TaskOpt. | |
typedef struct _MSG_CountPair | MSG_CountPair |
Typedef for struct _MSG_CountPair. | |
typedef struct _MSG_CountGrab | MSG_CountGrab |
Typedef for struct _MSG_CountGrab. | |
Functions | |
static void | testShotgun (MSG_TestOpt *testOpt) |
Run the accumulation phase of the shotgun test. | |
static void | testShotgun_accumulate (unsigned int status, unsigned int dtim, unsigned int task) |
Statistics accumulation routine. | |
static unsigned int | testShotgun_analyze (void) |
Analyze the output from a shotgun run. | |
static void | testShotgun_cb (MSG_OutputModes mode, void *prm, const MSG_Message *msg) |
Output processor to capture statistics during shotgun test. | |
static void | testShotgun_counts_dump (void) |
Instrumentation block dump. | |
static void | testShotgun_counts_grab (void) |
Instrumentation grab. | |
static void | testShotgun_task (void *prm) |
Main routine of a shotgun test task. | |
static void | testTaskName (char *buf, int idx) |
Generate a task name. | |
static WUT_cb_status | testShotgun_tmr (void *prm, WUT_tmr *wut) |
Timer expiry callback routine. | |
unsigned int | MSG_testShotgun () |
Driver for the MSG shotgun test. | |
Variables | |
MSG_TestOpt | testOpt [2] |
Options for a pair of tests ("relaxed" and "tense"). | |
static const char * | s_state = "control state" |
The string "control state". | |
static const char * | s_status = "status value" |
The string "status value". | |
static MSG_TaskTx | taskTx [MSG_N_TASK<< 1] |
Statistics. | |
static MSG_AllRx | allRx |
Statistics. | |
static MSG_CountGrab | countGrab |
Instrumentation block stack. |
CVS $Id: MSG_testShotgun.c,v 1.11 2011/03/25 01:05:53 apw Exp $
static void testShotgun | ( | MSG_TestOpt * | testOpt | ) | [static] |
Run the accumulation phase of the shotgun test.
testOpt | Test options (configuration) |
References MSG_N_TASK, _MSG_TaskTx::nop, _MSG_TaskOpt::task, _MSG_TestOpt::tbeg, _MSG_TaskOpt::tbeg, _MSG_TestOpt::tend, _MSG_TaskOpt::tend, testShotgun_task(), testTaskName(), _MSG_TaskTx::time, _MSG_TestOpt::tlen, _MSG_TaskOpt::tlen, _MSG_TaskTx::tmax, _MSG_TestOpt::tmin, _MSG_TaskOpt::tmin, _MSG_TaskTx::tmin, and _MSG_TaskTx::tx.
Referenced by MSG_testShotgun().
static void testShotgun_accumulate | ( | unsigned int | status, | |
unsigned int | dtim, | |||
unsigned int | task | |||
) | [static] |
Statistics accumulation routine.
status | (in) MSG code at exit from MSG_report() call | |
dtim | (in) Delta time in MSG_report() (nanoseconds) | |
task | (in) Task number |
References _MSG_AllRx::mask, MSG_M_BADMSG, MSG_M_BADTSK, MSG_N_TASK, _MSG_TaskTx::nop, _MSG_TaskTx::time, _MSG_TaskTx::tmax, _MSG_TaskTx::tmin, and _MSG_TaskTx::tx.
Referenced by testShotgun_task(), and testShotgun_tmr().
static unsigned int testShotgun_analyze | ( | void | ) | [static] |
Analyze the output from a shotgun run.
testShotgun_analyze() analyzes the output from a shotgun run.
References _EQ, _MSG_AllRx::beg, _MSG_TaskRx::black, _MSG_AllRx::dmax, _MSG_AllRx::dmin, _MSG_AllRx::drop, _MSG_AllRx::end, _MSG_AllRx::mask, MSG_action(), MSG_M_TASK, MSG_N_TASK, MSG_testInt(), _MSG_TaskTx::nop, _MSG_TaskRx::rx, _MSG_AllRx::rx, _MSG_AllRx::smax, _MSG_AllRx::smin, _MSG_AllRx::state, _MSG_AllRx::task, and _MSG_TaskTx::tx.
Referenced by MSG_testShotgun().
static void testShotgun_cb | ( | MSG_OutputModes | mode, | |
void * | prm, | |||
const MSG_Message * | msg | |||
) | [static] |
Output processor to capture statistics during shotgun test.
mode | (in) Output processor call (init, normal or exit) | |
prm | (in) User parameter (for this output processor) | |
msg | (in) Message structure |
References _MSG_AllRx::beg, _MSG_TaskRx::black, _MSG_AllRx::dmax, _MSG_AllRx::dmin, _MSG_AllRx::drop, _MSG_AllRx::end, _MSG_AllRx::mask, MSG_M_BADTRC, MSG_M_NULTBD, MSG_M_TWOBEG, MSG_M_TWOEND, MSG_N_TASK, _MSG_TaskRx::rx, _MSG_AllRx::rx, _MSG_AllRx::smax, _MSG_AllRx::smin, _MSG_AllRx::state, and _MSG_AllRx::task.
Referenced by MSG_testShotgun().
static void testShotgun_task | ( | void * | prm | ) | [static] |
Main routine of a shotgun test task.
prm | (in) User parameter (to parameterize the task) |
References MSG_M_TASK, MSG_N_TASK, _MSG_TaskOpt::qhed, _MSG_TaskOpt::task, _MSG_TaskOpt::tbeg, _MSG_TaskOpt::tend, testShotgun_accumulate(), testShotgun_counts_grab(), testShotgun_tmr(), _MSG_TaskOpt::tlen, and _MSG_TaskOpt::tmin.
Referenced by testShotgun().
static WUT_cb_status testShotgun_tmr | ( | void * | prm, | |
WUT_tmr * | wut | |||
) | [static] |
Timer expiry callback routine.
prm | (in) User parameter (to pass context from driving thread) | |
wut | (in) The timer control block (not used) |
References MSG_M_TASK, MSG_N_TASK, _MSG_TaskOpt::qhed, _MSG_TaskOpt::qnod, _MSG_TaskOpt::task, and testShotgun_accumulate().
Referenced by testShotgun_task().
static void testTaskName | ( | char * | buf, | |
int | idx | |||
) | [static] |
Generate a task name.
buf | (in) Buffer to use | |
idx | (in) Task ID number (according to testShotgun) |
Referenced by testShotgun().
Initial value:
{ { MSG_N_TASK << 2, MSG_L_SECS, 0.000050, 0.001000, 0.000100 }, { MSG_N_TASK, MSG_L_SECS, 0.000050, 0.001000, 0.000100 } }
Referenced by MSG_testShotgun().