GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > MSG / V3-0-0

Constituent: msg_mt     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

MSG_report_mt.c File Reference

Multi-threaded specific implementations of utility routines. More...

#include "PBI/TBD_id.h"
#include "PBS/TBD.ih"
#include "MSG/MSG_msgs.h"
#include "MSG/MSG_pubdefs.h"
#include "MSG_prvdefs.h"

Include dependency graph for MSG_report_mt.c:

Include dependency graph

Functions

MSG_Level MSG_getLevel ()
 Get the current reporting level.

const char * MSG_getTask ()
 Return pointer to task name.

unsigned short MSG_getTrace ()
 Get the current trace buffer number.

unsigned int MSG_isDrained (MSG_Control *mcb)
 Test to see if the fork has drained.

MSG_Level MSG_setLevel (MSG_Level newval)
 Set the current reporting level.

MSG_Level MSG_setLevel4Task (void **tbd, MSG_Level newval)
 Set the current reporting level for an arbitrary task.

unsigned int MSG_setTask (const char *task)
 Set the task name.

unsigned short MSG_setTrace (unsigned short newval)
 Set the current trace buffer number.


Detailed Description

Multi-threaded specific implementations of utility routines.

CVS $Id: MSG_report_mt.c,v 1.2 2004/12/12 06:45:41 apw Exp $
Author:
A.P.Waite

Function Documentation

MSG_Level MSG_getLevel void   ) 
 

Get the current reporting level.

Returns:
The severity level for reporting
MSG_getLevel() returns the level at which messages are reported. Messages whose severity is greater than or equal to the level set are reported.

If called from task level, the level associated with the task is returned. If called from interrupt level, the level associated (globally) with interrupt level is returned.

const char * MSG_getTask void   ) 
 

Return pointer to task name.

Returns:
Pointer to the string containing the task name
MSG_getTask() returns a pointer to the task name. In VxWorks (only) check whether the current context is interrupt level, in which case return a pointer to the fixed string ISR>.

Warning:
For tasks/threads not started with the TASK routines, the name will be returned as the fixed string UND>.

unsigned short MSG_getTrace void   ) 
 

Get the current trace buffer number.

Returns:
The trace buffer number for reporting
MSG_getTrace() returns the trace buffer number currently in effect. This is a 16-bit number associated with a message. All messages record the current value of the trace buffer number. This is a simple mechanism to group messages.

If called from task level, the trace buffer number associated with the task is returned. If called from interrupt level, the trace buffer number associated (globally) with interrupt level is returned.

unsigned int MSG_isDrained MSG_Control mcb  ) 
 

Test to see if the fork has drained.

Parameters:
mcb Message control block
Return values:
0 Fork is not drained
1 Fork is drained

MSG_Level MSG_setLevel MSG_Level  newval  ) 
 

Set the current reporting level.

Parameters:
newval (in) Reporting level to be set
Returns:
Reporting level prior to the call
MSG_setLevel() sets the level at which messages are reported. A message whose severity is greater than or equal to the set level is reported. This routine returns the reporting level prior to the call (to allow simple reversion).

If called from task level, the level associated with the task is set and the task's previous level is returned. If called from interrupt level, the level associated (globally) with interrupt level is set and the level previously in effect at interrupt level is returned.

MSG_Level MSG_setLevel4Task void **  tbd,
MSG_Level  newval
 

Set the current reporting level for an arbitrary task.

Parameters:
tbd (in) Pointer to arbitrary task's TBD block
newval (in) Reporting level to be set
Returns:
Reporting level prior to the call
MSG_setLevel4Task() sets the level at which messages are reported for an arbitrary task. Similar in function to MSG_setLevel(), but...

Warning:
This routine has no way to validate the authenticity of the TBD pointer. The calling routine is responsible for ensuring integrity. This may seem overly cautious (pointers are frequently passed to routines), but TBD blocks may be more volatile than one might expect. In particular, they may come and go as TASKs are created and destroyed.

unsigned int MSG_setTask const char *  task  ) 
 

Set the task name.

Parameters:
task (in) Pointer to task name
Return values:
MSG_SUCCESS Always
MSG_setTask() sets a task name. This is only valid in the single-threaded environment where the task name is an arbitrary string under user control. It makes no sense to call this routine for multi-threaded systems so this multi-threaded implementation simply ignores the call.

unsigned short MSG_setTrace unsigned short  newval  ) 
 

Set the current trace buffer number.

Parameters:
newval (in) Trace buffer number to set
Returns:
The trace buffer prior to the change
MSG_setTrace() sets the trace buffer number currently in effect. This is a 16-bit number associated with a message. All messages record the current value of the trace buffer number. This is a simple mechanism to group messages. The routine returns the trace buffer in effect prior to the call to make reversion simple.

If called from task level, the trace buffer number associated with the task is set and the task's previous trace buffer number is returned. If called from interrupt level, the trace buffer number associated (globally) with interrupt level is set and the trace buffer number previously in effect at interrupt level is returned.


Generated on Sun Jul 17 09:56:04 2005 by doxygen 1.3.3