QP/C 8.1.2
Real-Time Event Framework
Loading...
Searching...
No Matches
qs_pkg.h File Reference

QS (QP/Spy software tracing) internal (package-scope) interface. More...

Go to the source code of this file.

Macros

#define QS_BEGIN_PRE(rec_, qsId_)
 Pre-formatted QS trace record begin.
#define QS_END_PRE()
 Pre-formatted QS trace record end.
#define QS_U8_PRE(data_)
 Output pre-formatted unsigned 8-bit integer data element.
#define QS_2U8_PRE(data1_, data2_)
 Output two pre-formatted unsigned 8-bit integer data elements.
#define QS_U16_PRE(data_)
 Output pre-formatted unsigned 16-bit integer data element.
#define QS_U32_PRE(data_)
 Output pre-formatted unsigned 32-bit integer data element.
#define QS_STR_PRE(msg_)
 Output pre-formatted string data element.
#define QS_OBJ_PRE(obj_)
 Output pre-formatted object pointer element.
#define QS_SIG_PRE(sig_)
 Output pre-formatted event signal data element.
#define QS_FUN_PRE(fun_)
 Output pre-formatted function pointer element.
#define QS_EQC_PRE(ctr_)
 Output pre-formatted event queue counter data element.
#define QS_EVS_PRE(size_)
 Output pre-formatted event queue size data element.
#define QS_MPS_PRE(size_)
 Output pre-formatted memory pool size data element.
#define QS_MPC_PRE(ctr_)
 Output pre-formatted memory pool counter data element.
#define QS_TEC_PRE(ctr_)
 Output pre-formatted time event counter data element.
#define QS_FRAME   ((uint8_t)0x7EU)
#define QS_ESC   ((uint8_t)0x7DU)
#define QS_ESC_XOR   ((uint8_t)0x20U)
#define QS_GOOD_CHKSUM   ((uint8_t)0xFFU)
#define QS_INSERT_BYTE_(b_)
 Internal macro to insert a byte into the QS-TX trace buffer.
#define QS_INSERT_ESC_BYTE_(b_)
 Internal macro to insert a byte with escaping into the QS-TX trace buffer.
#define QS_PTR2UNIT_CAST(T_, ptr_)

Enumerations

enum  QS_RxRecords {
  QS_RX_INFO , QS_RX_COMMAND , QS_RX_RESET , QS_RX_TICK ,
  QS_RX_PEEK , QS_RX_POKE , QS_RX_FILL , QS_RX_TEST_SETUP ,
  QS_RX_TEST_TEARDOWN , QS_RX_TEST_PROBE , QS_RX_GLB_FILTER , QS_RX_LOC_FILTER ,
  QS_RX_AO_FILTER , QS_RX_CURR_OBJ , QS_RX_TEST_CONTINUE , QS_RX_QUERY_CURR ,
  QS_RX_EVENT
}
 QS received record types (RX channel). More...

Detailed Description

QS (QP/Spy software tracing) internal (package-scope) interface.

Definition in file qs_pkg.h.

Macro Definition Documentation

◆ QS_BEGIN_PRE

