module ti.uia.loggers.LoggerMin

This general purpose logger is useful in situations where a very small memory overhead is required

The logger stores all events in a single buffer with a compact UIAPacket event packet structure that allows them to be sent directly to System Analyzer via JTAG. [ more ... ]
C synopsis target-domain sourced in ti/uia/loggers/LoggerMin.xdc
#include <ti/uia/loggers/LoggerMin.h>
Functions
Void
Void
Void
Void
Functions common to all ILogger modules
Bool 
Bool 
Void 
Void 
Void 
Void 
LoggerMin_write4// Process a log event with 4 arguments(LoggerMin_Handle handle, Log_Event evt, Types_ModuleId mid, IArg a1, IArg a2, IArg a3, IArg a4);
Void 
LoggerMin_write8// Process a log event with 8 arguments(LoggerMin_Handle handle, Log_Event evt, Types_ModuleId mid, IArg a1, IArg a2, IArg a3, IArg a4, IArg a5, IArg a6, IArg a7, IArg a8);
Functions common to all target instances
Functions common to all target modules
Typedefs
typedef struct
typedef struct
typedef struct
typedef enum
Constants
extern const SizeT 
extern const Bool 
 
DETAILS
The logger stores all events in a single buffer with a compact UIAPacket event packet structure that allows them to be sent directly to System Analyzer via JTAG.
LoggerMin was designed to have as minimal impact as possible on an application when calling a Log function. There are several configuration parameters that allow an application to get the optimal performance in exchange for certain restrictions.
Interrupts are disabled during the duration of the log call.
NOTE: It is recommended that you use LoggingSetup to configure the Logger. Set LoggingSetup.loggerType to LoggingSetup.LoggerType_MIN to specify that the Logger is based on LoggerMin.
EXAMPLES
The following XDC configuration statements create a logger module, and assign it as the default logger for all modules.
  var Defaults = xdc.useModule('xdc.runtime.Defaults');
  var Diags = xdc.useModule('xdc.runtime.Diags');
  var LoggerMin = xdc.useModule('ti.uia.loggers.LoggerMin');

  LoggerMin.bufSize = 256;
  LoggerMin.timestampSize = LoggerMin.TimestampSize_32b;
  Defaults.common$.logger = LoggerMin.create();
The following XDC configuration statements show how to use LoggingSetup with LoggerMin.
  var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
  LoggingSetup.loggerType = LoggingSetup.LoggerType_MIN;

 
enum LoggerMin_TimestampSize

Enum of size of timestamps to log with events

C synopsis target-domain
typedef enum LoggerMin_TimestampSize {
    LoggerMin_TimestampSize_NONE,
    // No timestamps will be logged with events
    LoggerMin_TimestampSize_32b,
    // 32-bit timestamp
    LoggerMin_TimestampSize_64b
    // 64-bit timestamp
} LoggerMin_TimestampSize;
 
 
config LoggerMin_bufSize  // module-wide

LoggerMin buffer size in MAUs (Minimum Addressable Units e.g. Bytes)

C synopsis target-domain
extern const SizeT LoggerMin_bufSize;
 
DETAILS
The buffer size must be less than 65536 bytes.
NOTE: the buffer size must contain an integer number of 32-bit words (e.g. if a MAU = 1 byte, then the buffer size must be a multiple of 4). The buffer size must also be at least maxEventSize + 64.
 
config LoggerMin_supportLoggerDisable  // module-wide

Allow Logger instances to be enabled/disabled during runtime

C synopsis target-domain
extern const Bool LoggerMin_supportLoggerDisable;
 
DETAILS
LoggerMin footprint is smaller when supportLoggerDisable is false.
 
config LoggerMin_timestampSize  // module-wide

Configure the size of the timestamp to use. For minimum event footprint, configure as TimestampSize_32b (default)

C synopsis target-domain
extern const LoggerMin_TimestampSize LoggerMin_timestampSize;
 
DETAILS
Having a timestamp allows an instrumentation host (e.g. System Analyzer) to display events with the correct system time.
Module-Wide Built-Ins

C synopsis target-domain
Types_ModuleId LoggerMin_Module_id();
// Get this module's unique id
 
Bool LoggerMin_Module_startupDone();
// Test if this module has completed startup
 
IHeap_Handle LoggerMin_Module_heap();
// The heap from which this module allocates memory
 
Bool LoggerMin_Module_hasMask();
// Test whether this module has a diagnostics mask
 
