QP/C  7.3.4
Real-Time Embedded Framework
Loading...
Searching...
No Matches
qs.h File Reference

QS/C platform-independent public interface. More...

Go to the source code of this file.

Classes

class  QS
 Software tracing instrumentation, target-resident component (QS namespace emulated as a "class" in C) More...
 
struct  QSpyId
 QS ID type for applying local filtering. More...
 
struct  QS_Filter
 QS type for output filters (global and local) More...
 
struct  QS_TProbe
 QUTest Test-Probe attributes. More...
 
class  QHsmDummy
 Dummy HSM class for testing. More...
 
class  QActiveDummy
 Dummy Active Object for testing. More...
 

Macros

#define QS_INIT(arg_)   (QS_onStartup(arg_))
 
#define QS_EXIT()   (QS_onCleanup())
 
#define QS_OUTPUT()   (QS_output())
 
#define QS_RX_INPUT()   (QS_rx_input())
 
#define QS_GLB_FILTER(rec_)   (QS_glbFilter_((int_fast16_t)(rec_)))
 
#define QS_LOC_FILTER(qsId_)   (QS_locFilter_((int_fast16_t)(qsId_)))
 
#define QS_BEGIN_ID(rec_, qsId_)
 
#define QS_END()
 
#define QS_FLUSH()   (QS_onFlush())
 
#define QS_BEGIN_INCRIT(rec_, qsId_)
 
#define QS_END_INCRIT()
 
#define QS_GLB_CHECK_(rec_)
 
#define QS_LOC_CHECK_(qsId_)
 
#define QS_REC_DONE()   ((void)0)
 
#define QS_I8(width_, data_)
 
#define QS_U8(width_, data_)    (QS_u8_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U8_T, (data_)))
 
#define QS_I16(width_, data_)    (QS_u16_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_I16_T, (data_)))
 
#define QS_U16(width_, data_)    (QS_u16_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U16_T, (data_)))
 
#define QS_I32(width_, data_)    (QS_u32_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_I32_T, (data_)))
 
#define QS_U32(width_, data_)    (QS_u32_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U32_T, (data_)))
 
#define QS_I64(width_, data_)    (QS_u64_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_I64_T, (data_)))
 
#define QS_U64(width_, data_)    (QS_u64_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U64_T, (data_)))
 
#define QS_F32(width_, data_)    (QS_f32_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_F32_T, (data_)))
 
#define QS_F64(width_, data_)    (QS_f64_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_F64_T, (data_)))
 
#define QS_STR(str_)   (QS_str_fmt_((str_)))
 
#define QS_MEM(mem_, size_)   (QS_mem_fmt_((mem_), (size_)))
 
#define QS_ENUM(group_, value_)
 
#define QS_TIME_PRE_()   (QS_u32_raw_(QS_onGetTime()))
 
#define QS_SIG(sig_, obj_)
 
#define QS_SIG_DICTIONARY(sig_, obj_)    (QS_sig_dict_pre_((QSignal)(sig_), (obj_), #sig_))
 
#define QS_OBJ_DICTIONARY(obj_)    (QS_obj_dict_pre_((obj_), #obj_))
 
#define QS_OBJ_ARR_DICTIONARY(obj_, idx_)    (QS_obj_arr_dict_pre_((obj_), (idx_), #obj_))
 
#define QS_FUN_DICTIONARY(fun_)    (QS_fun_dict_pre_((void (*)(void))(fun_), #fun_))
 
#define QS_USR_DICTIONARY(rec_)    (QS_usr_dict_pre_((rec_), #rec_))
 
#define QS_ENUM_DICTIONARY(value_, group_)    (QS_enum_dict_pre_((value_), (group_), #value_))
 
#define QS_RX_PUT(b_)   (QS_rxPut((b_)))
 
#define QS_TR_CRIT_ENTRY()
 
#define QS_TR_CRIT_EXIT()
 
#define QS_TR_ISR_ENTRY(isrnest, prio)
 
#define QS_ONLY(code_)   (code_)
 
#define QS_ASSERTION(module_, id_, delay_)    (QS_assertion_pre_((module_), (id_), (delay_)))
 
#define QS_EOD   ((uint16_t)0xFFFFU)
 
#define QS_CMD   ((uint8_t)7U)
 
#define QS_HEX_FMT   ((uint8_t)0x0FU)
 
#define QS_CRIT_STAT   QF_CRIT_STAT
 
#define QS_CRIT_ENTRY()   QF_CRIT_ENTRY()
 
#define QS_CRIT_EXIT()   QF_CRIT_EXIT()
 
#define QS_MEM_SYS()   QF_MEM_SYS()
 
#define QS_MEM_APP()   QF_MEM_APP()
 
