GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PBS / dev > test_wut / mv2304
#include <stdio.h>
#include <stdlib.h>
#include <PBS/PBS.h>
#include <PBS/TMR.h>
#include <PBS/FPA.h>
#include <PBS/PTS.h>
#include <PBS/SPIN.h>
#include <PBS/WCT.h>
#include <PBS/WUT.h>
#include <PBS/TOC.h>
#include <PBS/TOV.h>
#include <PBS/QI.h>
#include <PBS/Q.h>
#include <string.h>
#include <pthread.h>
#include <errno.h>
Classes | |
struct | _Msg |
Standard message to be exchanged between timer ISR and task. More... | |
struct | _Handler_Ctx |
The context parameter passed to the WUT timer. More... | |
Defines | |
#define | ONE_SECOND (1000 * 1000 * 1000) |
Convenience definition for 1 second in nanosecond units. | |
Typedefs | |
typedef struct _Msg | Msg |
Typedef for struct _Msg. | |
typedef struct _Handler_Ctx | Handler_Ctx |
Typedef for struct _Handler_Ctx. | |
Functions | |
int | test_wut (int wait) |
int | test_wut_1 (int wait) |
Basic test of the WUT facility. | |
int | test_wut_2 (int wait) |
Tests that closely space timer interrupts do not kill the machine. | |
static FPA_fcb * | init_fpa (int msg_cnt, int msg_size) |
Internal helper routine to create an FPA pool of messsages. | |
static void | loop (int count, TMR_tick *times, int *dctrs, int ptus) |
Silly routine used in measuring the overheads. | |
WUT_cb_status | handler (Handler_Ctx *ctx, WUT_tmr *wut) |
Timer ISR to deliver a message packet back to the task. | |
WUT_cb_status | panic_handler (Handler_Ctx *ctx, WUT_tmr *wut) |
Requeues closely spaced interrupts to test that the WUT timer ISR behaves correctly. | |
int | main (int argc, char **argv) |
Entry point for host testing. | |
void | test_timeout (void) |
Tests the Posix timeout mechanism. | |
Variables | |
static unsigned int | Test_Count = 0 |
CVS $Id: test_wut.c,v 1.7 2011/03/24 23:05:45 apw Exp $
The WUT facility provides fine-grain timing interrupts, at the level of the resolution of the internal processor clock.
$ test_wut [period]
To run the program on VxWorks platorms, at the shell type
$ test_wut [period]
where period is a number given in Hertz. The default value is 1 Hz.
Typedef for struct _Msg.
WUT_cb_status handler | ( | Handler_Ctx * | ctx, | |
WUT_tmr * | wut | |||
) |
Timer ISR to deliver a message packet back to the task.
ctx | Test context handle | |
wut | The WUT timer entry being serviced |
References _Msg::cnt, _Handler_Ctx::fpa, _Msg::node, ONE_SECOND, _Handler_Ctx::que, _Msg::tov, and _Msg::wct.
Referenced by test_wut_1().
static FPA_fcb * init_fpa | ( | int | msg_cnt, | |
int | msg_size | |||
) | [static] |
Internal helper routine to create an FPA pool of messsages.
msg_cnt | The number of messages in the pool | |
msg_size | The size, in bytes, of one message |
Referenced by test_wut_1(), and test_wut_2().
int main | ( | int | argc, | |
char ** | argv | |||
) |
Entry point for host testing.
argc | The count of command line arguments, basically unused | |
argv | The vector of command line arguments, basically unused |
$ test_wut
References test_wut_1(), and test_wut_2().
WUT_cb_status panic_handler | ( | Handler_Ctx * | ctx, | |
WUT_tmr * | wut | |||
) |
Requeues closely spaced interrupts to test that the WUT timer ISR behaves correctly.
ctx | Test context handle | |
wut | The WUT timer entry being serviced |
References _Msg::cnt, _Handler_Ctx::fpa, _Msg::node, _Handler_Ctx::que, _Msg::tov, and _Msg::wct.
Referenced by test_wut_2().
void test_timeout | ( | void | ) |
Tests the Posix timeout mechanism.
int test_wut_1 | ( | int | wait | ) |
Basic test of the WUT facility.
wait | Unused |
References _Msg::cnt, _Handler_Ctx::fpa, handler(), init_fpa(), loop(), ONE_SECOND, _Handler_Ctx::que, _Msg::tov, and _Msg::wct.
Referenced by main().
int test_wut_2 | ( | int | wait | ) |
Tests that closely space timer interrupts do not kill the machine.
wait | Unused |
References _Msg::cnt, _Handler_Ctx::fpa, init_fpa(), _Msg::node, ONE_SECOND, panic_handler(), _Handler_Ctx::que, _Msg::tov, and _Msg::wct.
Referenced by main().