47#error "Q_SPY must be defined to include qs.h"
58#define QS_TIME_SIZE 4U
260typedef void (* QSpyFunPtr )(void);
263#if (QS_CTR_SIZE == 2U)
264typedef uint16_t QSCtr;
268#if (QS_CTR_SIZE == 4U)
269typedef uint32_t QSCtr;
273#if (QS_TIME_SIZE == 2U)
274typedef uint16_t QSTimeCtr;
278#if (QS_TIME_SIZE == 4U)
279typedef uint32_t QSTimeCtr;
283#if (QS_FUN_PTR_SIZE == 2U)
284typedef uint16_t
QSFun;
288#if (QS_FUN_PTR_SIZE == 4U)
293#if (QS_FUN_PTR_SIZE == 8U)
294typedef uint64_t
QSFun;
314#define QS_INIT(arg_) (QS_onStartup(arg_))
317#define QS_EXIT() (QS_onCleanup())
320#define QS_OUTPUT() (QS_output())
323#define QS_RX_INPUT() (QS_rx_input())
326#define QS_GLB_FILTER(rec_) (QS_glbFilter_((int_fast16_t)(rec_)))
329#define QS_LOC_FILTER(qs_id_) (QS_locFilter_((int_fast16_t)(qs_id_)))
332#define QS_BEGIN_ID(rec_, qs_id_) \
333if (QS_GLB_CHECK_(rec_) && QS_LOC_CHECK_(qs_id_)) { \
337 QS_beginRec_((uint_fast8_t)(rec_)); \
348#define QS_FLUSH() (QS_onFlush())
351#define QS_BEGIN_INCRIT(rec_, qs_id_) \
352if (QS_GLB_CHECK_(rec_) && QS_LOC_CHECK_(qs_id_)) { \
353 QS_beginRec_((uint_fast8_t)(rec_)); \
357#define QS_END_INCRIT() } \
362#define QS_GLB_CHECK_(rec_) \
363 (((uint_fast8_t)QS_filt_.glb[(uint_fast8_t)(rec_) >> 3U] \
364 & ((uint_fast8_t)1U << ((uint_fast8_t)(rec_) & 7U))) != 0U)
367#define QS_LOC_CHECK_(qs_id_) \
368 (((uint_fast8_t)QS_filt_.loc[(uint_fast8_t)(qs_id_) >> 3U] \
369 & ((uint_fast8_t)1U << ((uint_fast8_t)(qs_id_) & 7U))) != 0U)
373#define QS_REC_DONE() ((void)0)
377#define QS_I8(width_, data_) \
378 (QS_u8_fmt_((uint8_t)(((width_) << 4U) & 0x7U) | (uint8_t)QS_I8_ENUM_T, \
382#define QS_U8(width_, data_) \
383 (QS_u8_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U8_T, (data_)))
386#define QS_I16(width_, data_) \
387 (QS_u16_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_I16_T, (data_)))
390#define QS_U16(width_, data_) \
391 (QS_u16_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U16_T, (data_)))
394#define QS_I32(width_, data_) \
395 (QS_u32_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_I32_T, (data_)))
398#define QS_U32(width_, data_) \
399 (QS_u32_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U32_T, (data_)))
402#define QS_I64(width_, data_) \
403 (QS_u64_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_I64_T, (data_)))
406#define QS_U64(width_, data_) \
407 (QS_u64_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_U64_T, (data_)))
410#define QS_F32(width_, data_) \
411 (QS_f32_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_F32_T, (data_)))
414#define QS_F64(width_, data_) \
415 (QS_f64_fmt_((uint8_t)(((width_) << 4)) | (uint8_t)QS_F64_T, (data_)))
418#define QS_STR(str_) (QS_str_fmt_((str_)))
421#define QS_MEM(mem_, size_) (QS_mem_fmt_((mem_), (size_)))
424#define QS_ENUM(group_, value_) \
425 (QS_u8_fmt_((uint8_t)(0x80U | ((group_) << 4U)) | (uint8_t)QS_I8_ENUM_T,\
429#if (QS_TIME_SIZE == 2U)
430#define QS_TIME_PRE_() (QS_u16_raw_(QS_onGetTime()))
434#if (QS_TIME_SIZE == 4U)
435#define QS_TIME_PRE_() (QS_u32_raw_(QS_onGetTime()))
439#if (QS_OBJ_PTR_SIZE == 2U)
440#define QS_OBJ(obj_) (QS_u16_fmt_(QS_OBJ_T, (uint16_t)(obj_)))
444#if (QS_OBJ_PTR_SIZE == 4U)
445#define QS_OBJ(obj_) (QS_u32_fmt_(QS_OBJ_T, (uint32_t)(obj_)))
449#if (QS_OBJ_PTR_SIZE == 8U)
450#define QS_OBJ(obj_) (QS_u64_fmt_(QS_OBJ_T, (uint64_t)(obj_)))
454#if (QS_FUN_PTR_SIZE == 2U)
455#define QS_FUN(fun_) (QS_u16_fmt_(QS_FUN_T, (uint16_t)(fun_)))
459#if (QS_FUN_PTR_SIZE == 4U)
460#define QS_FUN(fun_) (QS_u32_fmt_(QS_FUN_T, (uint32_t)(fun_)))
464#if (QS_FUN_PTR_SIZE == 8U)
465#define QS_FUN(fun_) (QS_u64_fmt_(QS_FUN_T, (uint64_t)(fun_)))
469#if (Q_SIGNAL_SIZE == 1U)
470#define QS_SIG(sig_, obj_) \
471 QS_u8_fmt_(QS_SIG_T, (sig_)); \
476#if (Q_SIGNAL_SIZE == 2U)
477#define QS_SIG(sig_, obj_) \
478 QS_u16_fmt_(QS_SIG_T, (sig_)); \
483#if (Q_SIGNAL_SIZE == 4U)
484#define QS_SIG(sig_, obj_) \
485 QS_u32_fmt_(QS_SIG_T, (sig_)); \
490#define QS_SIG_DICTIONARY(sig_, obj_) \
491 (QS_sig_dict_pre_((QSignal)(sig_), (obj_), #sig_))
494#define QS_OBJ_DICTIONARY(obj_) \
495 (QS_obj_dict_pre_((obj_), #obj_))
498#define QS_OBJ_ARR_DICTIONARY(obj_, idx_) \
499 (QS_obj_arr_dict_pre_((obj_), (idx_), #obj_))
502#define QS_FUN_DICTIONARY(fun_) \
503 (QS_fun_dict_pre_((void (*)(void))(fun_), #fun_))
506#define QS_USR_DICTIONARY(rec_) \
507 (QS_usr_dict_pre_((rec_), #rec_))
510#define QS_ENUM_DICTIONARY(value_, group_) \
511 (QS_enum_dict_pre_((value_), (group_), #value_))
514#define QS_RX_PUT(b_) (QS_rxPut((b_)))
517#define QS_TR_CRIT_ENTRY()
520#define QS_TR_CRIT_EXIT()
523#define QS_TR_ISR_ENTRY(isrnest, prio) do { \
524 QS_BEGIN_PRE_(QS_QF_ISR_ENTRY, 0U) \
526 QS_2u8_raw_(isrnest, prio); \
532 uint_fast8_t isrnest,
536#define QS_ONLY(code_) (code_)
539#define QS_ASSERTION(module_, id_, delay_) \
540 (QS_assertion_pre_((module_), (id_), (delay_)))
543#define QS_EOD ((uint16_t)0xFFFFU)
546#define QS_CMD ((uint8_t)7U)
549#define QS_HEX_FMT ((uint8_t)0x0FU)
553#define QS_CRIT_STAT QF_CRIT_STAT
558#define QS_CRIT_ENTRY() QF_CRIT_ENTRY()
563#define QS_CRIT_EXIT() QF_CRIT_EXIT()
568#define QS_MEM_SYS() QF_MEM_SYS()
573#define QS_MEM_APP() QF_MEM_APP()
581 void const * locFilter_AP;
587 uint8_t
volatile seq;
588 uint8_t
volatile chksum;
589 uint8_t
volatile critNest;
593extern QS_Attr QS_priv_;
595void QS_glbFilter_(int_fast16_t
const filter);
596void QS_locFilter_(int_fast16_t
const filter);
598void QS_beginRec_(uint_fast8_t
const rec);
599void QS_endRec_(
void);
601void QS_u8_raw_(uint8_t
const d);
605void QS_u16_raw_(uint16_t
const d);
606void QS_u32_raw_(uint32_t
const d);
607void QS_u64_raw_(uint64_t
const d);
608void QS_obj_raw_(
void const *
const obj);
609void QS_str_raw_(
char const *
const str);
612 uint8_t
const format,
615 uint8_t
const format,
618 uint8_t
const format,
621 uint8_t
const format,
624 uint8_t
const format,
627 uint8_t
const format,
629void QS_str_fmt_(
char const *
const str);
631 uint8_t
const *
const blk,
634void QS_sig_dict_pre_(
636 void const *
const obj,
637 char const *
const name);
638void QS_obj_dict_pre_(
639 void const *
const obj,
640 char const *
const name);
641void QS_obj_arr_dict_pre_(
642 void const *
const obj,
643 uint_fast16_t
const idx,
644 char const *
const name);
645void QS_fun_dict_pre_(
646 QSpyFunPtr
const fun,
647 char const *
const name);
648void QS_usr_dict_pre_(
650 char const *
const name);
651void QS_enum_dict_pre_(
654 char const *
const name);
656void QS_assertion_pre_(
657 char const *
const module,
659 uint32_t
const delay);
661void QS_target_info_pre_(uint8_t
const isReset);
692 uint_fast32_t
const stoSize);
738extern QS_RxAttr QS_rxPriv_;
769 uint16_t
const stoSize);
777 QSCtr head = QS_rxPriv_.head + 1U;
778 if (head == QS_rxPriv_.end) {
781 if (head != QS_rxPriv_.tail) {
782 QS_rxPriv_.buf[QS_rxPriv_.head] = b;
783 QS_rxPriv_.head = head;
854#define QUTEST_ON_POST 124
865 uint_fast8_t intLock;
868extern QSTestAttr QS_tstPriv_;
870void QS_test_pause_(
void);
871uint32_t QS_getTestProbe_(QSpyFunPtr
const api);
899 void const *
const par,
900 uint_fast8_t
const qs_id);
907 QEvt
const *
const e,
908 uint_fast8_t
const qs_id);
930 void const *
const par,
931 uint_fast8_t
const qs_id);
936 QEvt
const *
const e,
937 uint_fast8_t
const qs_id);
942 QEvt
const *
const e,
943 uint_fast16_t
const margin,
944 void const *
const sender);
949 QEvt
const *
const e);
954#define QS_TEST_PROBE_DEF(fun_) \
955 uint32_t const qs_tp_ = QS_getTestProbe_((void (*)(void))(fun_));
957#define QS_TEST_PROBE(code_) \
958 if (qs_tp_ != 0U) { code_ }
960#define QS_TEST_PROBE_ID(id_, code_) \
961 if (qs_tp_ == (uint32_t)(id_)) { code_ }
963#define QS_TEST_PAUSE() (QS_test_pause_())
968#define QS_TEST_PROBE_DEF(fun_)
969#define QS_TEST_PROBE(code_)
970#define QS_TEST_PROBE_ID(id_, code_)
971#define QS_TEST_PAUSE() ((void)0)
@ QS_ASSERT_FAIL
assertion failed in the code
@ QS_QF_TIMEEVT_AUTO_DISARM
a time event expired and was disarmed
@ QS_QF_INT_ENABLE
interrupts were enabled
@ QS_QF_RUN
QF_run() was entered.
@ QS_USER0
offset for User Group 0
@ QS_QF_MPOOL_GET_ATTEMPT
attempt to get a memory block failed
@ QS_U2_RECORDS
User Group 110-114 records.
@ QS_QF_DELETE_REF
an event reference is about to be deleted
@ QS_QF_ACTIVE_RECALL
AO recalled an event.
@ QS_QF_EQUEUE_GET_LAST
get the last event from the queue
@ QS_QF_TIMEEVT_DISARM
true disarming of an armed time event
@ QS_TEST_PROBE_GET
reports that Test-Probe has been used
@ QS_SEM_BLOCK
a semaphore blocked a thread
@ QS_QEP_STATE_INIT
an initial transition was taken in a state
@ QS_QEP_TRAN_HIST
a tran to history was taken
@ QS_ENUM_DICT
enumeration dictionary entry
@ QS_QF_TIMEEVT_REARM
rearming of a time event
@ QS_FUN_DICT
function dictionary entry
@ QS_USER3
offset for User Group 3
@ QS_MP_RECORDS
Memory Pools QS records.
@ QS_QF_PUBLISH
an event was published to active objects
@ QS_USER1
offset for User Group 1
@ QS_MTX_UNLOCK
a mutex was unlocked
QS_preType
Enumerates data elements for app-specific trace records.
@ QS_STR_T
zero-terminated ASCII string format
@ QS_U64_T
unsigned 64-bit integer format
@ QS_MEM_T
up to 255-bytes memory block format
@ QS_OBJ_T
object pointer format
@ QS_F32_T
32-bit floating point format
@ QS_SIG_T
event signal format
@ QS_I8_ENUM_T
signed 8-bit integer or enum format
@ QS_U8_T
unsigned 8-bit integer format
@ QS_I64_T
signed 64-bit integer format
@ QS_FUN_T
function pointer format
@ QS_F64_T
64-bit floating point format
@ QS_U32_T
unsigned 32-bit integer format
@ QS_I32_T
signed 32-bit integer format
@ QS_I16_T
signed 16-bit integer format
@ QS_U16_T
unsigned 16-bit integer format
@ QS_TE_RECORDS
Time Events QS records.
@ QS_MTX_BLOCK
a mutex blocked a thread
@ QS_SEM_BLOCK_ATTEMPT
a semaphore blocked was attempted
@ SM_OBJ
state machine object
@ QS_QF_ACTIVE_POST_LIFO
an event was posted (LIFO) directly to AO
@ QS_QEP_TRAN_EP
a tran to entry point into a submachine
@ QS_QEP_STATE_EXIT
a state was exited
@ QS_TARGET_DONE
reports completion of a user callback
@ QS_EP_IDS
event-pool IDs
@ QS_USER
the first record available to QS users
@ QS_MTX_LOCK_ATTEMPT
a mutex lock was attempted
@ QS_QF_GC_ATTEMPT
garbage collection attempt
@ QS_QF_CRIT_ENTRY
critical section was entered
@ QS_QF_MPOOL_PUT
a memory block was returned to memory pool
@ QS_QF_EQUEUE_POST_ATTEMPT
attempt to post evt to QEQueue failed
@ QS_PRE_MAX
the # predefined signals
@ QS_QF_GC
garbage collection
@ QS_QF_ACTIVE_GET
AO got an event and its queue is not empty.
@ QS_AO_IDS
AO IDs (priorities)
@ QS_QF_CRIT_EXIT
critical section was exited
@ QS_SM_RECORDS
State Machine QS records.
@ QS_QF_TIMEEVT_POST
a time event posted itself directly to an AO
@ QS_QF_INT_DISABLE
interrupts were disabled
@ QS_OBJ_DICT
object dictionary entry
@ QS_QF_MPOOL_GET
a memory block was removed from memory pool
@ QS_MTX_UNLOCK_ATTEMPT
a mutex unlock was attempted
@ QS_QF_TIMEEVT_DISARM_ATTEMPT
attempt to disarm a disarmed QTimeEvt
void QS_TR_ISR_EXIT(uint_fast8_t isrnest, uint_fast8_t prio)
@ QS_SEM_TAKE
a semaphore was taken by a thread
@ QS_U0_RECORDS
User Group 100-104 records.
@ QS_QF_ACTIVE_RECALL_ATTEMPT
AO attempted to recall an event.
@ QS_QEP_INIT_TRAN
the top-most initial transition was taken
@ QS_TARGET_INFO
reports the Target information
@ QS_QEP_INTERN_TRAN
an internal transition was taken
@ QS_SEM_SIGNAL
a semaphore was signaled
@ QS_QEP_TRAN_XP
a tran to exit point out of a submachine
@ QS_RX_STATUS
reports QS data receive status
@ QS_EQ_ID
offset for event-queue IDs
@ QS_U3_RECORDS
User Group 115-119 records.
@ QS_SCHED_IDLE
scheduler restored the idle task
@ QS_QF_EQUEUE_POST_LIFO
an event was posted (LIFO) to a raw queue
@ QS_QEP_STATE_ENTRY
a state was entered
@ QS_MTX_RECORDS
Mutex QS records.
@ QS_SCHED_PREEMPT
scheduler asynchronously preempted a task
@ QS_EP_ID
offset for event-pool IDs
@ QS_QEP_UNHANDLED
an event was un-handled due to a guard
@ QS_QF_ACTIVE_POST_ATTEMPT
attempt to post an evt to AO failed
@ QS_QEP_TRAN
a regular transition was taken
@ QS_U4_RECORDS
User Group 120-124 records.
@ QS_QF_EQUEUE_GET
get an event and queue still not empty
@ QS_QF_ISR_ENTRY
an ISR was entered
@ QS_AO_RECORDS
Active Object QS records.
@ QS_QF_NEW_ATTEMPT
an attempt to allocate an event failed
@ TE_OBJ
time event object
@ QS_QF_ISR_EXIT
an ISR was exited
@ QS_QF_TICK
QTimeEvt tick was called.
@ QS_SEM_RECORDS
Semaphore QS records.
@ QS_QF_ACTIVE_UNSUBSCRIBE
an AO unsubscribed to an event
@ QS_QEP_DISPATCH
an event was dispatched (begin of RTC step)
@ QS_QF_ACTIVE_DEFER
AO deferred an event.
@ QS_AP_ID
offset for Application-specific IDs
@ QS_SCHED_LOCK
scheduler was locked
@ QS_QF_RECORDS
QF QS records.
@ QS_QF_NEW_REF
new event reference was created
@ QS_TEST_PAUSED
test has been paused
@ QS_SC_RECORDS
Scheduler QS records.
@ QS_SCHED_UNLOCK
scheduler was unlocked
@ QS_AO_ID
offset for AO priorities
@ AP_OBJ
generic Application-specific object
@ QS_EMPTY
QS record for cleanly starting a session.
@ QS_EQ_IDS
event-queue IDs
@ QS_USER2
offset for User Group 2
@ QS_QF_ACTIVE_POST
an event was posted (FIFO) directly to AO
@ QS_SIG_DICT
signal dictionary entry
@ SM_AO_OBJ
combination of SM and AO
@ QS_U1_RECORDS
User Group 105-109 records.
@ QS_EQ_RECORDS
Event Queues QS records.
@ QS_QUERY_DATA
reports the data from "current object" query
@ QS_QF_TIMEEVT_ARM
a time event was armed
@ QS_QEP_IGNORED
an event was ignored (silently discarded)
@ QS_USR_DICT
user QS record dictionary entry
@ QS_QF_NEW
new event was created
@ QS_QF_EQUEUE_POST
an event was posted (FIFO) to a raw queue
@ QS_QF_ACTIVE_GET_LAST
AO got an event and its queue is empty.
@ QS_ALL_RECORDS
all maskable QS records
@ QS_SCHED_NEXT
scheduler started next task
@ QS_PEEK_DATA
reports the data from the PEEK query
@ QS_MTX_LOCK
a mutex was locked
@ QS_SCHED_RESTORE
scheduler restored preempted task
@ QS_UA_RECORDS
All User records.
@ MP_OBJ
event pool object
@ QS_USER4
offset for User Group 4
@ QS_QF_ACTIVE_SUBSCRIBE
an AO subscribed to an event
@ QS_MTX_BLOCK_ATTEMPT
a mutex blocking was attempted
@ QS_AP_IDS
Application-specific IDs.
void QActiveDummy_ctor(QActiveDummy *const me)
void QActiveDummy_dispatch_(QAsm *const me, QEvt const *const e, uint_fast8_t const qs_id)
bool QActiveDummy_fakePost_(QActive *const me, QEvt const *const e, uint_fast16_t const margin, void const *const sender)
void QActiveDummy_init_(QAsm *const me, void const *const par, uint_fast8_t const qs_id)
void QActiveDummy_fakePostLIFO_(QActive *const me, QEvt const *const e)
void QHsmDummy_ctor(QHsmDummy *const me)
void QHsmDummy_init_(QAsm *const me, void const *const par, uint_fast8_t const qs_id)
void QHsmDummy_dispatch_(QAsm *const me, QEvt const *const e, uint_fast8_t const qs_id)
void QS_onTestPost(void const *sender, QActive *recipient, QEvt const *e, bool status)
void QS_onTestSetup(void)
void QS_rxInitBuf(uint8_t *const sto, uint16_t const stoSize)
uint8_t const * QS_getBlock(uint16_t *const pNbytes)
static bool QS_rxPut(uint8_t const b)
QSTimeCtr QS_onGetTime(void)
uint8_t QS_onStartup(void const *arg)
void QS_onTestTeardown(void)
uint16_t QS_getByte(void)
void QS_onTestEvt(QEvt *e)
void QS_initBuf(uint8_t *const sto, uint_fast32_t const stoSize)
uint16_t QS_rxGetNfree(void)
void QS_onCommand(uint8_t cmdId, uint32_t param1, uint32_t param2, uint32_t param3)