#define QS_BEGIN_PRE ( rec_,
qsId_ )
Value:
if (QS_fltCheck_((uint32_t)(rec_)>>5U, \
(uint32_t)1U << ((uint32_t)(rec_) & 0x1FU), (qsId_))) \
{ \
QS_beginRec_((uint_fast8_t)(rec_));

Pre-formatted QS trace record begin.

Parameters
[in]rec_pre-defined record number from the enumeration QP::QS_GlbPredef. The record number is subject to the QS global filter (see QS_GLB_FILTER())
[in]qsId_QS-id in the range 1..127 that will be subject to the QS local filter (see QS_LOC_FILTER())

Example

. . .
QS_BEGIN_PRE(QS_QF_PUBLISH, qsId) // <===
QS_TIME_PRE(); // the timestamp
QS_OBJ_PRE(sender); // the sender object
QS_SIG_PRE(sig); // the signal of the event
QS_2U8_PRE(e->poolNum_, e->refCtr_);
. . .
#define QS_TIME_PRE()
Definition qs.h:340
@ QS_QF_PUBLISH
an event was published to active objects
Definition qs.h:90
#define QS_OBJ_PRE(obj_)
Output pre-formatted object pointer element.
Definition qs_pkg.h:46
#define QS_SIG_PRE(sig_)
Output pre-formatted event signal data element.
Definition qs_pkg.h:47
#define QS_2U8_PRE(data1_, data2_)
Output two pre-formatted unsigned 8-bit integer data elements.
Definition qs_pkg.h:41
#define QS_END_PRE()
Pre-formatted QS trace record end.
Definition qs_pkg.h:38

Forward Traceability

  • DVR_QS_MC5_D4_9A: Directive 4.9(Advisory): A function should be used in preference to a function-like macro where they are interchangeable (FALSE-POSITIVE diagnosis)
  • DVR_QS_MC5_R14_3: Rule 14.3(Required): Controlling expressions shall not be invariant
  • DVR_QS_PCLP_506: PCLP-506: Constant value used in Boolean context (left operand to || operator)
  • DVR_QS_PCLP_572: PCLP-572: Excessive shift value (precision 0 shifted right
  • DVR_QS_PCLP_778: PCLP-778: Constant expression evaluates to 0 in binary operation >>
  • DVR_QS_PCLP_823: PCLP-823: Definition of macro ends in semicolon
  • DVR_QS_PCLP_845: PCLP-845: The right operand to << always evaluates to 0

Definition at line 32 of file qs_pkg.h.

◆ QS_END_PRE

#define QS_END_PRE ( )
Value:
QS_endRec_(); }

Pre-formatted QS trace record end.

Example

. . .
QS_BEGIN_PRE(QS_QF_PUBLISH, qsId)
QS_OBJ_PRE(sender);
QS_SIG_PRE(sig);
QS_2U8_PRE(e->poolNum_, e->refCtr_);
QS_END_PRE() // <===
. . .

Forward Traceability

  • DVR_QS_MC5_D4_9A: Directive 4.9(Advisory): A function should be used in preference to a function-like macro where they are interchangeable (FALSE-POSITIVE diagnosis)

Definition at line 38 of file qs_pkg.h.

◆ QS_U8_PRE

#define QS_U8_PRE ( data_)
Value:
(QS_u8_raw_((uint8_t)(data_)))

Output pre-formatted unsigned 8-bit integer data element.

Parameters
[in]data_unsigned 8-bit integer data element to output

Example

. . .
QS_BEGIN_PRE(QS_QF_TIMEEVT_ARM,
static_cast<QActive const *>(m_act)->m_prio)
QS_OBJ_PRE(this);
QS_OBJ_PRE(m_act);
QS_TEC_PRE(nTicks);
QS_TEC_PRE(interval);
QS_U8_PRE(tickRate); // <===
. . .
@ QS_QF_TIMEEVT_ARM
a time event was armed
Definition qs.h:98
#define QS_TEC_PRE(ctr_)
Output pre-formatted time event counter data element.
Definition qs_pkg.h:97
#define QS_U8_PRE(data_)
Output pre-formatted unsigned 8-bit integer data element.
Definition qs_pkg.h:40
Active object class (based on the QHsm implementation strategy).
Definition qp.h:447

Forward Traceability

  • DVR_QS_MC5_D4_9A: Directive 4.9(Advisory): A function should be used in preference to a function-like macro where they are interchangeable (FALSE-POSITIVE diagnosis)

Definition at line 40 of file qs_pkg.h.

◆ QS_2U8_PRE

#define QS_2U8_PRE ( data1_,
data2_ )
Value:
(QS_2u8_raw_((uint8_t)(data1_), (uint8_t)(data2_)))

Output two pre-formatted unsigned 8-bit integer data elements.

Parameters
[in]data1_first unsigned 8-bit integer data element to output
[in]data2_second unsigned 8-bit integer data element to output

