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

#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
1 #define BSP_SIZEOF_TS 32u
2 #define BSP_TS_RATE_HZ CLOCK_PER_SEC
3 
4 void
5 rkh_trc_open( void )
6 {
7  rkh_trc_init();
8 
9  FTBIN_OPEN();
10  TCP_TRACE_OPEN();
11  RKH_TRC_SEND_CFG( BSP_SIZEOF_TS, BSP_TS_RATE_HZ );
12 
13  if(( idle_thread = CreateThread( NULL, 1024,
14  &idle_thread_function, (void *)0,
15  CREATE_SUSPENDED, NULL )) == (HANDLE)0 )
16  fprintf( stderr, "Cannot create the thread: [%d]
17  line from %s "
18  "file\n", __LINE__, __FILE__ );
19 }

Definition at line 105 of file rkhtrc_out.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
1 void
2 rkh_trc_close( void )
3 {
4  fclose( fdbg );
5 }

Definition at line 136 of file rkhtrc_out.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
1 void
2 rkh_trc_flush( void )
3 {
4  rui8_t *blk;
5  TRCQTY_T nbytes;
6  RKH_SR_ALLOC();
7 
8  FOREVER
9  {
10  nbytes = (TRCQTY_T)1024;
11 
12  RKH_ENTER_CRITICAL_();
13  blk = rkh_trc_get_block( &nbytes );
14  RKH_EXIT_CRITICAL_();
15 
16  if((blk != (rui8_t *)0))
17  {
18  FTBIN_FLUSH( blk, nbytes );
19  TCP_TRACE_SEND_BLOCK( blk, nbytes );
20  }
21  else
22  break;
23  }
24 }

Definition at line 189 of file rkhtrc_out.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 219 of file rkhtrc_out.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
1 RKH_TS_T
2 rkh_trc_getts( void )
3 {
4  return ( RKH_TS_T )clock();
5 }