RKH
rkhtrc_record.h File Reference

Defines the trace records. More...

#include "rkhtrc_stream.h"
Include dependency graph for rkhtrc_record.h:

Go to the source code of this file.

Macros

#define RKH_TR_MP_INIT(memPool_, nBlocks_, blockSize_)
 Initializes the previously allocated memory pool data strcuture RKH_MEMPOOL_T. More...
 
#define RKH_TR_MP_GET(memPool_, nFree_, nMin_)
 Get a memory block from one of the previously allocated memory pool. More...
 
#define RKH_TR_MP_PUT(memPool_, nFree_)
 When the application is done with the memory block, it must be returned to the appropiate memory pool. The block must be allocated from the same memory pool to which it is returned. More...
 
#define RKH_TR_QUE_INIT(queue_, actObj_, nElem_)
 Initializes the previously allocated queue data structure RKH_QUEUE_T. More...
 
#define RKH_TR_QUE_GET(queue_, nElem_)
 Get and remove an element from a queue. More...
 
#define RKH_TR_QUE_FIFO(queue_, nElem_, nMin_)
 Puts an element on a queue in a FIFO manner. The element is queued by reference, not by copy. More...
 
#define RKH_TR_QUE_LIFO(queue_, nElem_, nMin_)
 Puts an element on a queue in a LIFO manner. The element is queued by reference, not by copy. More...
 
#define RKH_TR_QUE_FULL(queue_)
 Queue is full. More...
 
#define RKH_TR_QUE_DPT(queue_)
 Depletes a queue. Empties the contents of the queue and eliminates all stored elements. More...
 
#define RKH_TR_QUE_GET_LAST(queue_)
 Get the last element from the queue. More...
 
#define RKH_TR_SMA_ACT(actObj_, actObjPrio_, actObjQueSize_)
 Initializes and activates a previously created state machine application (SMA) as known as active object. More...
 
#define RKH_TR_SMA_TERM(actObj_, actObjPrio_)
 Terminate a state machine application (SMA) as known as active object. More...
 
#define RKH_TR_SMA_GET(actObj_, evt_, poolID_, refCntr_, nElem_, nMin_)
 Get an event from the active object's queue. More...
 
#define RKH_TR_SMA_FIFO(actObj_, evt_, sender_, poolID_, refCntr_, nElem_, nMin_)
 Send an event to a state machine application (SMA) as known as active object through a queue using the FIFO policy. A message is a pointer size variable and its use is application specific. More...
 
#define RKH_TR_SMA_LIFO(actObj_, evt_, sender_, poolID_, refCntr_, nElem_, nMin_)
 Send an event to a state machine application (SMA) as known as active object through a queue using the LIFO policy. A message is a pointer size variable and its use is application specific. More...
 
#define RKH_TR_SMA_REG(actObj_, actObjPrio_)
 Registers a state machine application (SMA) as known as active object into the framework, which implies to store a pointer to the SMA in the priority table. More...
 
#define RKH_TR_SMA_UNREG(actObj_, actObjPrio_)
 Removes the SMA as known as active object from the priority table, and thus from the framework, by simply replacing the link to the SMA being deleted with a NULL pointer. More...
 
#define RKH_TR_SMA_DEFER(queue_, evt_)
 Defer an event to a given separate event queue. More...
 
#define RKH_TR_SMA_RCALL(actObj_, evt_)
 Recall a deferred event from a given event queue. More...
 
#define RKH_TR_SM_INIT(actObj_, initState_)
 Inits a previously created state machine calling its initializing action. More...
 
#define RKH_TR_SM_CLRH(actObj_, history_)
 Erase the history of a state. It can be a shallow or deep history. More...
 
#define RKH_TR_SM_DCH(actObj_, evt_, state_)
 Executes a state machine in a run-to-completation (RTC) model. More...
 
#define RKH_TR_SM_TRN(actObj_, sourceState_, targetState_)
 Source and target state of the transition. The target could be either basic state, composite state or pseudostate. More...
 