Example

. . .
QS_BEGIN_PRE(QS_QF_PUBLISH, qsId)
QS_OBJ_PRE(sender);
QS_SIG_PRE(sig);
QS_2U8_PRE(e->poolNum_, e->refCtr_); // <===
. . .

Forward Traceability

  • DVR_QS_MC5_D4_9A: Directive 4.9(Advisory): A function should be used in preference to a function-like macro where they are interchangeable (FALSE-POSITIVE diagnosis)

Definition at line 41 of file qs_pkg.h.

◆ QS_U16_PRE

#define QS_U16_PRE ( data_)
Value:
(QS_u16_raw_((uint16_t)(data_)))

Output pre-formatted unsigned 16-bit integer data element.

Parameters
[in]data_unsigned 16-bit integer data element to output

Example

. . .
QS_BEGIN_PRE(QS_QF_PUBLISH, qsId)
QS_U16_PRE(QP::QS::rxPriv_.var.ppf.offs); // <===
QS_U8_PRE(QP::QS::rxPriv_.var.ppf.size);
QS_U8_PRE(QP::QS::rxPriv_.var.ppf.num);
. . .
#define QS_U16_PRE(data_)
Output pre-formatted unsigned 16-bit integer data element.
Definition qs_pkg.h:43

Forward Traceability

  • DVR_QS_MC5_D4_9A: Directive 4.9(Advisory): A function should be used in preference to a function-like macro where they are interchangeable (FALSE-POSITIVE diagnosis)

Definition at line 43 of file qs_pkg.h.

◆ QS_U32_PRE

#define QS_U32_PRE ( data_)
Value:
(QS_u32_raw_((uint32_t)(data_)))

Output pre-formatted unsigned 32-bit integer data element.

Parameters
[in]data_unsigned 32-bit integer data element to output

Example

. . .
QS_BEGIN_PRE(QS_QF_PUBLISH, qsId)
QS_FUN_PRE(api);
QS_U32_PRE(data); // <===
. . .
#define QS_U32_PRE(data_)
Output pre-formatted unsigned 32-bit integer data element.
Definition qs_pkg.h:44
#define QS_FUN_PRE(fun_)
Output pre-formatted function pointer element.
Definition qs_pkg.h:52

Forward Traceability

  • DVR_QS_MC5_D4_9A: Directive 4.9(Advisory): A function should be used in preference to a function-like macro where they are interchangeable (FALSE-POSITIVE diagnosis)

Definition at line 44 of file qs_pkg.h.

◆ QS_STR_PRE

#define QS_STR_PRE ( msg_)
Value:
(QS_str_raw_((msg_)))

Output pre-formatted string data element.

Parameters
[in]msg_zero-terminated ASCII string to output

Example

. . .
QS_BEGIN_PRE(QS_OBJ_DICT, qsId)
QS_OBJ_PRE(&rxPriv_);
QS_STR_PRE("QS_RX"); // <===
. . .
@ QS_OBJ_DICT
object dictionary entry
Definition qs.h:143
#define QS_STR_PRE(msg_)
Output pre-formatted string data element.
Definition qs_pkg.h:45

Forward Traceability

  • DVR_QS_MC5_D4_9A: Directive 4.9(Advisory): A function should be used in preference to a function-like macro where they are interchangeable (FALSE-POSITIVE diagnosis)

Definition at line 45 of file qs_pkg.h.

◆ QS_OBJ_PRE

#define QS_OBJ_PRE ( obj_)
Value:
(QS_obj_raw_(obj_))

Output pre-formatted object pointer element.

Parameters
[in]obj_object pointer to output

Forward Traceability

  • DVR_QS_MC5_D4_9A: Directive 4.9(Advisory): A function should be used in preference to a function-like macro where they are interchangeable (FALSE-POSITIVE diagnosis)
  • DVR_QS_MC5_R11_4: Rule 11.4(Advisory): A conversion should not be performed between a pointer to an object and an integer type
  • DVR_QS_MC5_R11_6: Rule 11.6(Required): A cast shall not be performed between a pointer to void and an arithmetic type

