QP/C++ 8.1.4
Real-Time Event Framework
Loading...
Searching...
No Matches
Software Tracing

Time ManagementNon-Preemptive Kernel

Remarks
The concepts & definitions related to this SRS section are provided in Annex A: Concepts & Definitions, Section Software Tracing.

Requirements


SRS_QP_QS_00

QP/C++ Framework component shall support Software Tracing.

Description
Support for Software Tracing means that the QP/C++ Framework component shall implement the QS target-resident component. This also means that the QP/C++ Framework component shall provide the Software Tracing API for initializing the QS target-resident component, setting up the filters, encoding QS trace records, accessing the QS trace buffers, etc.

Forward Traceability (truncated to 2 level(s))

  • SAS_QP_MEM_06: Tracing buffers allocation policy and responsibilities
    • SSM_QA_CSOU_41: Mandate: QP/C++ Application must allocate all objects statically.



SRS_QP_QS_01

QS target-resident component shall be inactive by default and activated only when explicitly enabled.

Description
The QS tracing API shall be inactive by default, meaning it should not produce any executable code. The QS instrumentation shall become active only when explicitly enabled. This requirement does NOT mean that the QS tracing instrumentation gets removed or changed in the QP/C++ Framework component or QP/C++ Application source code. Instead, this requirement means that the (inactive) QS instrumentation can be safely left in the source code (both QP/C++ Framework component and QP/C++ Application) to help in future development, testing, and maintenance.

Use Case
The QS API can be implemented as preprocessor macros (in C or C++), which are defined to nothing by default, resulting in no code generation by the compiler. Only when a special macro is defined (e.g., Q_SPY), the QS API can be defined such that it generates code. That way also avoids contaminating the source code with conditional compilation for every QS API, which could run the risk of inadvertently leaving some QS APIs active (should the developer forget to surround the QS API with conditional compilation).

Forward Traceability (truncated to 2 level(s))



SRS_QP_QS_10

QS target-resident component shall use the binary data protocol.

Description
The QS target-resident component shall produce tracing data into the RAM buffer encoded by means of a binary protocol. The main feature required from the applied protocol is maintaining delimited frames, each containing one trace record. The protocol "frames" shall contain the following elements:

  • sequence-number to enable checking data continuity (range 0..255, "wrapping around")
  • record-id to identify the type of the trace record (range 0..127)
  • optional time-stamp data element (configurable length integer of 1, 2, or 4 bytes)
  • optional data-payload (length 0..n bytes)
  • checksum (range 0..255) to enable checking the integrity of the frame

Use Case
This requirement can be met, for example, by a High-Level Data Link Control (HDLC) protocol, which is characterized by establishing very easily identifiable frames in the serial data stream. Any receiver of such a protocol can instantaneously synchronize to the frame boundary by simply finding the Flag byte (typically 0x7E).

Forward Traceability (truncated to 2 level(s))



SRS_QP_QS_11

QS target-resident component shall allow flexible buffering schemes and decoupling trace generation from transmission to the host.

Description
The QS data protocol is the primary enabler for a flexible buffering policy. Specifically, the protocol inserts only complete trace records as delimited "frames" into the RAM buffer, which has two significant consequences:

  1. For each trace record, the QS transmission protocol maintains both the continuity and the integrity checks (see SRS_QP_QS_10), which means that any data corruption caused by overrunning the old data with the new data can always be reliably detected on the host side. Therefore, the new trace data can be inserted into the trace RAM buffer, regardless of whether it overwrites the old data that hasn't been removed and sent out yet. The detection of any data corruption can thus be removed from the target system and deferred to the QSPY host component.
  2. The insertion of delimited "frames" in the trace buffers enables decoupling data insertion into the trace buffers from data removal out of the trace buffers. QP/C++ Application can remove the trace data in arbitrary chunks, without any consideration for frame boundaries. QP/C++ Application can employ any physical data link available in the target for transferring the trace data to the host.

Forward Traceability (truncated to 2 level(s))

  • SAS_QP_MEM_06: Tracing buffers allocation policy and responsibilities
    • SSM_QA_CSOU_41: Mandate: QP/C++ Application must allocate all objects statically.



SRS_QP_QS_20

QS target-resident component shall support Global-Filter.

Description
The QS Global-Filter is based on the record-id associated with each QS trace record (see SRS_QP_QS_10). The Global-Filter shall allow the QP/C++ Application to disable or enable each record-id or an arbitrary subset of record-ids. For example, QP/C++ Application might enable or disable only state-machine-entry records, or all state-machine groups of records. This filter works globally for all trace records in the entire system.