#define RKH_TR_SM_STATE(actObj_, state_)
 Legal, stable and final state of transition. More...
 
#define RKH_TR_SM_ENSTATE(actObj_, state_)
 Entered state. More...
 
#define RKH_TR_SM_EXSTATE(actObj_, state_)
 Exited state. More...
 
#define RKH_TR_SM_NENEX(actObj_, nEnState_, nExState_)
 Number of entry and exit states in transition. More...
 
#define RKH_TR_SM_NTRNACT(actObj_, nta, nts)
 Number of executed actions and segments of the transition. More...
 
#define RKH_TR_SM_TS_STATE(actObj_, state_)
 Destination state or pseudostate of a transition segment. More...
 
#define RKH_TR_SM_EVT_PROC(actObj_)
 The arrived event was succesfully processed and HSM resides in an allowed state. More...
 
#define RKH_TR_SM_EVT_NFOUND(actObj_, evt_)
 The arrived event was't founded in the transition table. More...
 
#define RKH_TR_SM_GRD_FALSE(actObj_)
 The transition was cancelled by guard function. More...
 
#define RKH_TR_SM_CND_NFOUND(actObj_)
 The branch function returned a value not founded in the branch table. More...
 
#define RKH_TR_SM_UNKN_STATE(actObj_)
 Unknown state. More...
 
#define RKH_TR_SM_EX_HLEVEL(actObj_)
 The transition exceeded the allowed hierarchical level. More...
 
#define RKH_TR_SM_EX_TSEG(actObj_)
 The transition exceeded the allowed number of segments within a compound transtion. More...
 
#define RKH_TR_SM_EXE_ACT(actionType_, actObj_, state_, action_)
 Executes a behavior (action) of state machine, it could be an entry, exit, effect, init, preprocessor or guard. More...
 
#define RKH_TR_TMR_INIT(timer_, signal_)
 Initializes the previously allocated timer structure RKH_TMR_T. More...
 
#define RKH_TR_TMR_START(timer_, actObj_, nTicks_, period_)
 Start a timer. More...
 
#define RKH_TR_TMR_STOP(timer_, nTicks_, period_)
 Stops a running timer. More...
 
#define RKH_TR_TMR_TOUT(timer_, signal_, actObj_)
 Timer expired. More...
 
#define RKH_TR_TMR_REM(timer_)
 Removes timer from the active timer list. More...
 
#define RKH_TR_FWK_EN()
 Initializes the RKH framework. More...
 
#define RKH_TR_FWK_EX()
 Exit the RKH framework. More...
 
#define RKH_TR_FWK_EPREG(evtPool_, storageSize_, evtSize_, poolSize_)
 Registers a new event pool into the event pool list. More...
 
#define RKH_TR_FWK_AE(evtSize_, evt_, nUsed_, nMin_, sender_)
 Allocates an event from the previously created event pool. More...
 
#define RKH_TR_FWK_GC(evt_, poolID_, refCnt_)
 Attempt to recycle an event. More...
 
#define RKH_TR_FWK_GCR(evt_, nUsed_, nMin_, sender_)
 Effective recycling event. More...
 
#define RKH_TR_FWK_OBJ(obj_)
 Entry symbol table for memory object. More...
 
#define RKH_TR_FWK_OBJ_NAME(obj_, name_)
 Entry symbol table for memory object. Very similar to RKH_TR_FWK_OBJ() but the name of object must be explicitely defined. More...
 
#define RKH_TR_FWK_SIG(stateObj_)
 Entry symbol table for event signal. More...
 
#define RKH_TR_FWK_FUN(function_)
 Entry symbol table for function object. More...
 
#define RKH_TR_FWK_EXE_FUN(function_)
 The function was executed. More...
 
#define RKH_TR_FWK_SYNC_EVT(function_, senderObj_, receiverObj_)
 The function was synchronously executed. It is not explicitely used by the RKH, instead it's frequently placed on application source code. More...
 
#define RKH_TR_FWK_TUSR(__e)
 Entry symbol table for user-defined trace events. More...
 
#define RKH_TR_FWK_TCFG(timeStamp_)
 Send trace configuration to Trazer. More...
 
#define RKH_TR_FWK_ASSERT(mod_, ln_)
 Assertion expression was evaluated to false. More...
 
#define RKH_TR_FWK_AO(actObj_)
 Entry symbol table for active object. More...
 
#define RKH_TR_FWK_STATE(actObj_, stateObj_)
 Entry symbol table for state object. More...
 
#define RKH_TR_FWK_PSTATE(actObj_, pseudoStObj_)
 Entry symbol table for pseudostate object. More...
 
#define RKH_TR_FWK_TIMER(timerObj_)
 Entry symbol table for timer object. More...
 
#define RKH_TR_FWK_EPOOL(poolId_, poolName_)
 Entry symbol table for event pool object. More...
 
#define RKH_TR_FWK_QUEUE(queueObj_)
 Entry symbol table for queue object. More...
 
#define RKH_TR_FWK_ACTOR(actorObj_, nm_)
 Entry symbol table for actor object. More...
 

Functions

void rkh_trc_init (void)
 Initializes the RKH's trace record service. More...
 
void rkh_trc_begin (RKH_TE_ID_T eid)
 Store the trace record header in the stream. More...
 
void rkh_trc_end (void)
 Terminate the recorded trace event. More...
 
void rkh_trc_clear_chk (void)
 Clear to zero the trace record checksum. More...
 
void rkh_trc_u8 (rui8_t d)
 Store a 8-bit data into the current trace event buffer without format information. More...
 
void rkh_trc_u16 (rui16_t d)
 Store a 16-bit data into the current trace event buffer without format information. More...
 
void rkh_trc_u32 (rui32_t d)
 Store a 32-bit data into the current trace event buffer without format information. More...
 
void rkh_trc_str (const char *s)
 Store a string terminated in '\0' into the current trace event buffer without format information. More...
 
void rkh_trc_obj (RKH_TE_ID_T tre, rui8_t *obj, const char *obj_name)
 Output object symbol record. More...
 
void rkh_trc_sig (RKH_SIG_T sig, const char *sig_name)
 Output signal symbol record. More...
 
void rkh_trc_ao (void *ao)
 Output active object (AO) symbol record. More...
 
void rkh_trc_state (void *ao, rui8_t *state)
 Output state symbol record. More...
 
void rkh_trc_fmt_u8 (rui8_t fmt, rui8_t d)
 Store a 8-bit data into the current trace event buffer with format information. More...
 
void rkh_trc_fmt_u16 (rui8_t fmt, rui16_t d)
 Store a 16-bit data into the current trace event buffer with format information. More...
 
void rkh_trc_fmt_u32 (rui8_t fmt, rui32_t d)
 Store a 32-bit data into the current trace event buffer with format information. More...
 
void rkh_trc_fmt_str (const char *s)
 Store a string terminated in '\0' into the current trace event buffer with format information. More...
 
void rkh_trc_fmt_mem (rui8_t const *mem, rui8_t size)
 Output memory block of up to 255-bytes with format information. More...
 

Detailed Description

Defines the trace records.

Definition in file rkhtrc_record.h.

Function Documentation

◆ rkh_trc_init()

void rkh_trc_init ( void  )

Initializes the RKH's trace record service.

Note
rkh_trc_init() is NOT protected with a critical section.

◆ rkh_trc_begin()

void rkh_trc_begin ( RKH_TE_ID_T  eid)

Store the trace record header in the stream.

  • Trace event ID [n-bytes]. The number of bytes that it uses is specified by the size of RKH_TE_ID_T data type.
  • Sequence number [1-byte]. If the RKH_CFG_TRC_NSEQ_EN is set to 1 then RKH will add to the trace record an incremental number (1-byte), used like a sequence number.
  • Timestamp [1, 2 or 4 bytes]. If the RKH_CFG_TRC_TSTAMP_EN is set to 1 then RKH will add to the trace record a timestamp field. It's configurable by means of RKH_CFGPORT_TRC_SIZEOF_TSTAMP.