Definition at line 46 of file qs_pkg.h.

◆ QS_SIG_PRE

#define QS_SIG_PRE ( sig_)
Value:
(QS_u16_raw_((uint16_t)(sig_)))

Output pre-formatted event signal data element.

Parameters
[in]sig_event signal (16-bit) to output

Forward Traceability

  • DVR_QS_MC5_D4_9A: Directive 4.9(Advisory): A function should be used in preference to a function-like macro where they are interchangeable (FALSE-POSITIVE diagnosis)

Definition at line 47 of file qs_pkg.h.

◆ QS_FUN_PRE

#define QS_FUN_PRE ( fun_)
Value:
(QS_u32_raw_((uint32_t)(fun_)))

Output pre-formatted function pointer element.

Parameters
[in]fun_function pointer to output

Forward Traceability

  • DVR_QS_MC5_D4_9A: Directive 4.9(Advisory): A function should be used in preference to a function-like macro where they are interchangeable (FALSE-POSITIVE diagnosis)
  • DVR_QS_MC5_R11_4: Rule 11.4(Advisory): A conversion should not be performed between a pointer to an object and an integer type
  • DVR_QS_MC5_R11_6: Rule 11.6(Required): A cast shall not be performed between a pointer to void and an arithmetic type

Definition at line 52 of file qs_pkg.h.

◆ QS_EQC_PRE

#define QS_EQC_PRE ( ctr_)
Value:
QS_u16_raw_((uint16_t)(ctr_))

Output pre-formatted event queue counter data element.

Parameters
[in]ctr_event queue counter to output

Forward Traceability

  • DVR_QS_MC5_D4_9A: Directive 4.9(Advisory): A function should be used in preference to a function-like macro where they are interchangeable (FALSE-POSITIVE diagnosis)

Definition at line 63 of file qs_pkg.h.

◆ QS_EVS_PRE

#define QS_EVS_PRE ( size_)
Value:
QS_u16_raw_((uint16_t)(size_))

Output pre-formatted event queue size data element.

Parameters
[in]size_event queue size to output

Forward Traceability

  • DVR_QS_MC5_D4_9A: Directive 4.9(Advisory): A function should be used in preference to a function-like macro where they are interchangeable (FALSE-POSITIVE diagnosis)

Definition at line 71 of file qs_pkg.h.

◆ QS_MPS_PRE

#define QS_MPS_PRE ( size_)
Value:
QS_u16_raw_((uint16_t)(size_))

Output pre-formatted memory pool size data element.

Parameters
[in]size_memory pool size to output

Forward Traceability

  • DVR_QS_MC5_D4_9A: Directive 4.9(Advisory): A function should be used in preference to a function-like macro where they are interchangeable (FALSE-POSITIVE diagnosis)

Definition at line 79 of file qs_pkg.h.

◆ QS_MPC_PRE

#define QS_MPC_PRE ( ctr_)
Value:
QS_u16_raw_((uint16_t)(ctr_))

Output pre-formatted memory pool counter data element.

Parameters
[in]ctr_memory pool counter to output

Forward Traceability

  • DVR_QS_MC5_D4_9A: Directive 4.9(Advisory): A function should be used in preference to a function-like macro where they are interchangeable (FALSE-POSITIVE diagnosis)

Definition at line 87 of file qs_pkg.h.

◆ QS_TEC_PRE

#define QS_TEC_PRE ( ctr_)
Value:
QS_u32_raw_((uint32_t)(ctr_))

Output pre-formatted time event counter data element.

Parameters
[in]ctr_time event counter to output

Forward Traceability

  • DVR_QS_MC5_D4_9A: Directive 4.9(Advisory): A function should be used in preference to a function-like macro where they are interchangeable (FALSE-POSITIVE diagnosis)

Definition at line 97 of file qs_pkg.h.

◆ QS_FRAME

