Run-Time Logging

Description

Evaluate and optimize performance of Sensor Controller tasks at full speed

This resource enables the functionality in the Run-Time Logging Panel . The Run-Time Logging Panel is used to evaluate and optimize performance of Sensor Controller tasks running at full speed on a physical CC26xx/CC13xx device.

Data structures are not logged automatically, and run-time logging is not sensitive to ALERT interrupts. Call the run-time logging procedures to control when and which data structures shall be logged to the Run-Time Logging Panel :

  • rtlLogStructs(bvStructs)
  • rtlGetLogMask(bvStructs)
  • rtlCheckLogDone(done)
  • rtlWaitLogDoneUs(timeout)
  • rtlLogCancel()

Except for short delays, the procedure calls have no effect when not performing run-time logging in Sensor Controller Studio.

Examples

Single Data Structure

// Let something happen to the output data structure
output.value += 1;

// Log the output data structure
rtlLogStructs(BV_RTL_LOG_OUTPUT);

Multiple Data Structures

// Log either the output and state data structures, or only the output data structure
if ( ... ) {
    rtlLogStructs(BV_RTL_LOG_OUTPUT | BV_RTL_LOG_STATE);
} else {
    rtlLogStructs(BV_RTL_LOG_OUTPUT);
}

Flow Control

// Log the output data structure, unless there is another still pending log request (100 us timeout)
U16 done;
rtlWaitLogDoneUs(100);
rtlCheckLogDone(done);
if (done != 0) {
    rtlLogStructs(BV_RTL_LOG_OUTPUT);
}

Procedures Overview

Name Brief description
rtlCheckLogDone() Checks whether the last rtlLogStructs() call has taken effect. More …
rtlGetLogMask() Returns which data structures are selected as logged in the Run-Time Logging panel for the current task. More …
rtlLogCancel() Cancels the last rtlLogStructs() call if it has not yet taken effect. More …
rtlLogStructs() Requests that the specified data structures shall be sent to the Sensor Controller Studio Run-Time Logging panel. More …
rtlWaitLogDoneUs() Waits until the last rtlLogStructs() call has taken effect (the requested data structures have been copied from AUX RAM) or the specified timeout expires. More …

Constants

Name Description
BV_RTL_LOG_CFG Log request: Log the cfg data structure
BV_RTL_LOG_INPUT Log request: Log the input data structure
BV_RTL_LOG_OUTPUT Log request: Log the output data structure
BV_RTL_LOG_STATE Log request: Log the state data structure

Global Variables

None.

Procedures

rtlCheckLogDone

Prototype: rtlCheckLogDone(done)

Checks whether the last rtlLogStructs() call has taken effect.

This procedure always returns 1 when not performing run-time logging in Sensor Controller Studio.

Return value(s)

  • done : 1 if it has taken effect or not performing run-time logging, otherwise 0

rtlGetLogMask

Prototype: rtlGetLogMask(bvStructs)

Returns which data structures are selected as logged in the Run-Time Logging panel for the current task.

The procedure returns 0 if called while not performing run-time logging. This can be useful if the task code must behave differently during run-time logging.

Return value(s)

  • bvStructs : Bit-vector that indicates the data structure logging selection in the Run-Time Logging panel (BV_RTL_LOG_XYZ)

rtlLogCancel

Prototype: rtlLogCancel()

Cancels the last rtlLogStructs() call if it has not yet taken effect.

Calling this procedure has no effect when not performing run-time logging in Sensor Controller Studio.

rtlLogStructs

Prototype: rtlLogStructs(bvStructs)

Requests that the specified data structures shall be sent to the Sensor Controller Studio Run-Time Logging panel.

Log requests are masked by the logging selection in the Run-Time Logging panel.

Calling this procedure has no effect when not performing run-time logging in Sensor Controller Studio. Also, including data structures that are not logged in Sensor Controller Studio has no effect.

When using the Multi-Buffered Output Data Exchange resource, log requests for the output data structure will cause all pending buffers to be sent. This also means that an output log request has no effect if there are no pending buffers.

Note that log requests can be lost if this procedure is called before the previous call has taken effect.

Parameter value(s)

  • bvStructs : Bit-vector that indicates the data structures to be logged (BV_RTL_LOG_XYZ)

rtlWaitLogDoneUs

Prototype: rtlWaitLogDoneUs(timeout)

Waits until the last rtlLogStructs() call has taken effect (the requested data structures have been copied from AUX RAM) or the specified timeout expires.

Call rtlCheckLogDone() afterwards to check whether completion or timeout occurred.

Calling this procedure has no effect when not performing run-time logging in Sensor Controller Studio (minimal time consumed).

Parameter value(s)

  • timeout : Timeout value in microseconds (1-32767)