QP/C++  7.3.0
Real-Time Embedded Framework
Loading...
Searching...
No Matches
QP::QS Namespace Reference

QP/Spy software tracing (target-resident components) More...

Classes

class  Filter
 QS type for output filters (global and local) More...
 
struct  TProbe
 QUTest Test-Probe attributes. More...
 

Enumerations

enum  preType : std::uint8_t {
  I8_ENUM_T , U8_T , I16_T , U16_T ,
  I32_T , U32_T , F32_T , F64_T ,
  STR_T , MEM_T , SIG_T , OBJ_T ,
  FUN_T , I64_T , U64_T
}
 Enumerates data elements for app-specific trace records. More...
 
enum  QSpyObjKind : std::uint8_t {
  SM_OBJ , AO_OBJ , MP_OBJ , EQ_OBJ ,
  TE_OBJ , AP_OBJ , MAX_OBJ
}
 Kinds of objects used QS-RX. More...
 
enum  OSpyObjCombnation : std::uint8_t { SM_AO_OBJ = MAX_OBJ }
 Object combinations for QS-RX. More...
 

Functions

template<typename T_OUT , typename T_IN >
T_OUT force_cast (T_IN in)
 
void initBuf (std::uint8_t *const sto, std::uint_fast32_t const stoSize) noexcept
 
std::uint16_t getByte () noexcept
 
std::uint8_t const * getBlock (std::uint16_t *const pNbytes) noexcept
 
void doOutput ()
 
bool onStartup (void const *arg)
 
void onCleanup ()
 
void onFlush ()
 
QSTimeCtr onGetTime ()
 
void rxInitBuf (std::uint8_t *const sto, std::uint16_t const stoSize) noexcept
 
bool rxPut (std::uint8_t const b) noexcept
 
void rxParse ()
 
std::uint16_t rxGetNfree () noexcept
 
void doInput ()
 
void onReset ()
 
void onCommand (std::uint8_t cmdId, std::uint32_t param1, std::uint32_t param2, std::uint32_t param3)
 
void onTestSetup ()
 
void onTestTeardown ()
 
void onTestEvt (QEvt *e)
 
void onTestPost (void const *sender, QActive *recipient, QEvt const *e, bool status)
 
void onTestLoop ()
 
void processTestEvts_ ()
 

Variables

Filter filt_
 

Detailed Description

QP/Spy software tracing (target-resident components)

Enumeration Type Documentation

◆ preType

enum QP::QS::preType : std::uint8_t

Enumerates data elements for app-specific trace records.

Enumerator
I8_ENUM_T 

signed 8-bit integer or enum format

U8_T 

unsigned 8-bit integer format

I16_T 

signed 16-bit integer format

U16_T 

unsigned 16-bit integer format

I32_T 

signed 32-bit integer format

U32_T 

unsigned 32-bit integer format

F32_T 

32-bit floating point format

F64_T 

64-bit floating point format

STR_T 

zero-terminated ASCII string format

MEM_T 

up to 255-bytes memory block format

SIG_T 

event signal format

OBJ_T 

object pointer format

FUN_T 

function pointer format

I64_T 

signed 64-bit integer format

U64_T 

unsigned 64-bit integer format

Definition at line 708 of file qs.hpp.

◆ QSpyObjKind

enum QP::QS::QSpyObjKind : std::uint8_t

Kinds of objects used QS-RX.

Enumerator
SM_OBJ 

state machine object

AO_OBJ 

active object

MP_OBJ 

event pool object

EQ_OBJ 

raw queue object

TE_OBJ 

time event object

AP_OBJ 

generic Application-specific object

MAX_OBJ 

Definition at line 797 of file qs.hpp.

◆ OSpyObjCombnation

enum QP::QS::OSpyObjCombnation : std::uint8_t

Object combinations for QS-RX.

Enumerator
SM_AO_OBJ 

combination of SM and AO

Definition at line 809 of file qs.hpp.

Function Documentation

◆ force_cast()

template<typename T_OUT , typename T_IN >
T_OUT QP::QS::force_cast ( T_IN  in)
inline

Definition at line 728 of file qs.hpp.

◆ initBuf()

void QP::QS::initBuf ( std::uint8_t *const  sto,
std::uint_fast32_t const  stoSize 
)
noexcept

