metaonly module ti.uia.sysbios.LoggingSetup

Module to aid in configuring TI-RTOS logging using UIA and System Analyzer

The LoggingSetup module automates the process of configuring an application to use UIA events, and configures TI-RTOS modules to capture user-specified information such as CPU Load, Task Load and Task Execution so that it can be displayed by System Analyzer. It also automates the creation of infrastructure modules such as loggers, the ServiceManager and RTA modules to enable the capture and upload of the events over a user-specified transport. Both JTAG and Non-JTAG transports are supported. [ more ... ]
Configuration settings sourced in ti/uia/sysbios/LoggingSetup.xdc
var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
module-wide constants & types
 
    values of type LoggingSetup.TimestampSize// 
module-wide config parameters
 
DETAILS
The LoggingSetup module automates the process of configuring an application to use UIA events, and configures TI-RTOS modules to capture user-specified information such as CPU Load, Task Load and Task Execution so that it can be displayed by System Analyzer. It also automates the creation of infrastructure modules such as loggers, the ServiceManager and RTA modules to enable the capture and upload of the events over a user-specified transport. Both JTAG and Non-JTAG transports are supported.
The following configuration script demonstrates the use of the LoggingSetup module in the XDC configuration file for the application:
EXAMPLE
Example 1: Configuring an application to use the default settings provided by LoggingSetup. The following default settings are automatically applied:
  • Logging UIA events from user-provided C code. User provided C code is treated as part of the xdc.runtime.Main module. A circular buffer of size mainLoggerSize Bytes is enabled by default to support this.
  • Event logging is enabled for the TI-RTOS Load and Task modules in order to allow System Analyzer to display CPU Load, and Task Execution information. Logging of SWI and HWI events is disabled by default. In order to optimize event capture and minimize event loss, three loggers are created: one to store events from the TI-RTOS Load module another to store events from other TI-RTOS modules, and the third to store user Log events.
  • The events will be logged to LoggerStopMode loggers, and will be uploaded over JTAG when the target halts.
  // the Log module provides logging APIs for use by the user's software
  var Log = xdc.useModule('xdc.runtime.Log');
  // the LoggingSetup module's default settings configure much of the UIA infrastructure.
  var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');

Example 2: Use all the default settings of LoggingSetup, except use the minimal footprint logger, LoggerMin. The following settings will be applied:
  • Logging UIA events from user-provided C code.
  • Event logging is enabled for the TI-RTOS Load and Task modules, and disabled for SWI and HWI.
  • The events will be logged via LoggerMin, and will be uploaded over JTAG when the target halts.
  • All events will be logged into one buffer whose default sise is ti.uia.loggers.LoggerMin.bufSize
 
enum LoggingSetup.LoggerType

Enum of the type of loggers that can be used

Configuration settings
values of type LoggingSetup.LoggerType
    const LoggingSetup.LoggerType_MIN;
    // LoggerMin - Minimal footprint logger (JTAG only)
    const LoggingSetup.LoggerType_STOPMODE;
    // LoggerStopMode (JTAG only)
    const LoggingSetup.LoggerType_JTAGRUNMODE;
    // LoggerRunMode JTAG (c6x only)
    const LoggingSetup.LoggerType_RUNMODE;
    // LoggerRunMode ETHERNET upload
    const LoggingSetup.LoggerType_IDLE;
    // LoggerIdle - Upload in Idle loop
    const LoggingSetup.LoggerType_STREAMER2;
    // LoggerStreamer2 - Application manages logger buffers
 
 
enum LoggingSetup.TimestampSize
Configuration settings
values of type LoggingSetup.TimestampSize
    const LoggingSetup.TimestampSize_AUTO;
    // Use the logger's default timestamp size
    const LoggingSetup.TimestampSize_NONE;
    // No timestamps logged with events
    const LoggingSetup.TimestampSize_32b;
    // 32-bit timestamps
    const LoggingSetup.TimestampSize_64b;
    // 64-bit timestamps
 
 
config LoggingSetup.benchmarkLogging  // module-wide

Enable logging of benchmark events

Configuration settings
LoggingSetup.benchmarkLogging = Bool false;
 
DETAILS
If this is false, the events will be disabled. Otherwise the events will be enabled.
 
config LoggingSetup.countingAndGraphingLogging  // module-wide

Enable logging of counting and graphing events

Configuration settings
LoggingSetup.countingAndGraphingLogging = Bool false;
 
DETAILS
If this is false, the events will be disabled. Otherwise the events will be enabled.
 
config LoggingSetup.cpuId  // module-wide

CPU ID to put in the packet header as the endpoint ID

Configuration settings
LoggingSetup.cpuId = Int 0;
 
