GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > TRC / V0-0-0

Constituent: trc     Tag: mv2304


Interface   Data Structures   File List   Data Fields   Globals  

TRC_snap.c File Reference

Facilities to snapshot a task trace blob. More...

#include <string.h>
#include "PBS/PTS.h"
#include "PBS/RW.ih"
#include "MDB/MDB_pubdefs.h"
#include "TRC/TRC_msgs.h"
#include "TRC_prvrtos.h"

Include dependency graph for TRC_snap.c:


Functions

unsigned int TRC_copyTrace (TRC_Trace *snap, unsigned int reason)
 Workhorse to actually copy a trace snapshot.
unsigned int TRC_freeSnap (TRC_LSFtype type)
 Free a fork message for reuse.
unsigned int TRC_sampleTime ()
 Place a time correlation record in the trace buffer header.
unsigned int TRC_setFork (FORK_que *fqi, FORK_cb_rtn rtn)
 Set up a destination fork queue for snapshot requests.
unsigned int TRC_setRate (unsigned rate)
unsigned int TRC_sizeofSnap ()
 Return the buffer size needed to take a trace snapshot (bytes).
unsigned int TRC_snapStack (unsigned int dest, unsigned int reason, int tdb)
 Make a snapshot of a task's stack.
unsigned int TRC_snapTrace (unsigned int dest, unsigned int reason, unsigned int fui, TRC_TraceUser *dat)
 Make a snapshot of the current state of the trace blob.

Variables

TRC_ForkMsg TRC_forkMsg [TRC_L_MSG_TYPES]
 Preallocated fork messages.

Detailed Description

Facilities to snapshot a task trace blob.

CVS $Id: TRC_snap.c,v 1.1.1.1 2006/12/20 00:44:59 apw Exp $
Author:
A.P.Waite
TRC_snap.c provides facilities to snapshot an active task switch trace buffer.

Warning:
Suitable task tracing facilities are not available on host systems, so while this facility can be compiled and linked on host systems, it cannot perform a run time trace of task switches. It can still, however, record events generated by TRC_insert() calls.

Function Documentation

unsigned int TRC_copyTrace TRC_Trace snap,
unsigned int  reason
 

Workhorse to actually copy a trace snapshot.

Parameters:
snap (in) Buffer into which to place the snapshot
reason (in) Reason for taking the snapshot
Return values:
TRC_NOTINIT Trace system not in state initialized
TRC_NULLPTR NULL snapshot pointer
TRC_SUCCESS Success
TRC_copyTrace() copies the current contents of the trace blob to the provided snapshot buffer.

Warning:
There is no check that the provided trace buffer blob is big enough to accomodate the trace. Use TRC_sizeofSnap() is determine how much memory to allocate.

This is a workhorse for the mLSW task. This is not the correct way to generate a trace snapshot. Use TRC_snapTrace() to do that.

unsigned int TRC_freeSnap TRC_LSFtype  type  ) 
 

Free a fork message for reuse.

Parameters:
type (in) Type of fork message to free
Return values:
TRC_NOTINIT Trace system not in state initialized
TRC_SUCCESS Success

unsigned int TRC_sampleTime void   ) 
 

Place a time correlation record in the trace buffer header.

Return values:
TRC_NOTINIT Trace system not in state initialized
TRC_SUCCESS Success
TRC_sampleTime() samples wall clock time and CPU timebase register time (as quickly as it can manage), and stores the results in the trace buffer. The intent is that the timebase register times captured by the trace can be converted later to wall clock time.

unsigned int TRC_setFork FORK_que *  fqi,
FORK_cb_rtn  rtn
 

Set up a destination fork queue for snapshot requests.

Parameters:
fqi (in) Fork queue handle
rtn (in) Fork queue routine
Return values:
TRC_NOTINIT Trace system not in state initialized
TRC_SUCCESS Success

unsigned int TRC_sizeofSnap void   ) 
 

Return the buffer size needed to take a trace snapshot (bytes).

Return values:
0 Trace system not initialized
x Size needed to accomodate a trace (bytes)

unsigned int TRC_snapStack unsigned int  dest,
unsigned int  reason,
int  tdb
 

Make a snapshot of a task's stack.

Parameters:
dest (in) Destination (0 => 1553, 1 => SDI)
reason (in) User statement about the reason for the dump
tdb (in) Task ID to dump (-1 => "self") (CPU_DB/ITC definition)
Return values:
TRC_CPUTSKID Unrecognized (CPU_DB) task ID
TRC_FORKBAD Cannot queue to destination fork
TRC_FORKDST Destination fork queue not initialized
TRC_NOTINIT Trace system not in state initialized
TRC_NOSTACK Cannot snapshot task stacks on host machines
TRC_STKSNPAC Task stack snapshot already active
TRC_SUCCESS Success
TRC_VXWTSKID Unrecognized (VxWorks) task ID
TRC_snapStack() tells TRC to task a stack snapshot.

unsigned int TRC_snapTrace unsigned int  dest,
unsigned int  reason,
unsigned int  fui,
TRC_TraceUser dat
 

Make a snapshot of the current state of the trace blob.

Parameters:
dest (in) Destination (0 => 1553, 1 => SDI)
reason (in) User statement about the reason for the dump
fui (in) Record format (as unsigned int)
dat (in) User block of information
Return values:
TRC_FORKBAD Cannot queue to destination fork
TRC_FORKDST Destination fork queue not initialized
TRC_NOTINIT Trace system not in state initialized
TRC_SUCCESS Success
TRC_TRCSNPAC Trace snapshot already active
TRC_snapStack() tells TRC to task a trace snapshot.

When taking a snapshot of the trace buffer, this routine will insert a record to indicate the time at which the snapshot was taken. This amounts to making a call to TRC_record() and the fmt and dat parameters to this routine are simply passed through to the TRC_record() call, to allow the caller of this routine do "individualize" the inserted trace record.


Generated on Wed Dec 20 09:24:35 2006 by  doxygen 1.4.4