#define QS_FRAME   ((uint8_t)0x7EU)

Definition at line 122 of file qs_pkg.h.

◆ QS_ESC

#define QS_ESC   ((uint8_t)0x7DU)

Definition at line 123 of file qs_pkg.h.

◆ QS_ESC_XOR

#define QS_ESC_XOR   ((uint8_t)0x20U)

Definition at line 124 of file qs_pkg.h.

◆ QS_GOOD_CHKSUM

#define QS_GOOD_CHKSUM   ((uint8_t)0xFFU)

Definition at line 125 of file qs_pkg.h.

◆ QS_INSERT_BYTE_

#define QS_INSERT_BYTE_ ( b_)
Value:
buf[head] = (b_); \
++head; \
if (head == end) { \
head = 0U; \
}

Internal macro to insert a byte into the QS-TX trace buffer.

Parameters
[in]b_byte to insert into the buffer

Details
The byte is assumed not to need escaping, i.e. must be different from QS_FRAME and QS_ESC. The macro updates the head-index and the checksum of the QS-TX.

Forward Traceability

  • DVR_QS_MC5_D4_9A: Directive 4.9(Advisory): A function should be used in preference to a function-like macro where they are interchangeable (FALSE-POSITIVE diagnosis)

Definition at line 128 of file qs_pkg.h.

◆ QS_INSERT_ESC_BYTE_

#define QS_INSERT_ESC_BYTE_ ( b_)
Value:
chksum = (uint8_t)(chksum + (b_)); \
if (((b_) != QS_FRAME) && ((b_) != QS_ESC)) { \
QS_INSERT_BYTE_(b_) \
} \
else { \
QS_INSERT_BYTE_(QS_ESC) \
QS_INSERT_BYTE_((uint8_t)((b_) ^ QS_ESC_XOR)) \
++QS_priv_.used; \
}
Private attributes of the QS software tracing target-resident component (TX channel).
#define QS_ESC
Definition qs_pkg.h:123
#define QS_ESC_XOR
Definition qs_pkg.h:124
#define QS_FRAME
Definition qs_pkg.h:122

Internal macro to insert a byte with escaping into the QS-TX trace buffer.

Parameters
[in]b_byte to insert into the buffer

Details
The byte is checked for needing escaping and is escaped if needed. The macro updates the head-index and the checksum of the QS-TX.

Forward Traceability

  • DVR_QS_MC5_D4_9A: Directive 4.9(Advisory): A function should be used in preference to a function-like macro where they are interchangeable (FALSE-POSITIVE diagnosis)

Definition at line 135 of file qs_pkg.h.

◆ QS_PTR2UNIT_CAST

#define QS_PTR2UNIT_CAST ( T_,
ptr_ )
Value:
((T_)(ptr_))

Definition at line 146 of file qs_pkg.h.

Enumeration Type Documentation

◆ QS_RxRecords

QS received record types (RX channel).

Enumerator
QS_RX_INFO 

query Target info (ver, config, tstamp)

QS_RX_COMMAND 

execute a user-defined command in the Target

QS_RX_RESET 

reset the Target

QS_RX_TICK 

call system clock tick in the Target

QS_RX_PEEK 

peek Target memory

QS_RX_POKE 

poke Target memory

QS_RX_FILL 

fill Target memory

QS_RX_TEST_SETUP 

test setup

QS_RX_TEST_TEARDOWN 

test teardown

QS_RX_TEST_PROBE 

set a Test-Probe in the Target

QS_RX_GLB_FILTER 

set global filters in the Target

QS_RX_LOC_FILTER 

set local filters in the Target

QS_RX_AO_FILTER 

set local AO filter in the Target

QS_RX_CURR_OBJ 

set the "current-object" in the Target

QS_RX_TEST_CONTINUE 

continue a test after QS_TEST_PAUSE()

QS_RX_QUERY_CURR 

query the "current object" in the Target

QS_RX_EVENT 

inject an event to the Target

Definition at line 102 of file qs_pkg.h.