DETAILS
Not required for C6X or C7X devices (uses DNUM).
 
config LoggingSetup.enableContextAwareFunctionProfiler  // module-wide

Enable System Analyzer's Context Aware Function Profiler

Configuration settings
LoggingSetup.enableContextAwareFunctionProfiler = Bool false;
 
DETAILS
Setting to true enables function entry and exit logging in order to generate function profiling information. This requires that the compiler's function entry and exit hook functions be enabled.
 
config LoggingSetup.enableTaskProfiler  // module-wide

Enable System Analyzer's Task Profiler

Configuration settings
LoggingSetup.enableTaskProfiler = Bool false;
 
DETAILS
Setting enableTaskProfiler to true enables task, hwi and swi entry and exit logging in order to generate profiling information
 
config LoggingSetup.loadHwiLogging  // module-wide

Enable Hardware Interrupt (Hwi) event logging

Configuration settings
LoggingSetup.loadHwiLogging = Bool false;
 
DETAILS
If this is false, the Hwi load events will be disabled. Otherwise the events will be enabled. Use the loadLoggingRuntimeControl parameter to determine whether the state can be modified during runtime.
 
config LoggingSetup.loadLogger  // module-wide

User-created logger used for the Load module Log events

Configuration settings
LoggingSetup.loadLogger = ILogger.Handle null;
 
DETAILS
Leave null to have LoggingSetup automatically create the loadLogger if required.
 
config LoggingSetup.loadLoggerSize  // module-wide

Size (in MAUs) of the packet used to upload the Load module Log events

Configuration settings
LoggingSetup.loadLoggerSize = SizeT 512;
 
 
config LoggingSetup.loadLogging  // module-wide

Enable CPU load event logging

Configuration settings
LoggingSetup.loadLogging = Bool true;
 
DETAILS
If loadLogging is false, CPU Load events will be disabled, otherwise the events will be logged. Use the loadLoggingRuntimeControl parameter to determine whether the state can be modified during runtime.
 
config LoggingSetup.loadLoggingRuntimeControl  // module-wide

Specify whether load logging can be enabled / disabled at runtime

Configuration settings
LoggingSetup.loadLoggingRuntimeControl = Bool false;
 
DETAILS
This determines what Diags settings are applied to the module's Diags mask. If 'false', the Diags bits will be configured as ALWAYS_ON, meaning they can't be changed at runtime. If 'true', the bits will be configured as 'RUNTIME_ON'.
Use the loadLogging parameter to determine whether the event is ON or OFF. For example, the following two lines set the Load module's events to 'ALWAYS_ON'.
  LoggingSetup.loadLogging = true;
  LoggingSetup.loadLoggingRuntimeControl = false;
 
config LoggingSetup.loadSwiLogging  // module-wide

Enable Software Interrupt (Swi) event logging

Configuration settings
LoggingSetup.loadSwiLogging = Bool false;
 
DETAILS
If this is false, the Swi load events will be disabled. Otherwise the events will be enabled. Use the loadLoggingRuntimeControl parameter to determine whether the state can be modified during runtime.
 
config LoggingSetup.loadTaskLogging  // module-wide

Enable Task load logging

Configuration settings
LoggingSetup.loadTaskLogging = Bool false;
 
DETAILS
If this is false, the Task load events will be disabled. Otherwise the events will be enabled. Use the loadLoggingRuntimeControl parameter to determine whether the state can be modified during runtime.
 
config LoggingSetup.loggerType  // module-wide

Configures the type of logger to use

Configuration settings
 
 
config LoggingSetup.mainLogger  // module-wide

Logger used for application Log events

Configuration settings
LoggingSetup.mainLogger = ILogger.Handle null;
 
DETAILS
Leave null to have LoggingSetup automatically create the mainLogger if required.
 
config LoggingSetup.mainLoggerSize  // module-wide

Size (in MAUs) of packet used for application Log events

Configuration settings
LoggingSetup.mainLoggerSize = SizeT 1024;
 
 
config LoggingSetup.mainLogging  // module-wide

Enable logging of application code

Configuration settings
LoggingSetup.mainLogging = Bool true;
 
DETAILS
If mainLogging is false, application logging will be disabled, otherwise it will be enabled. Use the mainLoggingRuntimeControl parameter to determine whether the state can be modified during runtime. Together, these two configuration parameters will be used to initialize the xdc.runtime.Main Diags mask.
The table below shows the initial values of the xdc.runtime.Main Diags mask settings, based on mainLogging and mainLoggingRuntimeControl configuration. These settins only apply to Diags masks that have not been set in the application's configuration file. For example, this configuration code would cause xdc.runtime.Main's USER1 Diags mask to be unaffected by the settings of mainLogging and mainLoggingRuntimeControl:
  Diags.setMaskMeta('xdc.runtime.Main', Diags.USER1, Diags.RUNTIME_ON);