Bits16 LoggerMin_Module_getMask();
// Returns the diagnostics mask for this module
 
Void LoggerMin_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
Instance Object Types

C synopsis target-domain
typedef struct LoggerMin_Object LoggerMin_Object;
// Opaque internal representation of an instance object
 
typedef LoggerMin_Object *LoggerMin_Handle;
// Client reference to an instance object
 
typedef struct LoggerMin_Struct LoggerMin_Struct;
// Opaque client structure large enough to hold an instance object
 
LoggerMin_Handle LoggerMin_handle(LoggerMin_Struct *structP);
// Convert this instance structure pointer into an instance handle
 
LoggerMin_Struct *LoggerMin_struct(LoggerMin_Handle handle);
// Convert this instance handle into an instance structure pointer
Instance Config Parameters

C synopsis target-domain
typedef struct LoggerMin_Params {
// Instance config-params structure
    IInstance_Params *instance;
    // Common per-instance configs
} LoggerMin_Params;
 
Void LoggerMin_Params_init(LoggerMin_Params *params);
// Initialize this config-params structure with supplier-specified defaults before instance creation
Runtime Instance Creation

C synopsis target-domain
LoggerMin_Handle LoggerMin_create(const LoggerMin_Params *params, Error_Block *eb);
// Allocate and initialize a new instance object and return its handle
 
Void LoggerMin_construct(LoggerMin_Struct *structP, const LoggerMin_Params *params);
// Initialize a new instance object inside the provided structure
ARGUMENTS
params — per-instance config params, or NULL to select default values (target-domain only)
eb — active error-handling block, or NULL to select default policy (target-domain only)
Instance Deletion

C synopsis target-domain
Void LoggerMin_delete(LoggerMin_Handle *handleP);
// Finalize and free this previously allocated instance object, setting the referenced handle to NULL
 
Void LoggerMin_destruct(LoggerMin_Struct *structP);
// Finalize the instance object inside the provided structure
 
LoggerMin_disable()  // instance

Disable a log

C synopsis target-domain
Bool LoggerMin_disable(LoggerMin_Handle handle);
 
ARGUMENTS
handle — handle of a previously-created LoggerMin instance object
DETAILS
Events written to a disabled log are silently discarded.
RETURNS
The function returns the state of the log (TRUE if enabled, FALSE if disabled) before the call. This return value allows clients to restore the previous state. Note: not thread safe.
 
LoggerMin_enable()  // instance

Enable a log

C synopsis target-domain
Bool LoggerMin_enable(LoggerMin_Handle handle);
 
ARGUMENTS
handle — handle of a previously-created LoggerMin instance object
RETURNS
The function returns the state of the log (TRUE if enabled, FALSE if disabled) before the call. This return value allows clients to restore the previous state. Note: not thread safe.
 
LoggerMin_write0()  // instance

Process a log event with 0 arguments

C synopsis target-domain
Void LoggerMin_write0(LoggerMin_Handle handle, Log_Event evt, Types_ModuleId mid);
 
ARGUMENTS
handle — handle of a previously-created LoggerMin instance object
DETAILS
Same as write4 except with 0 arguments rather than 4.
SEE
 
LoggerMin_write1()  // instance

Process a log event with 1 argument

C synopsis target-domain
Void LoggerMin_write1(LoggerMin_Handle handle, Log_Event evt, Types_ModuleId mid, IArg a1);
 
ARGUMENTS
handle — handle of a previously-created LoggerMin instance object
DETAILS
Same as write4 except with 1 arguments rather than 4.
SEE
 
LoggerMin_write2()  // instance

Process a log event with 2 arguments

C synopsis target-domain
Void LoggerMin_write2(LoggerMin_Handle handle, Log_Event evt, Types_ModuleId mid, IArg a1, IArg a2);
 
ARGUMENTS
handle — handle of a previously-created LoggerMin instance object
DETAILS
Same as write4 except with 2 arguments rather than 4.
SEE
 
LoggerMin_write4()  // instance

Process a log event with 4 arguments

C synopsis target-domain
Void LoggerMin_write4(LoggerMin_Handle handle, Log_Event evt, Types_ModuleId mid, IArg a1, IArg a2, IArg a3, IArg a4);
 
