RKH

Related to manage a trace session with Trazer application. See the Tracing tool section for more information. More...

Macros

#define RKH_TRC_OPEN()   rkh_trc_open()
 Open the tracing session. More...
 
#define RKH_TRC_CLOSE()   rkh_trc_close()
 Close the tracing session. More...
 
#define RKH_TRC_FLUSH()   rkh_trc_flush()
 Platform-dependent macro flushing the trace stream. More...
 
#define RKH_TRC_SEND_CFG(ts_hz)    RKH_TR_FWK_TCFG(ts_hz)
 Send the trace facility configuration to host application software Trazer. More...
 

Functions

void rkh_trc_open (void)
 Open the tracing session.
 
void rkh_trc_close (void)
 Close the tracing session.
 
void rkh_trc_flush (void)
 Platform-dependent macro flushing the trace stream.
 
RKH_TS_T rkh_trc_getts (void)
 Retrieves a timestamp to be placed in a trace event. More...
 

Detailed Description

Related to manage a trace session with Trazer application. See the Tracing tool section for more information.

Macro Definition Documentation

◆ RKH_TRC_OPEN

#define RKH_TRC_OPEN ( )    rkh_trc_open()

Open the tracing session.

This function is application-specific and the user needs to define it. At a minimum, this function must initialize and/or configure the trace stream by calling rkh_trc_init() and RKH_TRC_SEND_CFG() respectively.

Note
This function is internal to RKH and the user application should not call it. Instead, use RKH_TRC_OPEN() macro.
See also
rkhtrc.h file.
Usage
#define BSP_SIZEOF_TS 32u
#define BSP_TS_RATE_HZ CLOCK_PER_SEC
void
rkh_trc_open( void )
{
FTBIN_OPEN();
TCP_TRACE_OPEN();
RKH_TRC_SEND_CFG( BSP_SIZEOF_TS, BSP_TS_RATE_HZ );
if(( idle_thread = CreateThread( NULL, 1024,
&idle_thread_function, (void *)0,
CREATE_SUSPENDED, NULL )) == (HANDLE)0 )
fprintf( stderr, "Cannot create the thread: [%d]
line from %s "
"file\n", __LINE__, __FILE__ );
}
void rkh_trc_open(void)
Open the tracing session.
#define RKH_TRC_SEND_CFG(ts_hz)
Send the trace facility configuration to host application software Trazer.
Definition: rkhtrc_out.h:221
void rkh_trc_init(void)
Initializes the RKH's trace record service.

Definition at line 107 of file rkhtrc_out.h.

◆ RKH_TRC_CLOSE

#define RKH_TRC_CLOSE ( )    rkh_trc_close()

Close the tracing session.

This function is application-specific and the user needs to define it.

Note
This function is internal to RKH and the user application should not call it. Instead, use RKH_TRC_CLOSE() macro.
See also
rkhtrc.h file.
Usage
void
{
fclose( fdbg );
}
void rkh_trc_close(void)
Close the tracing session.

Definition at line 138 of file rkhtrc_out.h.

◆ RKH_TRC_FLUSH

#define RKH_TRC_FLUSH ( )    rkh_trc_flush()

Platform-dependent macro flushing the trace stream.

This function is application-specific and the user needs to define it. When the RKH trace an event, all the information related to it has to be stored somewhere before it can be retrieved, in order to be analyzed. This place is a trace stream. Frequently, events traced are stored in the stream until it is flushed.

Note
This function is internal to RKH and the user application should not call it. Instead, use RKH_TRC_FLUSH() macro.
See also
rkhtrc.h file.
Usage
void
{
rui8_t *blk;
TRCQTY_T nbytes;
FOREVER
{
nbytes = (TRCQTY_T)1024;
RKH_ENTER_CRITICAL_();
blk = rkh_trc_get_block( &nbytes );
RKH_EXIT_CRITICAL_();
if((blk != (rui8_t *)0))
{
FTBIN_FLUSH( blk, nbytes );
TCP_TRACE_SEND_BLOCK( blk, nbytes );
}
else
break;
}
}
void rkh_trc_flush(void)
Platform-dependent macro flushing the trace stream.
#define RKH_SR_ALLOC()
RKH need to disable interrupts in order to access critical sections of code, and re-enable interrupts...
Definition: rkhitl.h:2051
rui8_t * rkh_trc_get_block(TRCQTY_T *nget)
Retrieves a pointer to a contiguous block of data from the trace stream.

Definition at line 191 of file rkhtrc_out.h.

◆ RKH_TRC_SEND_CFG

#define RKH_TRC_SEND_CFG (   ts_hz)     RKH_TR_FWK_TCFG(ts_hz)

Send the trace facility configuration to host application software Trazer.

Trazer is designed to work with all possible target CPU, which requires a wide range of configurability. For example, for any given target CPU, Trazer must "know" the size of object pointers, event size, timestamp size and so on. This configurations could be provided through "trazer.cfg" file in the host or invoking RKH_TRC_SEND_CFG() macro from the application-specific rkh_trc_open() function.

Parameters
[in]ts_hzclocks per second of trace timestamp.
Note
Frequently, this macro is called from the rkh_trc_open() function, which is provided by user application program, more specifically the board support package (BSP).
See also
RKH_TRC_OPEN() macro.

Definition at line 221 of file rkhtrc_out.h.

Function Documentation

◆ rkh_trc_getts()

RKH_TS_T rkh_trc_getts ( void  )

Retrieves a timestamp to be placed in a trace event.

This function is application-specific and the user needs to define it. The data returned is defined in compile-time by means of RKH_SIZEOF_TSTAMP.

Returns
Timestamp (RKH_TS_T data type).
See also
rkhtrc.h file.
Usage
{
return ( RKH_TS_T )clock();
}
RKH_TS_T rkh_trc_getts(void)
Retrieves a timestamp to be placed in a trace event.
rui32_t RKH_TS_T
Defines the size of trace timestamp.