Diags Mask Settings for xdc.runtime.Main

mainLoggingRuntimeControl
true false
mainLogging true RUNTIME_ON ALWAYS_ON
false RUNTIME_OFF ALWAYS_OFF
 
config LoggingSetup.mainLoggingRuntimeControl  // module-wide

Specify whether application logging can be enabled / disabled at runtime

Configuration settings
LoggingSetup.mainLoggingRuntimeControl = Bool true;
 
DETAILS
This parameter, together with mainLogging, determine the initial xdc.runtime.Diags settings applied to xdc.runtime.Main. If 'false' and mainLogging is true, the diags bits will be configured as ALWAYS_ON, meaning they can't be changed at runtime. If 'true', the bits will be configured as 'RUNTIME_ON'.
Use the mainLogging parameter to determine whether the event is ON or OFF. For example, the following two lines set the xdc.runtime.Main events to initially be 'RUNTIME_ON'.
  LoggingSetup.mainLogging = true;
  LoggingSetup.mainLoggingRuntimeControl = true;
 
config LoggingSetup.maxEventSize  // module-wide

For Snapshot events with loggers that support the writeMemoryRange API, this specifies the maximum event size (in Maus) that can be written with a single event. Must be less than or equal to the logger's buffer size - 64

Configuration settings
LoggingSetup.maxEventSize = SizeT 128;
 
DETAILS
The logger's writeMemoryRange API checks to see if the event size required to write the block of memory is larger than maxEventSize. If so, it will split the memory range up into a number of smaller blocks and log the blocks using separate events with a common snapshot ID in order to allow the events to be collated and the original memory block to be reconstructed on the host.
 
config LoggingSetup.memorySectionName  // module-wide

Memory section name for the buffer managed by the static instance (default is null)

Configuration settings
LoggingSetup.memorySectionName = String null;
 
DETAILS
By default the local 'dataMemory' in the platform is used (typically SRAM or L2SRAM). The available memory section names for your device can be determined by either looking in the MEMORY CONFIGURATION section of the .map file that is generated when you build your application or from the Platform file that your application is using.
 
config LoggingSetup.multicoreEventCorrelation  // module-wide

Set to true for multi-core applications

Configuration settings
LoggingSetup.multicoreEventCorrelation = Bool false;
 
DETAILS
When set to true, the LoggingSetup module will automatically include the LogSync module. The LogSync module is required for events from multiple CPU cores to be correlated with each other.
SEE
 
config LoggingSetup.numCores  // module-wide

Number of cores running the same image with an instance in shared memory

Configuration settings
LoggingSetup.numCores = Int 1;
 