ARGUMENTS
handle — handle of a previously-created LoggerMin instance object
evt — event to be logged
mid — module ID of the module which logged the event
a1 — arbitrary argument passed by caller
DETAILS
The evt argument is of type Log.Event, which encodes the Log.EventId, the Diags.Mask, and the Diags.EventLevel of the event. The event ID can be obtained via Types.getEventId(evt), the Diags mask can be obtained via Diags.getMask(evt), and the event level can be obtained via Diags.getLevel(evt).
The modId argument is the module ID of the module that logged the event.
The event information can be used by the logger to handle different events specially. For example, the event ID can be used to compare against other known Log.Events.
      if (Log_getEventId(MY_EVENT) == Log_getEventId(evt)) {
          :
      }
The Diags mask and event level can be used for filtering of events based on event level (see IFilterLogger), or even routing events to separate loggers based on diags category (see, for example, LoggerBuf.statusLogger).
The Diags mask and event level are useful for handling the event, but are generally not recorded by the logger because they are not needed in decoding and displaying the event. A more suitable value to record is a Types.Event, which encodes the event ID and module ID. For example, the Log.EventRec type stores a Types.Event in its record definition. A Types.Event can be created using the Types.makeEvent API given the event ID and module ID.
The event ID value of 0 is used to indicate an event triggered by a call to one of the Log_print[0-6] methods. These methods take a format string rather than a Log_Event argument and, as a result, the event ID encoded in evt is 0 and the parameter a1 is the format string.
Non-zero event IDs can also be used to access the msg string associated with the Log.EventDesc that originally defined the Log event.
      Log_EventId id = Log_getEventId(evt));
      if (id != 0) {
          String msg = Text_ropeText(id);
          System_aprintf(msg, a1, a2, a3, a4);
      }
This works because an event's ID is simply an offset into a table of characters (maintained by the Text module) containing the event's msg string.
The arguments a1, a2, etc. are parameters that are to be interpreted according to the message format string associated with evt.
SEE
 
LoggerMin_write8()  // instance

Process a log event with 8 arguments

C synopsis target-domain
Void LoggerMin_write8(LoggerMin_Handle handle, Log_Event evt, Types_ModuleId mid, IArg a1, IArg a2, IArg a3, IArg a4, IArg a5, IArg a6, IArg a7, IArg a8);
 
ARGUMENTS
handle — handle of a previously-created LoggerMin instance object
DETAILS
Same as write4 except with 8 arguments rather than 4.
SEE
Instance Convertors

C synopsis target-domain
ILogger_Handle LoggerMin_Handle_upCast(LoggerMin_Handle handle);
// unconditionally move one level up the inheritance hierarchy
 
LoggerMin_Handle LoggerMin_Handle_downCast(ILogger_Handle handle);
// conditionally move one level down the inheritance hierarchy; NULL upon failure
Instance Built-Ins

C synopsis target-domain
Int LoggerMin_Object_count();
// The number of statically-created instance objects
 
LoggerMin_Handle LoggerMin_Object_get(LoggerMin_Object *array, Int i);
// The handle of the i-th statically-created instance object (array == NULL)
 
LoggerMin_Handle LoggerMin_Object_first();
// The handle of the first dynamically-created instance object, or NULL
 
LoggerMin_Handle LoggerMin_Object_next(LoggerMin_Handle handle);
// The handle of the next dynamically-created instance object, or NULL
 
IHeap_Handle LoggerMin_Object_heap();
// The heap used to allocate dynamically-created instance objects
 
Types_Label *LoggerMin_Handle_label(LoggerMin_Handle handle, Types_Label *buf);
// The label associated with this instance object
 
String LoggerMin_Handle_name(LoggerMin_Handle handle);
// The name of this instance object
 
Configuration settings sourced in ti/uia/loggers/LoggerMin.xdc
var LoggerMin = xdc.useModule('ti.uia.loggers.LoggerMin');
module-wide constants & types
 
    var obj = new LoggerMin.RecordView// ;
        obj.sequence = Int  ...
        obj.timestampRaw = Long  ...
        obj.modName = String  ...
        obj.text = String  ...
        obj.eventId = Int  ...
        obj.eventName = String  ...
        obj.arg0 = IArg  ...
        obj.arg1 = IArg  ...
        obj.arg2 = IArg  ...
        obj.arg3 = IArg  ...
        obj.arg4 = IArg  ...
        obj.arg5 = IArg  ...
        obj.arg6 = IArg  ...
        obj.arg7 = IArg  ...
 
        obj.instanceId = Int  ...
module-wide config parameters
 
module-wide functions
per-instance config parameters
    var params = new LoggerMin.Params// Instance config-params object;
per-instance creation
    var inst = LoggerMin.create// Create an instance-object(params);
 
 