#define QUTEST_ON_POST   124
 
#define QS_TEST_PROBE_DEF(fun_)    uint32_t const qs_tp_ = QS_getTestProbe_((void (*)(void))(fun_));
 
#define QS_TEST_PROBE(code_)    if (qs_tp_ != 0U) { code_ }
 
#define QS_TEST_PROBE_ID(id_, code_)    if (qs_tp_ == (uint32_t)(id_)) { code_ }
 
#define QS_TEST_PAUSE()   (QS_test_pause_())
 

Typedefs

typedef uint32_t QSTimeCtr
 

Enumerations

enum  QS_preType {
  QS_I8_ENUM_T , QS_U8_T , QS_I16_T , QS_U16_T ,
  QS_I32_T , QS_U32_T , QS_F32_T , QS_F64_T ,
  QS_STR_T , QS_MEM_T , QS_SIG_T , QS_OBJ_T ,
  QS_FUN_T , QS_I64_T , QS_U64_T
}
 Enumerates data elements for app-specific trace records. More...
 

Functions

void QS_TR_ISR_EXIT (uint_fast8_t isrnest, uint_fast8_t prio)
 

Detailed Description

QS/C platform-independent public interface.

Traceability

Definition in file qs.h.

Macro Definition Documentation

◆ QS_INIT

#define QS_INIT (   arg_)    (QS_onStartup(arg_))

Definition at line 329 of file qs.h.

◆ QS_EXIT

#define QS_EXIT ( )    (QS_onCleanup())

Definition at line 332 of file qs.h.

◆ QS_OUTPUT

#define QS_OUTPUT ( )    (QS_output())

Definition at line 335 of file qs.h.

◆ QS_RX_INPUT

#define QS_RX_INPUT ( )    (QS_rx_input())

Definition at line 338 of file qs.h.

◆ QS_GLB_FILTER

#define QS_GLB_FILTER (   rec_)    (QS_glbFilter_((int_fast16_t)(rec_)))

Definition at line 341 of file qs.h.

◆ QS_LOC_FILTER

#define QS_LOC_FILTER (   qsId_)    (QS_locFilter_((int_fast16_t)(qsId_)))

Definition at line 344 of file qs.h.

◆ QS_BEGIN_ID

#define QS_BEGIN_ID (   rec_,
  qsId_ 
)
Value:
if (QS_GLB_CHECK_(rec_) && QS_LOC_CHECK_(qsId_)) { \
QS_CRIT_STAT \
QS_CRIT_ENTRY(); \
QS_MEM_SYS(); \
QS_beginRec_((uint_fast8_t)(rec_)); \
QS_TIME_PRE_(); {
#define QS_GLB_CHECK_(rec_)
Definition qs.h:377
#define QS_LOC_CHECK_(qsId_)
Definition qs.h:382

Definition at line 347 of file qs.h.

◆ QS_END

#define QS_END ( )
Value:
} \
QS_endRec_(); \
QS_MEM_APP(); \
QS_CRIT_EXIT(); \
}

Definition at line 356 of file qs.h.

◆ QS_FLUSH

#define QS_FLUSH ( )    (QS_onFlush())

Definition at line 363 of file qs.h.

◆ QS_BEGIN_INCRIT

#define QS_BEGIN_INCRIT (   rec_,
  qsId_ 
)
Value:
if (QS_GLB_CHECK_(rec_) && QS_LOC_CHECK_(qsId_)) { \
QS_beginRec_((uint_fast8_t)(rec_)); \
QS_TIME_PRE_(); {

Definition at line 366 of file qs.h.

◆ QS_END_INCRIT

#define QS_END_INCRIT ( )
Value:
} \
QS_endRec_(); \
}

Definition at line 372 of file qs.h.

◆ QS_GLB_CHECK_

#define QS_GLB_CHECK_ (   rec_)
Value:
(((uint_fast8_t)QS_filt_.glb[(uint_fast8_t)(rec_) >> 3U] \
& ((uint_fast8_t)1U << ((uint_fast8_t)(rec_) & 7U))) != 0U)

Definition at line 377 of file qs.h.

◆ QS_LOC_CHECK_

#define QS_LOC_CHECK_ (   qsId_)
Value:
(((uint_fast8_t)QS_filt_.loc[(uint_fast8_t)(qsId_) >> 3U] \
& ((uint_fast8_t)1U << ((uint_fast8_t)(qsId_) & 7U))) != 0U)

Definition at line 382 of file qs.h.

◆ QS_REC_DONE

#define QS_REC_DONE ( )    ((void)0)

Definition at line 388 of file qs.h.

◆ QS_I8

