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

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

Go to the source code of this file.

Namespaces

namespace  QP
 QP/C++ Framework namespace.

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_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.

Enumerations

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

Variables

constexpr std::uint8_t QP::QS_FRAME {0x7EU}
constexpr std::uint8_t QP::QS_ESC {0x7DU}
constexpr std::uint8_t QP::QS_ESC_XOR {0x20U}
constexpr std::uint8_t QP::QS_GOOD_CHKSUM {0xFFU}

Detailed Description

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

Definition in file qs_pkg.hpp.

Macro Definition Documentation

◆ QS_BEGIN_PRE

#define QS_BEGIN_PRE ( rec_,
qsId_ )
Value:
if (QP::QS::fltCheck_(static_cast<std::uint32_t>(rec_) >> 5U, \
1U << (static_cast<std::uint32_t>(rec_) & 0x1FU), (qsId_))) \
{ \
QP::QS::beginRec_(static_cast<std::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.hpp:362
#define QS_OBJ_PRE(obj_)
Output pre-formatted object pointer element.
Definition qs_pkg.hpp:91
#define QS_SIG_PRE(sig_)
Output pre-formatted event signal data element.
Definition qs_pkg.hpp:92
#define QS_2U8_PRE(data1_, data2_)
Output two pre-formatted unsigned 8-bit integer data elements.
Definition qs_pkg.hpp:83
#define QS_END_PRE()
Pre-formatted QS trace record end.
Definition qs_pkg.hpp:79

Forward Traceability

  • DVR_QS_MP2_R19_0_2: Rule 19.0.2(Required): Function-like macros shall not be defined
  • 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_774: PCLP-774 boolean condition for 'if' always evaluates to 'false'
  • 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: right operand to << always evaluates to 0

Definition at line 73 of file qs_pkg.hpp.

◆ QS_END_PRE

#define QS_END_PRE ( )
Value:
QP::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_MP2_R19_0_2: Rule 19.0.2(Required): Function-like macros shall not be defined

Definition at line 79 of file qs_pkg.hpp.

◆ QS_U8_PRE

#define QS_U8_PRE ( data_)
Value:
(QP::QS::u8_raw_(static_cast<std::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); // <===
. . .
#define QS_TEC_PRE(ctr_)
Output pre-formatted time event counter data element.
Definition qs_pkg.hpp:161
#define QS_U8_PRE(data_)
Output pre-formatted unsigned 8-bit integer data element.
Definition qs_pkg.hpp:81

Forward Traceability

  • DVR_QS_MP2_R19_0_2: Rule 19.0.2(Required): Function-like macros shall not be defined

Definition at line 81 of file qs_pkg.hpp.

◆ QS_2U8_PRE

#define QS_2U8_PRE ( data1_,
data2_ )
Value:
(QP::QS::u8u8_raw_(static_cast<std::uint8_t>(data1_), \
static_cast<std::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_MP2_R19_0_2: Rule 19.0.2(Required): Function-like macros shall not be defined

Definition at line 83 of file qs_pkg.hpp.

◆ QS_U16_PRE

#define QS_U16_PRE ( data_)
Value:
(QP::QS::u16_raw_(static_cast<std::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);
. . .
static RxAttr & rxPriv_
Definition qs.hpp:591
#define QS_U16_PRE(data_)
Output pre-formatted unsigned 16-bit integer data element.
Definition qs_pkg.hpp:86

Forward Traceability

  • DVR_QS_MP2_R19_0_2: Rule 19.0.2(Required): Function-like macros shall not be defined

Definition at line 86 of file qs_pkg.hpp.

◆ QS_U32_PRE

#define QS_U32_PRE ( data_)
Value:
(QP::QS::u32_raw_(static_cast<std::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.hpp:88
#define QS_FUN_PRE(fun_)
Output pre-formatted function pointer element.
Definition qs_pkg.hpp:99

Forward Traceability

  • DVR_QS_MP2_R19_0_2: Rule 19.0.2(Required): Function-like macros shall not be defined

Definition at line 88 of file qs_pkg.hpp.

◆ QS_STR_PRE

#define QS_STR_PRE ( msg_)
Value:
(QP::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"); // <===
. . .
#define QS_STR_PRE(msg_)
Output pre-formatted string data element.
Definition qs_pkg.hpp:90

Forward Traceability

  • DVR_QS_MP2_R19_0_2: Rule 19.0.2(Required): Function-like macros shall not be defined

Definition at line 90 of file qs_pkg.hpp.

◆ QS_OBJ_PRE

#define QS_OBJ_PRE ( obj_)
Value:
(QP::QS::obj_raw_(obj_))

Output pre-formatted object pointer element.

Parameters
[in]obj_object pointer to output

Forward Traceability

  • DVR_QS_MP2_R19_0_2: Rule 19.0.2(Required): Function-like macros shall not be defined

Definition at line 91 of file qs_pkg.hpp.

◆ QS_SIG_PRE

#define QS_SIG_PRE ( sig_)
Value:
(QP::QS::u16_raw_(static_cast<std::uint16_t>(sig_)))

Output pre-formatted event signal data element.

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

Forward Traceability

  • DVR_QS_MP2_R19_0_2: Rule 19.0.2(Required): Function-like macros shall not be defined

Definition at line 92 of file qs_pkg.hpp.

◆ QS_FUN_PRE

#define QS_FUN_PRE ( fun_)
Value:
(QP::QS::u32_raw_(reinterpret_cast<std::uint32_t>(fun_)))

Output pre-formatted function pointer element.

Parameters
[in]fun_function pointer to output

Forward Traceability

  • DVR_QS_MP2_R8_2_4: Rule 8.2.4(Required) conversion between pointer to function type
  • DVR_QS_MP2_R8_2_7: Rule 8.2.7(Advisory) casting from pointer type to integer type
  • DVR_QS_MP2_R19_0_2: Rule 19.0.2(Required): Function-like macros shall not be defined

Definition at line 99 of file qs_pkg.hpp.

◆ QS_EQC_PRE

#define QS_EQC_PRE ( ctr_)
Value:
QP::QS::u16_raw_(static_cast<std::uint16_t>(ctr_))

Output pre-formatted event queue counter data element.

Parameters
[in]ctr_event queue counter to output

Forward Traceability

  • DVR_QS_MP2_R19_0_2: Rule 19.0.2(Required): Function-like macros shall not be defined

Definition at line 114 of file qs_pkg.hpp.

◆ QS_EVS_PRE

#define QS_EVS_PRE ( size_)
Value:
QP::QS::u16_raw_(static_cast<std::uint16_t>(size_))

Output pre-formatted event queue size data element.

Parameters
[in]size_event queue size to output

Forward Traceability

  • DVR_QS_MP2_R19_0_2: Rule 19.0.2(Required): Function-like macros shall not be defined

Definition at line 125 of file qs_pkg.hpp.

◆ QS_MPS_PRE

#define QS_MPS_PRE ( size_)
Value:
QP::QS::u16_raw_(static_cast<std::uint16_t>(size_))

Output pre-formatted memory pool size data element.

Parameters
[in]size_memory pool size to output

Forward Traceability

  • DVR_QS_MP2_R19_0_2: Rule 19.0.2(Required): Function-like macros shall not be defined

Definition at line 136 of file qs_pkg.hpp.

◆ QS_MPC_PRE

#define QS_MPC_PRE ( ctr_)
Value:
QP::QS::u16_raw_(static_cast<std::uint16_t>(ctr_))

Output pre-formatted memory pool counter data element.

Parameters
[in]ctr_memory pool counter to output

Forward Traceability

  • DVR_QS_MP2_R19_0_2: Rule 19.0.2(Required): Function-like macros shall not be defined

Definition at line 147 of file qs_pkg.hpp.

◆ QS_TEC_PRE

#define QS_TEC_PRE ( ctr_)
Value:
QP::QS::u32_raw_(static_cast<std::uint32_t>(ctr_))

Output pre-formatted time event counter data element.

Parameters
[in]ctr_time event counter to output

Forward Traceability

  • DVR_QS_MP2_R19_0_2: Rule 19.0.2(Required): Function-like macros shall not be defined

Definition at line 161 of file qs_pkg.hpp.

◆ 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_MP2_R19_0_2: Rule 19.0.2(Required): Function-like macros shall not be defined
  • DVR_QS_PCLP_774: PCLP-774 boolean condition for 'if' always evaluates to 'false'

Definition at line 166 of file qs_pkg.hpp.

◆ QS_INSERT_ESC_BYTE_

#define QS_INSERT_ESC_BYTE_ ( b_)
Value:
chksum = static_cast<std::uint8_t>(chksum + (b_));\
if (((b_) != QS_FRAME) && ((b_) != QS_ESC)) { \
QS_INSERT_BYTE_(b_) \
} \
else { \
QS_INSERT_BYTE_(QS_ESC) \
QS_INSERT_BYTE_(static_cast<std::uint8_t>((b_) ^ QS_ESC_XOR)) \
priv_.used = priv_.used + 1U; \
}

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_MP2_R19_0_2: Rule 19.0.2(Required): Function-like macros shall not be defined
  • DVR_QS_PCLP_774: PCLP-774 boolean condition for 'if' always evaluates to 'false'

Definition at line 173 of file qs_pkg.hpp.