GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LSW / V3-0-1 > lsw / rhel6-32


Interface   Data Structures   File List   Data Fields   Globals  

LSW_control.c File Reference

Control functions for the LSW package. More...

#include <string.h>
#include <IMM/FPM_pubdefs.h>
#include <IMM/RBM_pubdefs.h>
#include <ITC/ITC_drvdefs.h>
#include <ITC/ITC_pubdefs.h>
#include <MDB/MDB_pubdefs.h>
#include <PBS/FORK.h>
#include <PBS/MBA.h>
#include <PBS/MTX.h>
#include <PBS/RW.ih>
#include <TRC/TRC_msgs.h>
#include <TRC/TRC_pubdefs.h>
#include <LSW/LSW_cmdxtrn.h>
#include <LSW/LSW_msgs.h>
#include <LSW/LSW_pubdefs.h>
#include <LSW_prvdefs.h>

Functions

static unsigned int control_rx (void *prm, const ITC_QueueItem *qitem, void *pay, unsigned int len)
 Process messages arriving on the control queue.
static WUT_cb_status expireTickle (void *prm, WUT_tmr *wut)
 Timer callback used to force a task switch.
static FORK_cb_status forkTickle (FORK_cb_prm *prm, FORK_msg_hdr *hdr)
 Task level target of the cyclic interrupt timer.
static unsigned int initializeCyclic (LSW_Control *lcb, unsigned int rate)
 Initialize the LSW cyclic timer.
static unsigned int initializeMonitor (LSW_Control *lcb)
 Initialize the LSW performance monitor functions.
static unsigned int initializeTask (LSW_Control *lcb)
 Initialize the LSW task description.
static void monitor_cb (ITC_QueueItem *qitem, unsigned int status, void *prm0, void *prm1, void *prm2, unsigned int tx)
 Clean up after sending a monitor record to the SIU.
static void snapStart (void *prm)
 One-time call to reset priority and snapshot the start line.
unsigned int LSW_initialize (unsigned int rate)
 Initialize the LSW tracing facility.
unsigned int LSW_start ()
 Start the mLSW task.

Variables

LSW_ControlLSW_lcb
 Control block for LSW facility.


Detailed Description

Control functions for the LSW package.

CVS $Id: LSW_control.c,v 1.5 2011/03/29 20:50:12 apw Exp $
Author:
A.P.Waite
LSW_control.c provides facilities initialize the LSW task trace facilities and to construct and run the corresponding task.

Warning:
Suitable task tracing facilities are not available on host systems, so while this facility can be compiled and linked on host systems, it does no real work at run time.

Function Documentation

static unsigned int control_rx ( void *  prm,
const ITC_QueueItem *  qitem,
void *  pay,
unsigned int  len 
) [static]

Process messages arriving on the control queue.

Parameters:
prm (in) User context parameter
qitem (in) Queue item to process
pay (in) Queue item payload
len (in) Queue item payload length
control_rx() is the callback routine for any traffic arriving on the control queue. For now, that's only monitor records coming from the EPUs.

References LSW_saveMonitor(), and _LSW_Dispatch::nid.

Referenced by initializeTask().

static WUT_cb_status expireTickle ( void *  prm,
WUT_tmr *  wut 
) [static]

Timer callback used to force a task switch.

LSW_expireTickle() is a timer callback routine. It simply wakes up a high priority task (by sending a message to one of the task's fork queues), updates the watchdog timer, then resets itself.

References _LSW_Control::delta, forkTickle(), _LSW_Control::fqi, _LSW_Control::isr, and _LSW_Control::wdog.

Referenced by snapStart().

static FORK_cb_status forkTickle ( FORK_cb_prm *  prm,
FORK_msg_hdr *  hdr 
) [static]

Task level target of the cyclic interrupt timer.

This routine implements the task monitor functions. It wakes up cyclically (usually at one second intervals) and takes a snapshot of the monitor section of the system trace information. This is saved locally. and, if this is an EPU, is sent to the SIU.

References _LSW_Control::isr, LSW_saveMonitor(), _LSW_Control::monitor, monitor_cb(), _LSW_Dispatch::nid, _LSW_Dispatch::prm0, _LSW_Dispatch::prm1, and _LSW_Dispatch::typ.

Referenced by expireTickle().

static unsigned int initializeCyclic ( LSW_Control lcb,
unsigned int  rate 
) [static]

Initialize the LSW cyclic timer.

Parameters:
lcb (in) LSW control block
rate (in) Rate of forced task switches (milliseconds) (default: 1000)
initializeCyclic() builds up the facilities to run the cyclic timer.

References _LSW_Control::delta, _LSW_Control::isr, _LSW_Control::tmr, and _LSW_Control::wdog.

Referenced by LSW_initialize().

static unsigned int initializeMonitor ( LSW_Control lcb  )  [static]

Initialize the LSW performance monitor functions.

Parameters:
lcb (in) LSW control block
initializeMonitor() builds up performance monitoring functions

References _LSW_Control::latest, _LSW_Control::monitor, _LSW_Monitor::pnt, and _LSW_Control::scratch.

Referenced by LSW_initialize().

static unsigned int initializeTask ( LSW_Control lcb  )  [static]

Initialize the LSW task description.

Parameters:
lcb (in) LSW control block
initializeTask() builds up the LSW task description

References _LSW_Control::cmd, control_rx(), _LSW_Control::ctl, _LSW_Control::itc, LSW_Apid64c, and _LSW_Control::rcc.

Referenced by LSW_initialize().

unsigned int LSW_initialize ( unsigned int  rate  ) 

Initialize the LSW tracing facility.

Parameters:
rate (in) Rate of forced task switches (milliseconds) (default: 1000)
LSW_initialize() builds up the resources to run the LSW application and task.

References initializeCyclic(), initializeMonitor(), initializeTask(), LSW_CTL_BROKEN, LSW_CTL_INITIALIZED, LSW_CTL_UNINITIALIZED, _LSW_Control::mtx, _LSW_Control::rwi, and _LSW_Control::state.

unsigned int LSW_start ( void   ) 

static void monitor_cb ( ITC_QueueItem *  qitem,
unsigned int  status,
void *  prm0,
void *  prm1,
void *  prm2,
unsigned int  tx 
) [static]

Clean up after sending a monitor record to the SIU.

Parameters:
qitem (in) Queue item
status (in) Status from ITC_send()
prm0 (in) User param 0 (LSW control block)
prm1 (in) User param 1 (unused)
prm2 (in) User param 2 (unused)
tx (in) Failure during send phase of ITC_send() (unused)
monitor_cb() is the callback routine that's called once the monitor record has been delivered to the SIU (a standard ITC completion routine).

References _LSW_Control::monitor.

Referenced by forkTickle().


Generated on Tue Nov 29 17:21:25 2011 by  doxygen 1.5.8