GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > EMSG / V0-0-3
Constituent: emsg_mt     Tag: i845e
#include "time.h"
Include dependency graph for EMSG_pubdefs.h:
This graph shows which files directly or indirectly include this file:
Data Structures | |
struct | _EMSG_InitPrm |
Structure to hold parameters needed by EMSG initialization routine. More... | |
struct | _EMSG_Message |
Structure to hold an instance of a message. More... | |
struct | _EMSG_Counts |
Structure for instrumentation counts. More... | |
Defines | |
#define | EMSG_K_FMTBITS 2 |
N-bits needed to type a substitution. | |
#define | EMSG_M_FMTBITS ((1 << EMSG_K_FMTBITS) - 1) |
Mask for above. | |
#define | EMSG_L_FMTMAX (32 / EMSG_K_FMTBITS) |
Maximum number of substitutions. | |
#define | EMSG_K_FMTSTRING 0 |
Conversion type - pointer to string. | |
#define | EMSG_K_FMT4BINT 1 |
Conversion type - 4-byte integer. | |
#define | EMSG_K_FMT8BINT 2 |
Conversion type - 8-byte integer. | |
#define | EMSG_K_FMTDOUBLE 3 |
Conversion type - double (any float). | |
#define | EMSG_L_FMTLENGTH 256 |
Maximum length of a formatting string. | |
#define | EMSG_K_SEVERITY 2 |
Number of bits used for severity field. | |
#define | EMSG_K_MESSAGE 21 |
Number of bits used for message field. | |
#define | EMSG_K_FACILITY 8 |
Number of bits used for facility field. | |
#define | EMSG_K_REPORT 1 |
Number of bits used for 'reported' field. | |
#define | EMSG_V_SEVERITY 0 |
Bit offset to severity field. | |
#define | EMSG_V_MESSAGE (EMSG_V_SEVERITY + EMSG_K_SEVERITY) |
Bit offset to message field. | |
#define | EMSG_V_FACILITY (EMSG_V_MESSAGE + EMSG_K_MESSAGE) |
Bit offset to facility field. | |
#define | EMSG_V_REPORT (EMSG_V_FACILITY + EMSG_K_FACILITY) |
Bit offset to 'reported' field. | |
#define | EMSG_M_SEVERITY (((1 << EMSG_K_SEVERITY) - 1) << EMSG_V_SEVERITY) |
Mask for the severity field. | |
#define | EMSG_M_MESSAGE (((1 << EMSG_K_MESSAGE) - 1) << EMSG_V_MESSAGE) |
Mask for the message field. | |
#define | EMSG_M_FACILITY (((1 << EMSG_K_FACILITY ) - 1) << EMSG_V_FACILITY) |
Mask for the facility field. | |
#define | EMSG_M_REPORT (((1 << EMSG_K_REPORT) - 1) << EMSG_V_REPORT) |
Mask for the 'reported' field. | |
#define | EMSG_M_MATCH (EMSG_M_FACILITY | EMSG_M_MESSAGE) |
Mask of facility and message fields combined. | |
#define | EMSG_M_TEXT 0x00000001 |
Print message text. | |
#define | EMSG_M_NAME 0x00000002 |
Print message name. | |
#define | EMSG_M_ROUTINE 0x00000004 |
Print routine name. | |
#define | EMSG_M_TASK 0x00000008 |
Print task name. | |
#define | EMSG_M_NSEC 0x00000010 |
Print message time nanoseconds. | |
#define | EMSG_M_MSEC 0x00000020 |
Print message time milliseconds. | |
#define | EMSG_M_TIME 0x00000040 |
Print message time (local). | |
#define | EMSG_M_DATE 0x00000080 |
Print message date (local). | |
#define | EMSG_M_DUMP 0x00000100 |
Multi-line dump of everything (dbg). | |
#define | emsg_success(x) (((x) & 1) == 0) |
Test a message for success. | |
#define | emsg_failure(x) (((x) & 1) != 0) |
Test a message for failure. | |
#define | emsg_match(x, y) (((x) & EMSG_M_MATCH) == ((y) & EMSG_M_MATCH)) |
Match a message against a known message. | |
#define | emsg_strip(x) ((x) & ~EMSG_M_REPORT) |
Remove the 'signaled' bit from a code. | |
#define | emsg_report(code, nprm, args...) EMSG_report(code, __func__, nprm, ## args) |
Inserts routine name to EMSG_report() call. | |
Typedefs | |
typedef _EMSG_OutputRtn | EMSG_OutputRtn |
Handle for output routine identification. | |
typedef enum _EMSG_Level | EMSG_Level |
Enumerate message severity levels. | |
typedef enum _EMSG_OutputModes | EMSG_OutputModes |
Enumeration of modes in which output processors can be called. | |
typedef _EMSG_InitPrm | EMSG_InitPrm |
Structure to hold parameters needed by EMSG initialization routine. | |
typedef _EMSG_Message | EMSG_Message |
Structure to hold an instance of a message. | |
typedef _EMSG_Counts | EMSG_Counts |
Structure for instrumentation counts. | |
typedef void | EMSG_CbOutputRtn (EMSG_OutputModes mode, void *prm, const EMSG_Message *msg) |
Signature for a EMSG processing callback routine. | |
Enumerations | |
enum | _EMSG_Level { EMSG_LVL_SUCCESS = 0, EMSG_LVL_INFORMATION = 1, EMSG_LVL_WARNING = 2, EMSG_LVL_ERROR = 3 } |
Enumerate message severity levels. More... | |
enum | _EMSG_OutputModes { EMSG_OUT_INIT = 0, EMSG_OUT_NORMAL = 1, EMSG_OUT_EXIT = 2 } |
Enumeration of modes in which output processors can be called. More... | |
Functions | |
unsigned int | EMSG_attachOutputRtn (EMSG_OutputRtn **handle, EMSG_CbOutputRtn *rtn, void *prm) |
Attach a message output callback routine. | |
unsigned int | EMSG_countsSinceReset (EMSG_Counts *cnt, unsigned int rst) |
Return instrumentation counts since last reset. | |
unsigned int | EMSG_countsSinceStart (EMSG_Counts *cnt) |
Return instrumentation counts since message task started. | |
void | EMSG_deleteOptions (void) |
Delete task options. | |
unsigned int | EMSG_detachOutputRtn (EMSG_OutputRtn *handle) |
Detach a message callback routine. | |
unsigned int | EMSG_initialize (const EMSG_InitPrm *prm) |
Initialize the message system. | |
EMSG_Level | EMSG_getLevel (void) |
Get the current reporting level. | |
const char * | EMSG_getTask (void) |
Return pointer to task name. | |
unsigned short | EMSG_getTrace (void) |
Get the current trace buffer number. | |
void | EMSG_print (EMSG_OutputModes mode, void *prm, const EMSG_Message *msg) |
Output processor callback routine to simply print messages. | |
unsigned int | EMSG_printOptions (unsigned int mask, unsigned int valu) |
Selective set and clear of print processor options. | |
unsigned int | EMSG_report (unsigned int code, const char *rtn, unsigned int nprm,...) |
Process a message reporting request. | |
EMSG_Level | EMSG_setLevel (EMSG_Level level) |
Set the current reporting level. | |
EMSG_Level | EMSG_setLevel4Task (int tid, EMSG_Level level) |
Set the current reporting level for an arbitrary task. | |
unsigned int | EMSG_setTask (const char *task) |
Set the task name. | |
unsigned short | EMSG_setTrace (unsigned short trace) |
Set the current trace buffer number. | |
unsigned int | EMSG_shutdown (void) |
Shut down the message system. | |
unsigned int | EMSG_startTask (void) |
Start the message task. | |
unsigned int | EMSG_stopTask (void) |
Stop the message task. |
|
Enumerate message severity levels. Messages can have one of four severity levels defined by the creator of the message. The names are (I hope) self explanatory. |
|
Enumeration of modes in which output processors can be called. Output processors can be called in one of three modes. Note that the pointer to the message structure is only valid during a call in mode EMSG_OUT_NORMAL. |
|
Enumerate message severity levels. Messages can have one of four severity levels defined by the creator of the message. The names are (I hope) self explanatory. |
|
Enumeration of modes in which output processors can be called. Output processors can be called in one of three modes. Note that the pointer to the message structure is only valid during a call in mode EMSG_OUT_NORMAL. |
|
Attach a message output callback routine. This routine attaches a message output processing routine. Each routine attached is called once when the message system is starting, once per call to EMSG_report(), and once when the message system is stopping. In the single-threaded version of MSG, the attached routines are called directly by the EMSG_report() routine. In the multi-threaded version of MSG the routines are called by the message processing task. Output processing routines may only be attached/detached when the message system is in state EMSG_S_INITIALIZED. This is true:
|
|
Return instrumentation counts since last reset.
|
|
Return instrumentation counts since message task started.
|
|
Delete task options. This routine deletes the options block associated with the current task. It should be called by any task using the message system just before the task exits. |
|
Detach a message callback routine. This routine detaches an message output processing routine. Output processing routines may only be attached/detached when the message system is in state EMSG_S_INITIALIZED. This is true:
|
|
Get the current reporting level. This routine 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.
|
|
Return pointer to task name. This routine returns a pointer to the task name.
|
|
Get the current trace buffer number. This routine 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.
|
|
Initialize the message system. This routine initializes the message system according to the parameters provided in the parameterization block.
|
|
Output processor callback routine to simply print messages.
This routine prints a message using
|
|
Selective set and clear of print processor options. This routine does a selective set and clear on the print options word.
|
|
Process a message reporting request. This routine reports a message. It allocates a message packet and populates it with a block of standard information (timestamp, CPU, task name, etc.) and the variable information in the variadic arguments following nprm. The packet is sent to an message task (in the multi-threaded case) where the message is formatted using the formatting string associated with the message code. The message task then calls all output processors in turn to do whatever it is they want to do with the information. In the single-threaded case, the message processing occurs inline with the routine call.
|
|
Set the current reporting level. This routine 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.
|
|
Set the current reporting level for an arbitrary task. This routine sets the level at which messages are reported for an arbitrary task. Similar in function to EMSG_setLevel(), but...
|
|
Set the task name. This routine 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.
|
|
Set the current trace buffer number. This routine 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.
|
|
Shut down the message system. This routine detaches all attached output processors and frees all resources associated with the message system.
|
|
Start the message task. In multi-threaded mode, this routine spawns a task (with the attributes defined in the task attributes block passed into this routine) to receive and process messages. In single-threaded mode, it does not spawn a task, and all message processing is done inline with the report call. The task attributes block is ignored. In both modes (and before the task spawn in multi-threaded mode), this routine calls each of the output processing routines in turn with a flag to indicate an inialization call.
|
|
Stop the message task. In multi-threaded mode, EMSG_stopTask() runs down the task spawned in EMSG_startTask() and releases the resources associated with it. In single-threaded mode, there is no spawned task to run down. In both modes (and after the spawned task has run down in multi- threaded mode), EMSG_stopTask() calls each of the output processing routines in turn with a flag to indicate a cleanup call.
|