|
|
 |
|
|
 |
include/sys/tracer.h File Reference
Detailed Description
Trace functions.
- Author:
- Philipp Blum <blum@tik.ee.ethz.ch>
- Date:
- 22.12.2004
|
Defines |
|
#define | TRACE_MODE_FIRST |
|
#define | TRACE_MODE_OFF |
|
#define | TRACE_MODE_CIRCULAR |
|
#define | TRACE_MODE_ONESHOT |
|
#define | TRACE_MODE_LAST |
|
#define | TRACE_MODE_DEFAULT |
|
#define | TRACE_SIZE_DEFAULT |
|
#define | TRACE_TAG_FIRST |
|
#define | TRACE_TAG_CRITICAL_FIRST |
|
#define | TRACE_TAG_CRITICAL_ENTER |
|
#define | TRACE_TAG_CRITICAL_EXIT |
|
#define | TRACE_TAG_CRITICAL_LAST |
|
#define | TRACE_TAG_THREAD_FIRST |
|
#define | TRACE_TAG_THREAD_YIELD |
|
#define | TRACE_TAG_THREAD_SETPRIO |
|
#define | TRACE_TAG_THREAD_WAIT |
|
#define | TRACE_TAG_THREAD_SLEEP |
|
#define | TRACE_TAG_THREAD_LAST |
|
#define | TRACE_TAG_INTERRUPT_FIRST |
|
#define | TRACE_TAG_INTERRUPT_ENTER |
|
#define | TRACE_TAG_INTERRUPT_EXIT |
|
#define | TRACE_TAG_INTERRUPT_LAST |
|
#define | TRACE_TAG_START |
|
#define | TRACE_TAG_STOP |
|
#define | TRACE_TAG_USER |
|
#define | TRACE_TAG_LAST |
|
#define | TRACE_MAX_USER |
|
#define | TRACE_INT_FIRST |
|
#define | TRACE_INT_UART0_CTS |
|
#define | TRACE_INT_UART0_RXCOMPL |
|
#define | TRACE_INT_UART0_TXEMPTY |
|
#define | TRACE_INT_UART1_CTS |
|
#define | TRACE_INT_UART1_RXCOMPL |
|
#define | TRACE_INT_UART1_TXEMPTY |
|
#define | TRACE_INT_TIMER0_OVERFL |
|
#define | TRACE_INT_TIMER1_OVERFL |
|
#define | TRACE_INT_SUART_TIMER |
|
#define | TRACE_INT_SUART_RX |
|
#define | TRACE_INT_LAST |
| #define | TRACE_ADD_ITEM(TAG, PC) |
| #define | TRACE_ADD_ITEM_PC(TAG) |
Typedefs |
|
typedef _t_traceitem | t_traceitem |
| | Item in the trace buffer.
|
Functions |
| int | NutTraceInit (int size, char mode) |
| void | NutTraceStop (void) |
| void | NutTracePrint (int size) |
| void | NutTraceTerminal (u_char *arg) |
| int | NutTraceGetPC (void) |
| void | NutTraceClear (void) |
| void | NutTraceMaskPrint (void) |
| void | NutTraceMaskClear (int tag) |
| void | NutTraceMaskSet (int tag) |
| void | NutTraceStatusPrint (void) |
| int | NutTraceRegisterUserTag (int tag, char *tag_string) |
Variables |
|
u_int | micros_high |
| | Upper 16 bits of microseconds clock, incremented on timer 1 overflow interrupts.
|
|
t_traceitem * | trace_items |
| | Trace buffer, initialized by NutTraceInit.
|
|
t_traceitem * | trace_current |
| | Pointer to the current item in the trace buffer.
|
|
int | trace_head |
| | Current index in the trace buffer.
|
|
int | trace_size |
| | Size of the trace buffer.
|
|
char | trace_isfull |
| | Flag indicating whether all items in the trace buffer contain valid information.
|
|
char | trace_mode |
| | Current state of the tracing facility.
|
|
char | trace_mask [TRACE_TAG_LAST+1] |
| | Mask to individually disable tracing of specific event types.
|
Define Documentation
| #define TRACE_ADD_ITEM |
( |
TAG, |
|
|
PC |
|
) |
|
|
|
|
Macro to insert an event in the trace buffer
- Parameters:
-
| TAG | Type of event |
| PC | Additional information, depending on the type of event |
|
| #define TRACE_ADD_ITEM_PC |
( |
TAG |
|
) |
|
|
|
|
Macro to insert an event in the trace buffer, filling the additional information field with the program counter (PC)
- Parameters:
-
|
Function Documentation
| void NutTraceClear |
( |
void |
|
) |
|
|
|
|
Clears the trace buffer, but leaves trace_mode unaltered. |
| int NutTraceGetPC |
( |
void |
|
) |
|
|
|
|
Returns the program counter (PC) of the instruction following NutGetPC The .map file of the application can be used to find the actual C Code
WARNING: Most likely only works on AVR. Works by inspecting the stack, thus the function breaks when local variables are introduced in NutGetPC
- Returns:
- int Program counter
|
| int NutTraceInit |
( |
int |
size, |
|
|
char |
mode |
|
) |
|
|
|
|
Initializes the trace buffer and activates tracing. Starts timer 1 for microsecond clock, enables interrupt on overflow
- Parameters:
-
| size | Number of items in the trace buffer |
| mode | Mode of operation
- #TRACE_MODE_CIRCULAR Trace buffer wraps around when full
- #TRACE_MODE_ONESHOT Traceing is stopped when buffer is full
|
- Returns:
- int Status
|
| void NutTraceMaskClear |
( |
int |
tag |
) |
|
|
|
|
Disables tracing of a particular event type
- Parameters:
-
|
| void NutTraceMaskPrint |
( |
void |
|
) |
|
|
|
|
Prints the current state of trace_mask, which for every type of event (TRACE_TAG_XXX) determines, whether they are inserted in the trace buffer or not. |
| void NutTraceMaskSet |
( |
int |
tag |
) |
|
|
|
|
Enables tracing of a particular event type
- Parameters:
-
|
| void NutTracePrint |
( |
int |
size |
) |
|
|
|
|
Prints the current contents of the trace buffer
- Parameters:
-
| size | can be used to limit the number of printed items, if size==0, then all items of the buffer are printed |
|
| int NutTraceRegisterUserTag |
( |
int |
tag, |
|
|
char * |
tag_string |
|
) |
|
|
|
|
Registers a user event type
- Parameters:
-
| tag | of the new event type (e.g. #define TRACE_USER_SEND 0) |
| tag_string | name of the event type used when printing the trace buffer |
|
| void NutTraceStatusPrint |
( |
void |
|
) |
|
|
|
|
Prints current status of tracing facility |
| void NutTraceStop |
( |
void |
|
) |
|
|
|
|
Sets trace_mode to #TRACE_MODE_OFF and thus stop tracing |
| void NutTraceTerminal |
( |
u_char * |
arg |
) |
|
|
|
|
Commands to manipulate the tracing facility
- Parameters:
-
| arg | String containing the commands
- print <size> calls NutPrintTrace
- oneshot restarts tracing in the oneshot mode
- circular restarts tracing in the ciruclar mode
- size <size> restarts tracing in the current mode, using a buffer of length <size>
- stop stops tracing
|
|
|
 |
|