DETAILS
A common use case is to have the same binary image (e.g. .out file) run on multiple cores of a multi-core device. This causes a problem if the logger's buffers are in shared memory (e.g. DDR). Since the image is the same for all the cores, each core will attempt to write to the same buffer in the shared memory. To avoid this, either place the logger's buffers in non-shared memory, or set the numCores parameter to the number of cores on the device.
Note: Use the bufSection along with the Program.sectMap to place a logger instance's buffer into specific memory.
Setting numCores to a value greater than 1 signals the logger to statically set aside additional memory ((x numCores), allowing each core to have the logger's configured buffer size amount of memory.
Warning: Setting this parameter to a value greater than one should only be done when there is a single image used on multiple cores of a multi-core device AND the logger instance's buffer is in shared memory. While functionally it will still work, memory will be wasted if both these conditions are not met.
The default is 1, which means do not reserve any additional memory for the logger.
 
config LoggingSetup.profileLogging  // module-wide

Enable logging of function profiling events

Configuration settings
LoggingSetup.profileLogging = Bool false;
 
DETAILS
If this is false, the events will be disabled. Otherwise the events will be enabled.
 
config LoggingSetup.snapshotLogging  // module-wide

Enable logging of snapshot events

Configuration settings
LoggingSetup.snapshotLogging = Bool false;
 
DETAILS
If this is false, the events will be disabled. Otherwise the events will be enabled.
 
config LoggingSetup.syncLoggerSize  // module-wide

Size (in MAUs) of the logger used for the LogSync modules' sync point events

Configuration settings
LoggingSetup.syncLoggerSize = SizeT LogSync.defaultSyncLoggerSize;
 
 
config LoggingSetup.sysbiosHwiLogging  // module-wide

Enable the SYSBIOS Hwi and Clock modules' event logging

Configuration settings
LoggingSetup.sysbiosHwiLogging = Bool false;
 
DETAILS
If false, Hwi and Clock events will be disabled, otherwise the events will be enabled. Use the sysbiosHwiLoggingRuntimeControl parameter to determine whether the state can be modified during runtime.
 
config LoggingSetup.sysbiosHwiLoggingRuntimeControl  // module-wide

Specify whether Hwi and Clock logging can be enabled / disabled at runtime

Configuration settings
LoggingSetup.sysbiosHwiLoggingRuntimeControl = Bool false;
 
DETAILS
This parameter, together with sysbiosHwiLogging, determine the initial Diags settings applied to the SYSBIOS Hwi and Clock modules. For example, the following two lines set the Hwi and Clock modules' events to 'ALWAYS_ON'.
  LoggingSetup.sysbiosHwiLogging = true;
  LoggingSetup.sysbiosHwiLoggingRuntimeControl = false;
 
config LoggingSetup.sysbiosLogger  // module-wide

Logger used for SYSBIOS modules' Log events

Configuration settings
LoggingSetup.sysbiosLogger = ILogger.Handle null;
 
DETAILS
Leave null to have LoggingSetup automatically create the sysbiosLogger if required.
 
config LoggingSetup.sysbiosLoggerSize  // module-wide

Size (in MAUs) of the packet used for the TI-RTOS modules' Log events

Configuration settings
LoggingSetup.sysbiosLoggerSize = SizeT 1024;
 
 
config LoggingSetup.sysbiosSemaphoreLogging  // module-wide

Enable the SYSBIOS Semaphore module's event logging

Configuration settings
LoggingSetup.sysbiosSemaphoreLogging = Bool false;
 
DETAILS
If false, Semaphore events will be disabled, otherwise the events will be enabled. Use the sysbiosSemaphoreLoggingRuntimeControl parameter to determine whether the state can be modified during runtime.
 
config LoggingSetup.sysbiosSemaphoreLoggingRuntimeControl  // module-wide

Specify whether Semaphore logging can be enabled / disabled at runtime

Configuration settings
LoggingSetup.sysbiosSemaphoreLoggingRuntimeControl = Bool false;
 
DETAILS
This parameter, together with sysbiosSemaphoreLogging, determine the initial Diags settings applied to the SYSBIOS Semaphore module. For example, the following code initializes the Semaphore module's events to 'RUNTIME_OFF'.
  LoggingSetup.sysbiosSemaphoreLogging= false;
  LoggingSetup.sysbiosSemaphoreLoggingRuntimeControl = true;
 
config LoggingSetup.sysbiosSwiLogging  // module-wide

Enable SYSBIOS Swi module's event logging

Configuration settings
LoggingSetup.sysbiosSwiLogging = Bool false;
 
DETAILS
If false, Swi events will be disabled, otherwise the events will be enabled. Use the sysbiosSwiLoggingRuntimeControl parameter to determine whether the state can be modified during runtime.
 
config LoggingSetup.sysbiosSwiLoggingRuntimeControl  // module-wide

Specify whether Swi logging can be enabled / disabled at runtime

Configuration settings
LoggingSetup.sysbiosSwiLoggingRuntimeControl = Bool false;
 
DETAILS
This parameter, together with sysbiosSwiLogging, determine the initial Diags settings applied to the SYSBIOS Swi module. For example, the following two lines initialize the Swi module's events to 'RUNTIME_OFF'.
  LoggingSetup.sysbiosSwiLogging = false;
  LoggingSetup.sysbiosSwiLoggingRuntimeControl = true;
 
config LoggingSetup.sysbiosTaskLogging  // module-wide

Enable the SYSBIOS Task module's event logging

Configuration settings
LoggingSetup.sysbiosTaskLogging = Bool true;
 
DETAILS
If false, Task events will be disabled, otherwise the events will be enabled. Use the sysbiosTaskLoggingRuntimeControl parameter to determine whether the state can be modified during runtime.
 
config LoggingSetup.sysbiosTaskLoggingRuntimeControl  // module-wide

Specify whether Task logging can be enabled / disabled at runtime

Configuration settings
LoggingSetup.sysbiosTaskLoggingRuntimeControl = Bool true;
 
DETAILS
This parameter, together with sysbiosTaskLogging, determine the initial Diags settings applied to the Task module. For example, the following two lines initialize the Task module's events to 'ALWAYS_ON'.
  LoggingSetup.sysbiosTaskLogging = true;
  LoggingSetup.sysbiosTaskLoggingRuntimeControl = false;
 
config LoggingSetup.timestampSize  // module-wide

Size of the timestamps logged with the events. Set to TimestampSize_NONE to disable timestamps

Configuration settings
 
generated on Tue, 14 Feb 2017 00:15:20 GMT