enum LoggerMin.TimestampSize

Enum of size of timestamps to log with events

Configuration settings
values of type LoggerMin.TimestampSize
    const LoggerMin.TimestampSize_NONE;
    // No timestamps will be logged with events
    const LoggerMin.TimestampSize_32b;
    // 32-bit timestamp
    const LoggerMin.TimestampSize_64b;
    // 64-bit timestamp
 
C SYNOPSIS
 
metaonly struct LoggerMin.RecordView
Configuration settings
var obj = new LoggerMin.RecordView;
 
    obj.sequence = Int  ...
    obj.timestampRaw = Long  ...
    obj.modName = String  ...
    obj.text = String  ...
    obj.eventId = Int  ...
    obj.eventName = String  ...
    obj.arg0 = IArg  ...
    obj.arg1 = IArg  ...
    obj.arg2 = IArg  ...
    obj.arg3 = IArg  ...
    obj.arg4 = IArg  ...
    obj.arg5 = IArg  ...
    obj.arg6 = IArg  ...
    obj.arg7 = IArg  ...
 
 
metaonly struct LoggerMin.RtaData

Data added to the RTA MetaData file to support System Analyzer

Configuration settings
var obj = new LoggerMin.RtaData;
 
    obj.instanceId = Int  ...
 
 
config LoggerMin.bufSize  // module-wide

LoggerMin buffer size in MAUs (Minimum Addressable Units e.g. Bytes)

Configuration settings
LoggerMin.bufSize = SizeT 512;
 
DETAILS
The buffer size must be less than 65536 bytes.
NOTE: the buffer size must contain an integer number of 32-bit words (e.g. if a MAU = 1 byte, then the buffer size must be a multiple of 4). The buffer size must also be at least maxEventSize + 64.
C SYNOPSIS
 
config LoggerMin.supportLoggerDisable  // module-wide

Allow Logger instances to be enabled/disabled during runtime

Configuration settings
LoggerMin.supportLoggerDisable = Bool false;
 
DETAILS
LoggerMin footprint is smaller when supportLoggerDisable is false.
C SYNOPSIS
 
config LoggerMin.timestampSize  // module-wide

Configure the size of the timestamp to use. For minimum event footprint, configure as TimestampSize_32b (default)

Configuration settings
 
DETAILS
Having a timestamp allows an instrumentation host (e.g. System Analyzer) to display events with the correct system time.
C SYNOPSIS
 
metaonly config LoggerMin.bufSection  // module-wide

Section name for the buffer managed by the static instance

Configuration settings
LoggerMin.bufSection = String null;
 
DETAILS
The default section is the 'dataMemory' in the platform.
 
metaonly config LoggerMin.common$  // module-wide

Common module configuration parameters

Configuration settings
LoggerMin.common$ = Types.Common$ undefined;
 
DETAILS
All modules have this configuration parameter. Its name contains the '$' character to ensure it does not conflict with configuration parameters declared by the module. This allows new configuration parameters to be added in the future without any chance of breaking existing modules.
 
metaonly config LoggerMin.memoryAlignmentInMAUs  // module-wide

Memory Alignment in MAUs (Minimum Addressable Units)

Configuration settings
LoggerMin.memoryAlignmentInMAUs = Int 1;
 
DETAILS
Specifies alignment to use when allocating the internal packet buffer Set to 1 if no alignment is required.
 
metaonly LoggerMin.getMetaArgs()  // module-wide

Returns any meta data needed to support RTA

Configuration settings
LoggerMin.getMetaArgs(Any inst, Any instNum) returns Any
 
DETAILS
This meta data should be returned in the form of a structure which can be converted into XML. This data is added to the RTA XML file during the application's configuration, and can be accessed later through the xdc.rta.MetaData module.
The MetaData is returned per instance of the ILogger module. The instance object is passed to the function as the first argument.
The second argument is the index of the instance in the list of the ILogger's static instances.
Instance Config Parameters

Configuration settings
var params = new LoggerMin.Params;
// Instance config-params object
Static Instance Creation

Configuration settings
var params = new LoggerMin.Params;
// Allocate instance config-params
params.config =   ...
// Assign individual configs
 
var inst = LoggerMin.create(params);
// Create an instance-object
ARGUMENTS
params — per-instance config params, or NULL to select default values (target-domain only)
eb — active error-handling block, or NULL to select default policy (target-domain only)
generated on Tue, 14 Feb 2017 00:15:13 GMT