#define QS_I8 (   width_,
  data_ 
)
Value:
(QS_u8_fmt_((uint8_t)(((width_) << 4U) & 0x7U) | (uint8_t)QS_I8_ENUM_T, \
(data_)))
@ QS_I8_ENUM_T
signed 8-bit integer or enum format
Definition qs.h:656

Definition at line 392 of file qs.h.

◆ QS_U8

#define QS_U8 (   width_,
  data_ 
)     (QS_u8_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U8_T, (data_)))

Definition at line 397 of file qs.h.

◆ QS_I16

#define QS_I16 (   width_,
  data_ 
)     (QS_u16_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_I16_T, (data_)))

Definition at line 401 of file qs.h.

◆ QS_U16

#define QS_U16 (   width_,
  data_ 
)     (QS_u16_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U16_T, (data_)))

Definition at line 405 of file qs.h.

◆ QS_I32

#define QS_I32 (   width_,
  data_ 
)     (QS_u32_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_I32_T, (data_)))

Definition at line 409 of file qs.h.

◆ QS_U32

#define QS_U32 (   width_,
  data_ 
)     (QS_u32_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U32_T, (data_)))

Definition at line 413 of file qs.h.

◆ QS_I64

#define QS_I64 (   width_,
  data_ 
)     (QS_u64_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_I64_T, (data_)))

Definition at line 417 of file qs.h.

◆ QS_U64

#define QS_U64 (   width_,
  data_ 
)     (QS_u64_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U64_T, (data_)))

Definition at line 421 of file qs.h.

◆ QS_F32

#define QS_F32 (   width_,
  data_ 
)     (QS_f32_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_F32_T, (data_)))

Definition at line 425 of file qs.h.

◆ QS_F64

#define QS_F64 (   width_,
  data_ 
)     (QS_f64_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_F64_T, (data_)))

Definition at line 429 of file qs.h.

◆ QS_STR

#define QS_STR (   str_)    (QS_str_fmt_((str_)))

Definition at line 433 of file qs.h.

◆ QS_MEM

#define QS_MEM (   mem_,
  size_ 
)    (QS_mem_fmt_((mem_), (size_)))

Definition at line 436 of file qs.h.

◆ QS_ENUM

#define QS_ENUM (   group_,
  value_ 
)
Value:
(QS_u8_fmt_((uint8_t)(0x80U | ((group_) << 4U)) | (uint8_t)QS_I8_ENUM_T,\
(uint8_t)(value_)))

Definition at line 439 of file qs.h.

◆ QS_TIME_PRE_

#define QS_TIME_PRE_ ( )    (QS_u32_raw_(QS_onGetTime()))

Definition at line 450 of file qs.h.

◆ QS_SIG

#define QS_SIG (   sig_,
  obj_ 
)
Value:
QS_u16_fmt_(QS_SIG_T, (sig_)); \
QS_obj_raw_(obj_)
@ QS_SIG_T
event signal format
Definition qs.h:666

Definition at line 492 of file qs.h.

◆ QS_SIG_DICTIONARY

