module ti.uia.events.UIAUserCtx

index URL

UIA User Context Instrumentation

*       C synopsis

*  Individual elements

*       DETAILS

*       EXAMPLES

The UIAUserCtx module provides context change events and methods that allow tooling to identify user-defined context switches and to enable context-aware filtering, trace and analysis. [ more ... ]

C synopsis

target-domain

sourced in ti/uia/events/UIAUserCtx.h

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

Functions

macro Int 

Bool 

UInt 

Typedefs

typedef Bool 

Constants

extern const Log_Event 

extern const Bits16 

extern const Bits16 

 

DETAILS

The UIAUserCtx module provides context change events and methods that allow tooling to identify user-defined context switches and to enable context-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 store the return value of the function in ti_uia_runtime_CtxFilter_gIsLoggingEnabled, which is used to determine whether or not to log events.

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

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 UIAUserCtx_IsLoggingEnabledFxn

index URL

C synopsis

target-domain

typedef Bool (*UIAUserCtx_IsLoggingEnabledFxn)(Int);

 

 

config UIAUserCtx_ENABLEMASK  // module-wide

index URL

Ctx Filter Enable Mask

C synopsis

target-domain

extern const Bits16 UIAUserCtx_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 UIAUserCtx_SYNCID  // module-wide

index URL

Trace Synchronization ID

C synopsis

target-domain

extern const Bits16 UIAUserCtx_SYNCID;

 

DETAILS

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

 

config UIAUserCtx_ctxChg  // module-wide

index URL

User-defined Context Change event

C synopsis

target-domain

extern const Log_Event UIAUserCtx_ctxChg;

 

VALUES

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

newUserContextId — an integer which uniquely identifies the new user context

DETAILS

Used to log the start of new state in the user-defined context

Note that this event should not be referenced directly by user code - it is used internally by the LogCtxChg_user function, which logs the previous user context Id automatically.

EXAMPLE

The following C code shows how to log a Context Change event that identifies a new user-specified context ID

  #include <ti/uia/runtime/LogCtxChg.h>
  ...
  LogCtxChg_user("New user context=0x%x",newUserContextId);
  ...
  

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:

  "User Ctx Change at Line 123 in appLoader.c [Prev. ctx = 0x1234] New user context=0x1235"
 

 

config UIAUserCtx_isLoggingEnabledFxn  // module-wide

index URL

C synopsis

target-domain

extern const IUIACtx_IsLoggingEnabledFxn UIAUserCtx_isLoggingEnabledFxn;

 

 

UIAUserCtx_getCtxId()  // module-wide

index URL

Get the ID for the current user-defined context

C synopsis

target-domain

macro Int UIAUserCtx_getCtxId();

 

RETURNS

returns the context ID logged by the last call to UIAUserCtx_logCtxChg.

 

UIAUserCtx_isLoggingEnabled()  // module-wide

index URL

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

C synopsis

target-domain

Bool UIAUserCtx_isLoggingEnabled(UInt newUserCtx);

 

ARGUMENTS

newUserCtx — the new user context

DETAILS

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

RETURNS

true if logging is enabled

 

UIAUserCtx_setOldValue()  // module-wide

index URL

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

C synopsis

target-domain

UInt UIAUserCtx_setOldValue(UInt newValue);

 

ARGUMENTS

newValue — the new value to save in the global variable

RETURN

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

 

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