module ti.uia.events.UIAFrameCtx

index URL

UIA Frame Context Instrumentation

*       C synopsis

*  Individual elements

*       DETAILS

*       EXAMPLES

The UIAFrameCtx module defines context change events and methods that allow tooling to identify frame context switches and to enable frame-aware filtering, trace and analysis. more ... ]

C synopsis

target-domain

sourced in ti/uia/events/UIAFrameCtx.xdc

#include <ti/uia/events/UIAFrameCtx.h>

Functions

macro UInt 

Bool 

UInt 

Typedefs

typedef Bool 

Constants

extern const Log_Event 

extern const Bits16 

extern const Bits16 

 

DETAILS

The UIAFrameCtx module defines context change events and methods that allow tooling to identify frame context switches and to enable frame-aware filtering, trace and analysis.

It inherits IUIACtx, which defines a function pointer to an isLoggingEnabled function which, if configured to point to a function, will evaluate the function prior to logging the context change event and will determine whether to log the event based on the return value of the function. If the function is not configured, logging will be conditional upon ti_uia_runtime_CtxFilter_gIsLoggingEnabled.

The generation of UIAFrameCtx events is also controlled by a module's diagnostics mask, which is described in details in xdc.runtime.Diags. UIAFrameCtx` events are generated only when the Diags.ANALYSIS bit is set in the module's diagnostics mask.

The following configuration script demonstrates how the application might control the logging of ANALYSIS events embedded in the Mod module at configuration time. In this case, the configuration script arranges for the Log statements within modules to always generate ANALYSIS events. Without these configuration statements, no ANALYSIS events would be generated by any modules.

EXAMPLES

Example 1: The following example shows how to turn on and off logging of ANALYSIS events from the application source code. See the Diags_setMask() function for details on specifying the control string.

  // turn on logging of ANALYSIS events in the module
  Diags_setMask("my.pkg.Mod+Z");
 
  // turn off logging of ANALYSIS events in the module
  Diags_setMask("my.pkg.Mod-Z");

 

typedef UIAFrameCtx_IsLoggingEnabledFxn

index URL

C synopsis

target-domain

typedef Bool (*UIAFrameCtx_IsLoggingEnabledFxn)(Int);

 

 

config UIAFrameCtx_ENABLEMASK  // module-wide

index URL

Ctx Filter Enable Mask

C synopsis

target-domain

extern const Bits16 UIAFrameCtx_ENABLEMASK;

 

DETAILS

configures which bit of the ti_uia_runtime_CtxFilter_gFlags is assigned to control context aware filtering for frame context changes. Must be configured with a value that is 2**SYNCID.

 

config UIAFrameCtx_SYNCID  // module-wide

index URL

Trace Synchronization ID

C synopsis

target-domain

extern const Bits16 UIAFrameCtx_SYNCID;

 

DETAILS

configures the value to be written into the 4 bit context change type field used by the UIASync trace synchronization

 

config UIAFrameCtx_ctxChg  // module-wide

index URL

Frame Context Change event

C synopsis

target-domain

extern const Log_Event UIAFrameCtx_ctxChg;

 

VALUES

fmt — a constant string that describes the context change and provides a format specifier for newFrameId

newFrameId — an integer which uniquely identifies the new context

DETAILS

Used to log the start of a new frame If ti_uia_events_UIAFrameCtx_isLoggingEnabledFxn is not NULL it is called and its return value determines whether logging is enabled or not.

EXAMPLE

The following C code shows how to log a Context Change event that identifies a new Frame ID

  #include <ti/uia/runtime/LogCtxChg.h>
  ...
  Void processFrame(Int frameId){
    ...
    LogCtxChg_frame("New Frame ID=0x%x",frameId);
    ...
  }

This event prints the Log call site (%$F) and a format string (%$S) which is recursively formatted with any addition arguments. The following text is an example of what will be displayed for the event:

  "Frame Ctx Change at Line 123 in demo.c [Prev. Frame ID=0x1234] New Frame ID=0x1235"
 

 

config UIAFrameCtx_isLoggingEnabledFxn  // module-wide

index URL

C synopsis

target-domain

extern const IUIACtx_IsLoggingEnabledFxn UIAFrameCtx_isLoggingEnabledFxn;

 

 

UIAFrameCtx_getCtxId()  // module-wide

index URL

Get the ID for the current frame

C synopsis

target-domain

macro UInt UIAFrameCtx_getCtxId();

 

RETURNS

returns the frame ID logged by the last call to UIAFrameCtx_logCtxChg.

 

UIAFrameCtx_isLoggingEnabled()  // module-wide

index URL

returns true if the new context matches the value to enable logging with

C synopsis

target-domain

Bool UIAFrameCtx_isLoggingEnabled(UInt newFrameId);

 

ARGUMENTS

newFrameId — the new frame ID

DETAILS

Default implementation of the IUIACtx_IsLoggingEnabledFxn for user context. To enable context-aware filtering, assign UIAFrameCtx_isLoggingEnabledFxn = &UIAFrameCtx_isLoggingEnabled in the config script or programmatically, or assign your own implementation of this function.

RETURNS

true if logging is enabled

 

UIAFrameCtx_setOldValue()  // module-wide

index URL

sets the ti_uia_events_UIAFrameCtx_gLastValue to the new value and returns the old value before it was updated

C synopsis

target-domain

UInt UIAFrameCtx_setOldValue(UInt newValue);

 

ARGUMENTS

newValue — the new value to save in the global variable

(return0 the original value of the global variable before it was updated.

generated on Wed, 14 Mar 2012 16:46:04 GMT