Forward Traceability (truncated to 2 level(s))



SRS_QP_QS_21

QS target-resident component shall support Local-Filter.

Description
The QS Local-Filter is based on the individual object-id associated with various objects in the target memory. The object-ids are small integer numbers in the range 0..127. The object-ids in the range 0..64 are reserved for the Active Objects, where object-id corresponds to the unique priority of the Active Object. QP/C++ Application can associate other remaining object-ids (65..127) with different objects. Then, the QP/C++ Application can set up the QS Local-Filter to enable only a specific object-id or any subset of object-ids.

Use Case
The main use case for the Local-Filter is an application where particular objects (e.g., Active Objects) are very "noisy" and would overwhelm the trace. The Local-Filter allows the QP/C++ Application to silence the "noisy" objects and let the others through. Please note that the Global-Filter cannot achieve such a selection and must be complemented by the Local-Filter.

Forward Traceability (truncated to 2 level(s))



SRS_QP_QS_30

QS target-resident component shall support predefined trace records.

Description
Predefined trace records are trace records with a fixed format known upfront by both the QS target-resident component and the QSPY host-resident component. Every predefined trace record is uniquely identified by its record-id (see SRS_QP_QS_10), and the record-id range 0..100 is reserved for the predefined records. This one-to-one mapping between record-ids and predefined records allows the QSPY host-resident component to easily recognize and correctly parse all the "pre-defined" records. Most predefined trace records have the timestamp data element (see SRS_QP_QS_10), but some (e.g., dictionary trace records) do not.

Use Case
Predefined trace records are used for tracing instrumentation embedded in the QP/C++ Framework component, such as state machine activity (dispatching events, entering/exiting a state, executing transitions, etc.), Active Object activity (allocating events, posting/publishing events, time events, etc.), and more.

Forward Traceability (truncated to 2 level(s))



SRS_QP_QS_31

QS target-resident component shall support application-specific trace records.

Description
Application-specific trace records have a flexible format not known in advance to the QSPY host-resident component. Instead, application-specific trace records carry the format information in them (which makes them somewhat less efficient than predefined trace records). The record-ids of application-specific trace records are in the range 101-127, and are used only for the Local-Filter (see SRS_QP_QS_20). However, the record-ids in this case do not determine any specific format of the application-specific record. In other words, many application-specific trace records can have the same record ID. All application-specific trace records have the timestamp data element (see SRS_QP_QS_10).

Use Case
Application-specific trace records are used for tracing instrumentation embedded in the QP/C++ Applications. Their flexible format allows the QP/C++ Application to add arbitrary information to the software trace.

Forward Traceability (truncated to 2 level(s))



SRS_QP_QS_40

QS target-resident component shall provide symbolic information in the trace using dictionary trace records.

Description
The QS target-resident component provides special predefined dictionary trace records designed expressly for providing the symbolic information about the target code in the trace itself. These dictionary records are similar to the symbolic information embedded in the object files for the traditional single-step debugger. QS supports five types of dictionary trace records:

  1. object dictionary
  2. function dictionary
  3. signal dictionary
  4. enumeration dictionary
  5. user dictionary (for the application-specific trace records)

Forward Traceability (truncated to 2 level(s))



SRS_QP_QS_50

QS target-resident component shall provide the receive channel to allow interaction between the host and the target.

Description
A QS-RX channel is required for interacting with the target system and implementing such features as testing, validation, verification, and monitoring of the target system. The QS-RX channel provides the following services:

  • Remotely reset the Target
  • Request target information (version, all sizes of objects, build time-stamp)
  • Execute a user-defined command inside the target with arguments supplied from the QSPY host component
  • Inject an arbitrary event to the target (dispatch, post, or publish)
  • Changing the Global-Filter" inside the target (see @ref SRS_QP_QS_20) - Changing the Local-Filter" inside the target (see SRS_QP_QS_21)
  • Changing the Current-Object inside the target
  • Peek data inside the target memory
  • Poke data into the target memory
  • Fill a specified target memory area with the supplied bit pattern
  • Execute clock tick inside the target
  • Execute test setup inside the target
  • Execute test teardown inside the Target
  • Store a "Test Probe" inside the target

Forward Traceability (truncated to 2 level(s))


Time ManagementNon-Preemptive Kernel