#define QS_SIG_DICTIONARY (   sig_,
  obj_ 
)     (QS_sig_dict_pre_((QSignal)(sig_), (obj_), #sig_))

Definition at line 505 of file qs.h.

◆ QS_OBJ_DICTIONARY

#define QS_OBJ_DICTIONARY (   obj_)     (QS_obj_dict_pre_((obj_), #obj_))

Definition at line 509 of file qs.h.

◆ QS_OBJ_ARR_DICTIONARY

#define QS_OBJ_ARR_DICTIONARY (   obj_,
  idx_ 
)     (QS_obj_arr_dict_pre_((obj_), (idx_), #obj_))

Definition at line 513 of file qs.h.

◆ QS_FUN_DICTIONARY

#define QS_FUN_DICTIONARY (   fun_)     (QS_fun_dict_pre_((void (*)(void))(fun_), #fun_))

Definition at line 517 of file qs.h.

◆ QS_USR_DICTIONARY

#define QS_USR_DICTIONARY (   rec_)     (QS_usr_dict_pre_((rec_), #rec_))

Definition at line 521 of file qs.h.

◆ QS_ENUM_DICTIONARY

#define QS_ENUM_DICTIONARY (   value_,
  group_ 
)     (QS_enum_dict_pre_((value_), (group_), #value_))

Definition at line 525 of file qs.h.

◆ QS_RX_PUT

#define QS_RX_PUT (   b_)    (QS_rxPut((b_)))

Macro to call QS_rxPut() when Q_SPY is defined (resolves to nothing when Q_SPY is not defined)

Definition at line 529 of file qs.h.

◆ QS_TR_CRIT_ENTRY

#define QS_TR_CRIT_ENTRY ( )

Definition at line 532 of file qs.h.

◆ QS_TR_CRIT_EXIT

#define QS_TR_CRIT_EXIT ( )

Definition at line 535 of file qs.h.

◆ QS_TR_ISR_ENTRY

#define QS_TR_ISR_ENTRY (   isrnest,
  prio 
)
Value:
do { \
QS_BEGIN_PRE_(QS_QF_ISR_ENTRY, 0U) \
QS_TIME_PRE_(); \
QS_2u8_raw_(isrnest, prio); \
QS_END_PRE_() \
}
@ QS_QF_ISR_ENTRY
an ISR was entered
Definition qs.h:136

Definition at line 538 of file qs.h.

◆ QS_ONLY

#define QS_ONLY (   code_)    (code_)

Definition at line 551 of file qs.h.

◆ QS_ASSERTION

#define QS_ASSERTION (   module_,
  id_,
  delay_ 
)     (QS_assertion_pre_((module_), (id_), (delay_)))

Definition at line 554 of file qs.h.

◆ QS_EOD

#define QS_EOD   ((uint16_t)0xFFFFU)

Definition at line 558 of file qs.h.

◆ QS_CMD

#define QS_CMD   ((uint8_t)7U)

Definition at line 561 of file qs.h.

◆ QS_HEX_FMT

#define QS_HEX_FMT   ((uint8_t)0x0FU)

Definition at line 564 of file qs.h.

◆ QS_CRIT_STAT

#define QS_CRIT_STAT   QF_CRIT_STAT

Internal QS macro for defining the critical section status

Definition at line 568 of file qs.h.

◆ QS_CRIT_ENTRY

#define QS_CRIT_ENTRY ( )    QF_CRIT_ENTRY()

Internal macro for entering a critical section

Definition at line 573 of file qs.h.

◆ QS_CRIT_EXIT

#define QS_CRIT_EXIT ( )    QF_CRIT_EXIT()

Internal macro for exiting a critical section

Definition at line 578 of file qs.h.

◆ QS_MEM_SYS

#define QS_MEM_SYS ( )    QF_MEM_SYS()

Internal macro for configuring MPU for System access

Definition at line 583 of file qs.h.

◆ QS_MEM_APP

#define QS_MEM_APP ( )    QF_MEM_APP()

Internal macro for configuring MPU for Application access

Definition at line 588 of file qs.h.

◆ QUTEST_ON_POST

#define QUTEST_ON_POST   124

Definition at line 746 of file qs.h.

◆ QS_TEST_PROBE_DEF

#define QS_TEST_PROBE_DEF (   fun_)     uint32_t const qs_tp_ = QS_getTestProbe_((void (*)(void))(fun_));

QS macro to define the Test-Probe for a given fun_

Traceability

Definition at line 846 of file qs.h.

◆ QS_TEST_PROBE

#define QS_TEST_PROBE (   code_)     if (qs_tp_ != 0U) { code_ }

Definition at line 849 of file qs.h.

◆ QS_TEST_PROBE_ID

#define QS_TEST_PROBE_ID (   id_,
  code_ 
)     if (qs_tp_ == (uint32_t)(id_)) { code_ }

QS_TEST_PROBE QS macro to apply a Test-Probe

Traceability

QS macro to apply a Test-Probe

Definition at line 852 of file qs.h.

◆ QS_TEST_PAUSE

#define QS_TEST_PAUSE ( )    (QS_test_pause_())

QS macro to pause test execution and enter the test event-loop

Definition at line 855 of file qs.h.

Typedef Documentation

◆ QSTimeCtr

typedef uint32_t QSTimeCtr

Definition at line 309 of file qs.h.

Enumeration Type Documentation

◆ QS_preType

enum QS_preType

Enumerates data elements for app-specific trace records.

Enumerator
QS_I8_ENUM_T 

signed 8-bit integer or enum format

QS_U8_T 

unsigned 8-bit integer format

QS_I16_T 

signed 16-bit integer format

QS_U16_T 

unsigned 16-bit integer format

QS_I32_T 

signed 32-bit integer format

QS_U32_T 

unsigned 32-bit integer format

QS_F32_T 

32-bit floating point format

QS_F64_T 

64-bit floating point format

QS_STR_T 

zero-terminated ASCII string format

QS_MEM_T 

up to 255-bytes memory block format

QS_SIG_T 

event signal format

QS_OBJ_T 

object pointer format

QS_FUN_T 

function pointer format

QS_I64_T 

signed 64-bit integer format

QS_U64_T 

unsigned 64-bit integer format

Definition at line 655 of file qs.h.

Function Documentation

◆ QS_TR_ISR_EXIT()

void QS_TR_ISR_EXIT ( uint_fast8_t  isrnest,
uint_fast8_t  prio 
)