module ti.uia.events.UIAStatistic

index URL

UIA Statistics Events

*       C synopsis

*  Individual elements

*       DETAILS

*       EXAMPLES

The UIAStatistic module defines events that allow tooling to analyze the performance of the software (CPU Utilization, throughput, etc.) more ... ]

C synopsis

target-domain

sourced in ti/uia/events/UIAStatistic.h

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

Constants

extern const Log_Event 

extern const Log_Event 

extern const Log_Event 

extern const Log_Event 

extern const Log_Event 

extern const Log_Event 

extern const Log_Event 

 

DETAILS

The UIAStatistic module defines events that allow tooling to analyze the performance of the software (CPU Utilization, throughput, etc.)

The generation of UIAStatistic events is controlled by a module's diagnostics mask, which is described in details in xdc.runtime.Diags. UIAStatistic 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");

 

config UIAStatistic_bytesProcessed  // module-wide

index URL

bytesProcessed statistic event

C synopsis

target-domain

extern const Log_Event UIAStatistic_bytesProcessed;

 

VALUES

name — a constant string that provides the name of the entity that is processing the data

numBytes — the number of bytes processed

DETAILS

Number of bytes that were processed.

 

config UIAStatistic_bytesProcessedByInstance  // module-wide

index URL

bytesProcessedByInstance statistic event

C synopsis

target-domain

extern const Log_Event UIAStatistic_bytesProcessedByInstance;

 

VALUES

__FILE__ — constant string identifying the file the event was logged from

__LINE__ — the line number the event was logged from

instanceId — the instance ID (e.g. thread handle) of the entity that is processing the data

numBytes — the number of bytes processed

DETAILS

Number of bytes that were processed along with filename, line number and instance ID.

EXAMPLE

The following C code shows how to log an event that tracks the number of bytes processed

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAStatistic.h> 
  ...
 Void myFunction(){
   int instanceId = 0x1234; // change to e.g. a TaskId or some other unique ID
   int numBytes= 567;       // change to number of bytes actually processed
   
   Log_write4(UIAStatistic_bytesProcessedByInstance, (IArg)__FILE__,(IArg)__LINE__,instanceId,numBytes);
 }

The following text will be displayed for the event:

  Bytes Processed at Line 123 in demo.c (InstanceId 0x1234): Num Bytes=567   

 

config UIAStatistic_cpuLoad  // module-wide

index URL

Number of cycles used by an XDC module

C synopsis

target-domain

extern const Log_Event UIAStatistic_cpuLoad;

 

VALUES

numCycles — the CPU load in cycles

EXAMPLE

The following C code shows how to log a cpuLoad event that tracks the number of cycles used by an XDC module. The module ID is logged along with the event. For non-XDC code, or for code with multiple instances @see #cpuLoadByInstance.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAStatistic.h>
  ...
 Void myFunction(){
   int numCycles = 0;
   // update numCycles with the number of cycles processed
   Log_write1(UIAStatistic_cpuLoad, numCycles);
 }

The following text will be displayed for the event:

  CPU Load: NumCycles=1234

 

config UIAStatistic_cpuLoadByInstance  // module-wide

index URL

Number of cycles used by a non XDC module or thread

C synopsis

target-domain

extern const Log_Event UIAStatistic_cpuLoadByInstance;

 

VALUES

name — a constant string that provides the name of the entity that is processing the data

instanceId — the instance ID (e.g. thread handle) of the entity that is processing the data

numCycles — the CPU load in cycles

EXAMPLE

The following C code shows how to log a cpuLoad event that tracks the number of cycles used by code that is not in an XDC module or by a thread

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAStatistic.h>
  static volatile int gMyGlobalInstanceId = 0;     
  ...
 Void myFunction(){
  IArg key;
  int localInstanceId;
  int numCycles = 0;
 // protect pre-increment operation from race conditions
  key = Gate_enterSystem();
  localInstanceId = ++gMyGlobalInstanceId;
  Gate_leaveSystem(key);     
   // update numCycles with the number of cycles processed
   Log_write3(UIAStatistic_cpuLoadByInstance, "myFunction",localInstanceId,numCycles);
 }

The following text will be displayed for the event:

  CPU Load for myFunction (instanceId = 0x1234): NumCycles=1234     

 

config UIAStatistic_freeBytes  // module-wide

index URL

Number of free bytes in heap

C synopsis

target-domain

extern const Log_Event UIAStatistic_freeBytes;

 

VALUES

__FILE__ — constant string identifying the file the event was logged from

__LINE__ — the line number the event was logged from

heapId — heap identifier (e.g IHeap_Handle)

freeBytes — the number of bytes free on the heap

EXAMPLE

The following C code shows how to log a freeBytes event that tracks the number of bytes free in the heap

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAStatistic.h> 
  ...
 Void myFunction(){
   int heapId = 0x1234;    // change to heap ID
   int numBytesFree = 567; // change to number of bytes free on the heap
   
   Log_write4(UIAStatistic_freeBytes, (IArg)__FILE__,(IArg)__LINE__,heapId,numFreeBytes);
 }

The following text will be displayed for the event:

  Heap at Line 123 in demo.c (HeapId 0x1234): Free Bytes=567   

 

config UIAStatistic_wordsProcessed  // module-wide

index URL

wordsProcessed statistic event

C synopsis

target-domain

extern const Log_Event UIAStatistic_wordsProcessed;

 

VALUES

name — a constant string that provides the name of the entity that is processing the data

numWords — the number of words processed

DETAILS

number of words that were processed.

 

config UIAStatistic_wordsProcessedByInstance  // module-wide

index URL

wordsProcessedByInstance statistic event

C synopsis

target-domain

extern const Log_Event UIAStatistic_wordsProcessedByInstance;

 

VALUES

__FILE__ — constant string identifying the file the event was logged from

__LINE__ — the line number the event was logged from

instanceId — the instance ID (e.g. thread handle) of the entity that is processing the data

numWords — the number of words processed

DETAILS

Number of words that were processed along with filename, line number and instance ID.

EXAMPLE

The following C code shows how to log an event that tracks the number of words processed

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAStatistic.h> 
  ...
 Void myFunction(){
   int instanceId = 0x1234;  // change to e.g. a TaskId or some other unique ID
   int numWords= 567;        // change to number of words actually processed
   
   Log_write4(UIAStatistic_wordsProcessedByInstance, (IArg)__FILE__,(IArg)__LINE__,instanceId,numWords);
 }

The following text will be displayed for the event:

  Words Processed at Line 123 in demo.c (InstanceId 0x1234): Num Words=567   

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