Parameters
[in]eidtrace event ID. The available events are enumerated in RKH_TE_<group>_<event> definitions.
Note
This function should be called indirectly through the macro RKH_TRC_BEGIN.

◆ rkh_trc_end()

void rkh_trc_end ( void  )

Terminate the recorded trace event.

This function inserts a the flag byte, which delimits the frame. The flag is the 0x7E.

Note
This function should be called indirectly through the macro RKH_TRC_END.

◆ rkh_trc_clear_chk()

void rkh_trc_clear_chk ( void  )

Clear to zero the trace record checksum.

Note
This function should be called indirectly through the macro RKH_TRC_BEGIN_DFT().

◆ rkh_trc_u8()

void rkh_trc_u8 ( rui8_t  d)

Store a 8-bit data into the current trace event buffer without format information.

Parameters
[in]ddata

◆ rkh_trc_u16()

void rkh_trc_u16 ( rui16_t  d)

Store a 16-bit data into the current trace event buffer without format information.

Parameters
[in]ddata

◆ rkh_trc_u32()

void rkh_trc_u32 ( rui32_t  d)

Store a 32-bit data into the current trace event buffer without format information.

Parameters
[in]ddata

◆ rkh_trc_str()

void rkh_trc_str ( const char *  s)

Store a string terminated in '\0' into the current trace event buffer without format information.

Parameters
[in]spointer to string treminated in '\0'

◆ rkh_trc_obj()

void rkh_trc_obj ( RKH_TE_ID_T  tre,
rui8_t *  obj,
const char *  obj_name 
)

Output object symbol record.

Parameters
[in]tretrace event ID. The available events are enumerated in RKH_TE_<group>_<event> definitions.
[in]objaddress of the object in memory.
[in]obj_namestring terminated in '\0'.
Note
This function is internal to RKH and the user application should not call it.

◆ rkh_trc_sig()

void rkh_trc_sig ( RKH_SIG_T  sig,
const char *  sig_name 
)

Output signal symbol record.

Parameters
[in]sigsignal number.
[in]sig_namestring terminated in '\0'.
Note
This function is internal to RKH and the user application should not call it.

◆ rkh_trc_ao()

void rkh_trc_ao ( void *  ao)

Output active object (AO) symbol record.

Parameters
[in]aoaddress of active object symbol.
Note
This function is internal to RKH and the user application should not call it.

◆ rkh_trc_state()

void rkh_trc_state ( void *  ao,
rui8_t *  state 
)

Output state symbol record.

Parameters
[in]aoaddress of active object symbol.
[in]stateaddress of state symbol.
Note
This function is internal to RKH and the user application should not call it.

◆ rkh_trc_fmt_u8()

void rkh_trc_fmt_u8 ( rui8_t  fmt,
rui8_t  d 
)

Store a 8-bit data into the current trace event buffer with format information.

Parameters
[in]fmtformat information
[in]ddata

◆ rkh_trc_fmt_u16()

void rkh_trc_fmt_u16 ( rui8_t  fmt,
rui16_t  d 
)

Store a 16-bit data into the current trace event buffer with format information.

Parameters
[in]fmtformat information
[in]ddata

◆ rkh_trc_fmt_u32()

void rkh_trc_fmt_u32 ( rui8_t  fmt,
rui32_t  d 
)

Store a 32-bit data into the current trace event buffer with format information.

Parameters
[in]fmtformat information
[in]ddata

◆ rkh_trc_fmt_str()

void rkh_trc_fmt_str ( const char *  s)

Store a string terminated in '\0' into the current trace event buffer with format information.

Parameters
[in]spointer to string terminated in '\0'

◆ rkh_trc_fmt_mem()

void rkh_trc_fmt_mem ( rui8_t const *  mem,
rui8_t  size 
)

Output memory block of up to 255-bytes with format information.

Parameters
[in]mempointer to memory block.
[in]sizesize of memory block.