GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > TRC / V1-0-5
Constituent: trc     Tag: linux-gcc
#include <string.h>
#include "CCSDS/CCSDS_pkt.h"
#include "LSF/LSF.h"
#include "LSF/LSF_ids.h"
#include "MDB/MDB_pubdefs.h"
#include "PBS/FORK.h"
#include "PBS/MBA.h"
#include "PBS/RW.ih"
#include "TRC/TRC_msgs.h"
#include "TRC_prvdefs.h"
Include dependency graph for TRC_snap.c:
Functions | |
static TRC_SnapTrace * | allocSnap (TRC_Buffer *trc) |
Allocate a snapshot buffer. | |
static FORK_cb_status | forkSnapTrace (FORK_cb_prm *prm, FORK_msg_hdr *hdr) |
Service a request to take a trace buffer snapshot. | |
static unsigned char * | formatHeader (char *qipay, unsigned int size, WCT_time when, unsigned int apid) |
Format the header of a telemetry block. | |
static void | sendSDI_cb (ITC_QueueItem *qitem, unsigned int status, void *prm0, void *prm1, void *prm2, unsigned int tx) |
Clean up after sending a trace snapshot to the SDI. | |
static void | snapInitialize (unsigned int len, char *mem, unsigned int pkt, unsigned int off) |
Initialize a snapshot buffer. | |
unsigned int | TRC_attachSnap (TRC_Buffer *trc, unsigned int cnt) |
Attach snapshot buffers to a trace. | |
unsigned int | TRC_copy (TRC_Buffer *dtrc, TRC_Buffer *strc, unsigned int reason) |
Make a coherent copy of a trace buffer (if possible). | |
unsigned int | TRC_detachSnap (TRC_Buffer *trc) |
Detach snapshot buffers to a trace. | |
void | TRC_freeSnap (TRC_SnapTrace *snp) |
Free a trace snapshot buffer. | |
unsigned int | TRC_saveStart (void *prm, unsigned int len, TRC_SnapTrace *snp, TRC_Buffer *trc) |
Save the start line trace in a safe place. | |
unsigned int | TRC_sendCTDB (void *prm, unsigned int len, TRC_SnapTrace *snp, TRC_Buffer *trc) |
Send a snapshot to the science data interface. | |
unsigned int | TRC_sendFile (void *prm, unsigned int len, TRC_SnapTrace *snp, TRC_Buffer *trc) |
Send the trace from a snapshot to a file. | |
unsigned int | TRC_sendSDI (void *prm, unsigned int len, TRC_SnapTrace *snp, TRC_Buffer *trc) |
Send a snapshot to the science data interface. | |
unsigned int | TRC_sendStart (TRC_SnapDest dest) |
Send the start line trace to the indicated destination. | |
unsigned int | TRC_snapTrace (TRC_Buffer *trc, unsigned int reason, TRC_cb_Dispose *rtn, void *prm, unsigned int len) |
Snapshot a trace and send the output to a (telemetry) destination. |
CVS $Id: TRC_snap.c,v 1.2 2007/03/22 01:47:40 apw Exp $
|
Allocate a snapshot buffer.
|
|
Service a request to take a trace buffer snapshot. forkSnapTrace() services a request to take a trace buffer snapshot. |
|
Format the header of a telemetry block.
|
|
Clean up after sending a trace snapshot to the SDI.
|
|
Initialize a snapshot buffer.
|
|
Attach snapshot buffers to a trace.
|
|
Make a coherent copy of a trace buffer (if possible).
|
|
Detach snapshot buffers to a trace.
|
|
Free a trace snapshot buffer.
|
|
Save the start line trace in a safe place.
|
|
Send a snapshot to the science data interface.
|
|
Send the trace from a snapshot to a file.
|
|
Send a snapshot to the science data interface.
|
|
Send the start line trace to the indicated destination.
|
|
Snapshot a trace and send the output to a (telemetry) destination.
The parameters rtn, prm, and len are user defined and specify a "disposition" for the snapshot once the high priority task has captured it. The definition of rtn follows the normal conventions for a callback routine (in this case, is must follow the prototype TRC_cb_Dispose). prm and len are slightly less conventional. It's difficult to predict what a user disposition might look like, and how much user data is needed to parameterize it, so the solution adopted here is to reserve a fairly large "user parameter block" in the snapshot request (TRC_L_USERPARM bytes long) then simply copy through anything the user wants to put in there. The poster child for a callback that needs a fairly big user parameter block would be a routine that writes the captured snapshot out to a file, but needs to know the name of the file to open. That could be accomplished with an indirect pointer of course, but then caller needs to arrange for the memory to persist until the file writing is complete and then arrange for that memory's disposal. All in all, it's easier if the caller can just store the file name along with the request and have done. |