Software tracing instrumentation target-resident component. More...
#include <qs.hpp>
Classes | |
| class | Attr |
| Private attributes of the QS software tracing target-resident component (TX channel). More... | |
| class | Filter |
| QS type for output filters (global and local. More... | |
Public Types | |
| enum class | QSResetAction : std::uint8_t { TARGET_NO_RESET , TARGET_RESET } |
| enum | ObjKind_old : std::uint8_t { SM_OBJ , AO_OBJ , MP_OBJ , EQ_OBJ , TE_OBJ , AP_OBJ , SM_AO_OBJ } |
Static Public Member Functions | |
| template<typename T_OUT, typename T_IN> | |
| static T_OUT | force_cast (T_IN in) |
| static void | initBuf (std::uint8_t *const sto, std::uint_fast32_t const stoSize) noexcept |
| Initialize the QS-TX data buffer. | |
| static std::uint16_t | getByte () noexcept |
| static std::uint8_t const * | getBlock (std::uint16_t *const pNbytes) noexcept |
| static void | doOutput () |
| static bool | onStartup (void const *arg) |
| static void | onCleanup () |
| static void | onFlush () |
| Flush the QS output buffer. | |
| static QSTimeCtr | onGetTime () |
| Return the current timestamp for QS trace records. | |
| static void | rxInitBuf (std::uint8_t *const sto, std::uint16_t const stoSize) noexcept |
| static bool | rxPut (std::uint8_t const b) noexcept |
| static void | rxParse () |
| Parse and process QS-RX (receive channel) data bytes. | |
| static void | rxParseBuf (std::uint16_t const len) |
| static bool | setCurrObj (std::uint8_t const obj_kind, void *const obj_ptr) noexcept |
| Set the "current object" inside the Target. | |
| static void * | getCurrObj (std::uint8_t const obj_kind) noexcept |
| static bool | setCurrId (std::uint8_t const obj_kind, std::uint8_t const obj_id) noexcept |
| Set the "current object" inside the Target. | |
| static std::uint8_t | getCurrId (std::uint8_t const obj_kind) noexcept |
| static std::uint16_t | rxGetFree () noexcept |
| static void | doInput () |
| static void | onReset () |
| static void | onCommand (std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3) |
| static void | target_info_pre_ (QSResetAction const act) |
| static void | onTestSetup () |
| static void | onTestTeardown () |
| static void | onTestEvt (QEvt *e) |
| static void | onTestPost (void const *sender, QActive *recipient, QEvt const *e, bool status) |
| static void | onTestLoop () |
Static Public Attributes | |
| static Attr | priv_ |
| static Filter | filt_ |
| static RxAttr & | rxPriv_ = l_rxPriv_ |
Software tracing instrumentation target-resident component.
Details
This class groups together QP/Spy services for target-resident software tracing instrumentation.
|
strong |
| enum QP::QS::ObjKind_old : std::uint8_t |
| Enumerator | |
|---|---|
| SM_OBJ | |
| AO_OBJ | |
| MP_OBJ | |
| EQ_OBJ | |
| TE_OBJ | |
| AP_OBJ | |
| SM_AO_OBJ | |
|
inlinestatic |
|
staticnoexcept |
Initialize the QS-TX data buffer.
Details
This function should be called from QS_onStartup() to provide QS-TX (transmit channel) with the data buffer.
| [in] | sto | pointer to the storage for the transmit buffer |
| [in] | stoSize | size in [bytes] of the storage buffer. Currently, the size of the QS buffer cannot exceed 64KB. |
|
staticnoexcept |
Byte-oriented interface to the QS-TX data buffer
Details
This function delivers one byte at a time from the QS data buffer.
|
staticnoexcept |
Block-oriented interface to the QS-TX data buffer
Details
This function delivers a contiguous block of data from the QS data buffer. The function returns the pointer to the beginning of the block, and writes the number of bytes in the block to the location pointed to by pNbytes. The argument pNbytes is also used as input to provide the maximum size of the data block that the caller can accept.
| [in,out] | pNbytes | pointer to the number of bytes to send. On input, pNbytes specifies the maximum number of bytes that the function can provide. On output, pNbytes contains the actual number of bytes available. |
|
static |
|
static |
|
static |
|
static |
Flush the QS output buffer.
Details
This function is used at the end of QS dictionaries and other QS records that need to be transmitted immediately. QS::onFlush() is typically used only during the initial transient and should NOT be used thereafter because it is busy-waiting for the transmission of the data.
|
static |
Return the current timestamp for QS trace records.
Details
This function is defined in the application and is called for every QS trace record that requires a timestamp. The function shall return the current timestamp as an unsigned integer of the type QS::QSTimeCtr. The dynamic range of QS::QSTimeCtr is configurable by the macro QS_TIME_SIZE, which can take values 1-byte (256 counts), 2-bytes (64K counts), and 4-bytes (4G counts).
As this is a callback from QS to the application, the properties of the timestamp depend entirely on the application. Typically, the function requires a hardware timer with the following properties:
Example
The following code implements QS_onGetTime() with a free-running, 32-bit timer in STM32U545 MCU:
|
staticnoexcept |
code_uid{QP::QS::QS_rxInitBuf(), Initialize the QS-RX data buffer}
Details
This function should be called from QS::onStartup() to provide QS-RX (receive channel) with the data buffer. The QS-RX channel requires the initialization of the QS-TX channel (see QS::initBuf()). The QS-RX channel is optional and does not require initialization when not in use.
| [in] | sto | pointer to the storage for the QS-RX receive buffer |
| [in] | stoSize | size in [bytes] of the storage buffer |
|
staticnoexcept |
Put a byte into the QS-RX (receive channel) input buffer
Details
This function is called (typically from an ISR) to put a new incoming byte into the QS-RX input buffer.
| [in] | b | data byte to insert into the QS-RX receive buffer |
|
static |
Parse and process QS-RX (receive channel) data bytes.
Details
The application must call this function repeatedly to process the incoming commands from the QS-RX input channel. The frequency of the calls must be high enough to avoid overflowing the QS-RX input buffer (see QS::rxInitBuf()).
|
staticnoexcept |
Set the "current object" inside the Target.
Details
This function sets the "current object" selected object kind inside the QS-RX target-resident component. This "current object" is subsequently used in all commands that pertain to that object.
| [in] | obj_kind | kind of "current object" to set. The possible values are:
|
| [in] | obj_ptr | pointer to the object to set as "current" |
|
staticnoexcept |
|
staticnoexcept |
Set the "current object" inside the Target.
Details
This function sets the "current object" selected object kind inside the QS-RX target-resident component. This "current object" is subsequently used in all commands that pertain to that object.
| [in] | obj_kind | kind of "current object" to set. The possible values are:
|
| [in] | obj_id | the "ID" of the object to set as "current". The example object IDs are:
|
|
staticnoexcept |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |