RKH
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Trace

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

#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__ );
}

Definition at line 2683 of file rkh.h.

#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 );
}

Definition at line 2714 of file rkh.h.

#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;
RKH_SR_ALLOC();
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;
}
}

Definition at line 2767 of file rkh.h.

#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 2797 of file rkh.h.

Function Documentation

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();
}