Initialize the QS-TX data buffer

This function should be called from QS_onStartup() to provide QS with the data buffer. The first argument sto is the address of the memory block, and the second argument stoSize is the size of this block [in bytes]. Currently the size of the QS buffer cannot exceed 64KB.

Parameters
[in]stopointer to the storage for the transmit buffer
[in]stoSizesize in [bytes] of the storage buffer
Remarks
QS can work with quite small data buffers, but you will start losing data if the buffer is too small for the bursts of tracing activity. The right size of the buffer depends on the data production rate and the data output rate. QS offers flexible filtering to reduce the data production rate.
Note
If the data output rate cannot keep up with the production rate, QS will start overwriting the older data with newer data. This is consistent with the "last-is-best" QS policy. The record sequence counters and check sums on each record allow the QSPY host utility to easily detect any data loss.

Definition at line 66 of file qs.cpp.

◆ getByte()

std::uint16_t QP::QS::getByte ( )
noexcept

Byte-oriented interface to the QS-TX data buffer

This function delivers one byte at a time from the QS data buffer.

Returns
the byte in the least-significant 8-bits of the 16-bit return value if the byte is available. If no more data is available at the time, the function returns QS_EOD (End-Of-Data).
Attention
QS::getByte() should be called from with a critical section.

Definition at line 94 of file qs.cpp.

◆ getBlock()

std::uint8_t const * QP::QS::getBlock ( std::uint16_t *const  pNbytes)
noexcept

Block-oriented interface to the QS-TX data buffer

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.

Parameters
[in,out]pNbytespointer 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.
Returns
if data is available, the function returns pointer to the contiguous block of data and sets the value pointed to by pNbytes to the # available bytes. If data is available at the time the function is called, the function returns NULL pointer and sets the value pointed to by pNbytes to zero.
Note
Only the NULL return from QS_getBlock() indicates that the QS buffer is empty at the time of the call. The non-NULL return often means that the block is at the end of the buffer and you need to call QS_getBlock() again to obtain the rest of the data that "wrapped around" to the beginning of the QS data buffer.
Attention
QS::getBlock() should be called from with a critical section.

Definition at line 117 of file qs.cpp.

◆ doOutput()

void QP::QS::doOutput ( )

◆ onStartup()

bool QP::QS::onStartup ( void const *  arg)

◆ onCleanup()

void QP::QS::onCleanup ( )

◆ onFlush()

void QP::QS::onFlush ( )

◆ onGetTime()

QSTimeCtr QP::QS::onGetTime ( )

◆ rxInitBuf()

void QP::QS::rxInitBuf ( std::uint8_t *const  sto,
std::uint16_t const  stoSize 
)
noexcept

Definition at line 222 of file qs_rx.cpp.

◆ rxPut()

bool QP::QS::rxPut ( std::uint8_t const  b)
inlinenoexcept

Definition at line 819 of file qs.hpp.

◆ rxParse()

void QP::QS::rxParse ( )

Definition at line 256 of file qs_rx.cpp.

◆ rxGetNfree()

std::uint16_t QP::QS::rxGetNfree ( )
noexcept

Definition at line 304 of file qs_rx.cpp.

◆ doInput()

void QP::QS::doInput ( )

◆ onReset()

void QP::QS::onReset ( )

◆ onCommand()

void QP::QS::onCommand ( std::uint8_t  cmdId,
std::uint32_t  param1,
std::uint32_t  param2,
std::uint32_t  param3 
)

◆ onTestSetup()

void QP::QS::onTestSetup ( )

◆ onTestTeardown()

void QP::QS::onTestTeardown ( )

◆ onTestEvt()

void QP::QS::onTestEvt ( QEvt e)

◆ onTestPost()

void QP::QS::onTestPost ( void const *  sender,
QActive recipient,
QEvt const *  e,
bool  status 
)

◆ onTestLoop()

void QP::QS::onTestLoop ( )

◆ processTestEvts_()

void QP::QS::processTestEvts_ ( )

Definition at line 158 of file qutest.cpp.

Variable Documentation

◆ filt_

Filter QP::QS::filt_

The instance of the QS_filter object (Singleton)

The QS filters are separated out from the rest of the QS attributes because when Memory Isolation is used, the QS filters must be accessible in their own memory region.

Definition at line 163 of file qs.cpp.