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


Interface   Data Structures   File List   Data Fields   Globals  

LSW_monitor.c File Reference

Functions to handle monitor records. More...

#include <string.h>
#include <ITC/ITC_pubdefs.h>
#include <MDB/MDB_pubdefs.h>
#include <TRC/TRC_msgs.h>
#include <TRC/TRC_pubdefs.h>
#include <LSW/LSW_msgs.h>
#include <LSW_prvdefs.h>

Functions

unsigned int LSW_canMonitor (ITC_NodeID nid)
 Test whether monitor records are available for node nid.
unsigned int LSW_copyMonitor (ITC_NodeID nid, TRC_Monitor *mon)
 Make a coherent (thread safe) copy of a monitor record.
unsigned int LSW_differMonitor (ITC_NodeID nid, TRC_Monitor *old, TRC_Top *top)
 Calculate a differential monitoring structure.
unsigned int LSW_saveMonitor (LSW_Control *lcb, ITC_NodeID nid, TRC_Monitor *new)
 Save a coherent (thread safe) copy of a monitor record.


Detailed Description

Functions to handle monitor records.

CVS $Id: LSW_monitor.c,v 1.4 2011/03/29 20:50:12 apw Exp $
Author:
A.P.Waite

Function Documentation

unsigned int LSW_canMonitor ( ITC_NodeID  nid  ) 

Test whether monitor records are available for node nid.

Parameters:
nid (in) Node ID
Return values:
0 Records are not available
1 Records are available
LSW_canMonitor() tests whether monitor records are available for node nid.

References _LSW_Monitor::cnt, _LSW_Control::latest, LSW_CTL_STARTED, LSW_lcb, and _LSW_Control::state.

unsigned int LSW_copyMonitor ( ITC_NodeID  nid,
TRC_Monitor *  mon 
)

Make a coherent (thread safe) copy of a monitor record.

Parameters:
nid (in) Node ID
mon (out) Monitor record
Return values:
LSW_CANTCOPY Cannot make a coherent copy
LSW_NODENOT Not a monitored node
LSW_NORECORD Monitor record not available
LSW_NOTINIT LSW system not initialized
LSW_PARMNULL Caller passed a null parameter
LSW_SUCCESS Success
Warning:
Quite apart from the usual snafus (node ID out of range, mon pointer is NULL), there are circumstances where this routine can fail. This is limited to the case of the calling task not seeing enough cycles to copy the complete monitor record before it gets updated again. This should be a very rare occurence, but calling routines should check the return code for this (as they should be doing anyway!).
LSW_copyMonitor() makes a copy (in a thread safe manner) of the latest monitor record for node nid.

References _LSW_Monitor::cnt, _LSW_Control::latest, LSW_CTL_STARTED, LSW_lcb, _LSW_Monitor::pnt, and _LSW_Control::state.

Referenced by LSW_differMonitor().

unsigned int LSW_differMonitor ( ITC_NodeID  nid,
TRC_Monitor *  old,
TRC_Top *  top 
)

Calculate a differential monitoring structure.

Parameters:
nid (in) Node ID
old (in) Previous sample
top (in) Output destination of difference
LSW_differMonitor() differences an old TRC_Monitor record with the latest version of that record (all for node nid) and places the result in the output top structure.

All the real work is done by a TRC routine that knows how to do this.

References LSW_copyMonitor(), LSW_CTL_STARTED, LSW_lcb, and _LSW_Control::state.

unsigned int LSW_saveMonitor ( LSW_Control lcb,
ITC_NodeID  nid,
TRC_Monitor *  new 
)

Save a coherent (thread safe) copy of a monitor record.

Parameters:
lcb (in) LSW control block
nid (in) Node ID the monitor record applies to
new (in) New monitor record to be saved
LSW_saveMonitor() saves a monitor record in a thread-safe manner.

References _LSW_Monitor::cnt, _LSW_Control::latest, _LSW_Monitor::pnt, _LSW_Control::rwi, and _LSW_Control::scratch.

Referenced by control_rx(), and forkTickle().


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