module ti.uia.events.UIAErr

index URL

UIA Standard Error Events

*       C synopsis

*  Individual elements

*       DETAILS

The UIAErr module defines standard error events that allow tooling to identify common errors in a consistent way. They are all intended to be used with the Log_writeX APIs and, in the future, with crash dump APIs, and provide a way to log errors in a more standardized way than the generic Log_error API enables. [ more ... ]

C synopsis

target-domain

sourced in ti/uia/events/UIAErr.h

#include <ti/uia/events/UIAErr.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 

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 

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 

extern const Log_Event 

extern const Log_Event 

extern const Log_Event 

 

DETAILS

The UIAErr module defines standard error events that allow tooling to identify common errors in a consistent way. They are all intended to be used with the Log_writeX APIs and, in the future, with crash dump APIs, and provide a way to log errors in a more standardized way than the generic Log_error API enables.

The events in this module have one of the following event priority levels: EMERGENCY: used to indicate a non-recoverable situation (e.g. a crash, with the event containing information about the cause of the crash) CRITICAL: used to indicate a sever error that should raise an alarm or cause a notification message to be sent to a system administrator. ERROR: used to indicate a recoverable error that does not require an alarm to be raised.

The following special formatting specifiers may be used to define the msg field of the UIAErr events:

%$S - a string parameter that can provide additional formatting specifiers Note that $S use in strings passed in as a paramter is not supported.

%$F - a specifier for a string parameter containing the file name (__FILE__) and an integer parameter containing the line number (__LINE__).

The generation of UIAErr events is controlled by a module's diagnostics mask, which is described in details in xdc.runtime.Diags. UIAErr events are generated only when the Diags.STATUS bit is set in the module's diagnostics mask. The Diags.STATUS bit is set to ALWAYS_ON by default.

The following configuration script demonstrates how to enable use of UIAErr events within an application. Since the Diags.STATUS bits are set to ALWAYS_ON by default, no explicit code is required to enable the Diags Masks for these events.

EXAMPLES


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

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

 

config UIAErr_critical  // module-wide

index URL

critical error event code

C synopsis

target-domain

extern const Log_Event UIAErr_critical;

 

VALUES

— (%x) integer that identifies the type of error

DETAILS

Used to log a critical error in which the system has e.g. had to kill certain operations in order to keep running. (Event Level = CRITICAL)

EXAMPLE

The following C code shows how to log a fatal error code as a UIA event.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Int myCriticalErrorCode = 0xACODE;
  ...
  Log_write1(UIAErr_critical,myCriticalErrorCode);
  ...
  "CRITICAL ERROR: ErrorCode:0xACODE."

SEE

error

 

config UIAErr_criticalWithStr  // module-wide

index URL

critical error event code and fmt string

C synopsis

target-domain

extern const Log_Event UIAErr_criticalWithStr;

 

VALUES

— (%x) integer that identifies the type of error (%$S) fmt string used to format the event message.

Up to 6 additional arguments can be logged with this event if required. The formatting string should provide format specifiers for each of the additional arguments

DETAILS

Used to log a critical error in which the system has e.g. had to kill certain operations in order to keep running. (Event Level = CRITICAL)

EXAMPLE

The following C code shows how to log a legacy error code and an associated string as a UIA event.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Int myCriticalErrorCode = 0xAC0DE;
  ...
  Log_write2(UIAErr_criticalWithStr,myCriticalErrorCode,(IArg)"My description of critical error 0xAC0DE");
  ...
  "CRITICAL ERROR: ErrorCode:0xAC0DE. My description of critical error 0xAC0DE"
 

SEE

error

 

config UIAErr_divisionByZero  // module-wide

index URL

divisionByZero event code

C synopsis

target-domain

extern const Log_Event UIAErr_divisionByZero;

 

VALUES

__FILE__ — The file that the exception occurred in

__LINE__ — The line that the exception occurred at

DETAILS

Used to log that divide by zero exception occurred.

EXAMPLE

The following C code shows how to log an exception that identifies the file and line number that the exception occurred at as a UIA event. Comments in the code can then provide further explication of the error.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Log_write2(UIAErr_divisionByZero,(IArg)__FILE__,__LINE__);
  ...
  "ERROR: Division by zero at demo.c line 1234."

 

config UIAErr_entryPointNotFound  // module-wide

index URL

entryPointNotFound event code

C synopsis

target-domain

extern const Log_Event UIAErr_entryPointNotFound;

 

VALUES

__FILE__ — The file that the exception occurred in

__LINE__ — The line that the exception occurred at

DETAILS

Used to log that a module or DLL entry point was not found

EXAMPLE

The following C code shows how to log an exception that identifies the file and line number that the exception occurred at as a UIA event. Comments in the code can then provide further explication of the error.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Log_write2(UIAErr_entryPointNotFound,(IArg)__FILE__,__LINE__);
  ...
  "ERROR: Entry Point Not Found at demo.c line 1234."

 

config UIAErr_error  // module-wide

index URL

Event to use to log an existing software Error Code

C synopsis

target-domain

extern const Log_Event UIAErr_error;

 

VALUES

— (%x) integer that identifies the type of error

DETAILS

UIAErr_error is used primarily to support logging of legacy error codes with minimal overhead. Metadata is generated for this event that provides a predefined format specifier string that can be used to display the error code with. This minimizes the number of parameters that need to be logged with the event (it only requires the actual error code to be logged). Unlike the Log_error API, no __FILE__ or __LINE__ information about the call-site is logged with the error code.

EXAMPLE

The following C code shows how to log a legacy error code as a UIA event.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Int myErrorCode = 0xEC0DE;
  Log_write1(UIAErr_error,myErrorCode);
  ...
  "ERROR: ErrorCode:0xECODE"
 

SEE

errorWithStr

 

config UIAErr_errorWithStr  // module-wide

index URL

Event to use to log an existing software Error Code and fmt string

C synopsis

target-domain

extern const Log_Event UIAErr_errorWithStr;

 

VALUES

— (%x) integer that identifies the type of error (%$S) fmt string used to format the event message.

Up to 6 additional arguments can be logged with this event if required. The formatting string should provide format specifiers for each of the additional arguments

DETAILS

UIAErr_errorWithStr is used primarily to support logging of legacy error codes along with user-defined strings that describe the error. Unlike the Log_error API, no __FILE__ or __LINE__ information about the call-site is logged with the error code.

EXAMPLE

The following C code shows how to log a legacy error code as a UIA event.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Int myErrorCode = 0xEC0DE;
  String myErrorStr = "Legacy Error String for error 0xECODE";
  ...
  Log_write2(UIAErr_errorWithStr,myErrorCode,(IArg)myErrorStr);
  ...
  "ERROR: ErrorCode:0xECODE. Legacy Error String for error 0xECODE"
  

SEE

error

 

config UIAErr_exception  // module-wide

index URL

exception event code

C synopsis

target-domain

extern const Log_Event UIAErr_exception;

 

VALUES

__FILE__ — The file that the exception occurred in

__LINE__ — The line that the exception occurred at

DETAILS

Used to log that an exception occurred. Typically used with LogSnapshot or LogCrashDump APIs to log stack dump data that identifies why the exception occurred.

EXAMPLE

The following C code shows how to log an exception that identifies the file and line number that the exception occurred at as a UIA event.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Log_write2(UIAErr_exception,(IArg)__FILE__,__LINE__);
  ...
  "ERROR: Exception at demo.c line 1234."

SEE

error

 

config UIAErr_fatal  // module-wide

index URL

fatal error code

C synopsis

target-domain

extern const Log_Event UIAErr_fatal;

 

VALUES

— (%x) integer that identifies the type of error

DETAILS

Used to log a fatal, nonrecoverable error (Event level = EMERGENCY)

EXAMPLE

The following C code shows how to log a fatal error code as a UIA event.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Int myFatalErrorCode = 0xDEADC0DE;
  ...
  Log_write1(UIAErr_fatal,myFatalErrorCode);
  ...
  "FATAL ERROR: ErrorCode:0xDEADC0DE."

SEE

error

 

config UIAErr_fatalWithStr  // module-wide

index URL

fatal error event code and fmt string

C synopsis

target-domain

extern const Log_Event UIAErr_fatalWithStr;

 

VALUES

— (%x) integer that identifies the type of error (%$S) fmt string used to format the event message.

Up to 6 additional arguments can be logged with this event if required. The formatting string should provide format specifiers for each of the additional arguments

DETAILS

Used to log a fatal, nonrecoverable error.

EXAMPLE

The following C code shows how to log a legacy error code and an associated string as a UIA event.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Int myFatalErrorCode = 0xDEADC0DE;
  String myFatalErrorStr = "My description of fatal error 0xDEADC0DE";
  ...
  Log_write2(UIAErr_fatalWithStr,myFatalErrorCode,(IArg)myFatalErrorStr);
  ...
  "FATAL ERROR: ErrorCode:0xDEADC0DE. My description of fatal error 0xDEADC0DE"
 

SEE

error

 

config UIAErr_floatingPointError  // module-wide

index URL

floatingPointError event code

C synopsis

target-domain

extern const Log_Event UIAErr_floatingPointError;

 

VALUES

__FILE__ — The file that the exception occurred in

__LINE__ — The line that the exception occurred at

DETAILS

Used to log that a floating point error occurred

EXAMPLE

The following C code shows how to log an exception that identifies the file and line number that the exception occurred at as a UIA event. Comments in the code can then provide further explication of the error.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Log_write2(UIAErr_floatingPointError,(IArg)__FILE__,__LINE__);
  ...
  "ERROR: Floating Point Error at demo.c line 1234."

 

config UIAErr_hwError  // module-wide

index URL

hardware error event code

C synopsis

target-domain

extern const Log_Event UIAErr_hwError;

 

VALUES

— (%x) integer that identifies the type of warning

DETAILS

Used to log a generic hardware error. Unlike the Log_error API, no __FILE__ or __LINE__ information about the call-site is logged with the error code.

EXAMPLE

The following C code shows how to log a legacy error code as a UIA event.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Int myHWErrorCode = 0xEC0DE;
  ...
  Log_write1(UIAErr_hwError,myHWErrorCode);
  ...
  "HW ERROR: ErrorCode:0xECODE."
  

SEE

error

 

config UIAErr_hwErrorWithStr  // module-wide

index URL

hardware error event code and fmt string

C synopsis

target-domain

extern const Log_Event UIAErr_hwErrorWithStr;

 

VALUES

— (%x) integer that identifies the type of error (%$S) fmt string used to format the event message.

Up to 6 additional arguments can be logged with this event if required. The formatting string should provide format specifiers for each of the additional arguments

DETAILS

Used to log a generic hardware error.

EXAMPLE

The following C code shows how to log a legacy error code and an associated string as a UIA event.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Int myHWErrorCode = 0xEC0DE;
  String myHWErrorStr = "My description of hardware error 0xEC0DE";
  ...
  Log_write2(UIAErr_hwErrorWithStr,myHWErrorCode,(IArg)myHWErrorStr);
  ...
  "HW ERROR: ErrorCode:0xECODE. My description of hardware error 0xEC0DE"
 

SEE

error

 

config UIAErr_illegalInstruction  // module-wide

index URL

illegalInstruction event code

C synopsis

target-domain

extern const Log_Event UIAErr_illegalInstruction;

 

VALUES

__FILE__ — The file that the exception occurred in

__LINE__ — The line that the exception occurred at

DETAILS

Used to log that an illegal instruction was executed

EXAMPLE

The following C code shows how to log an exception that identifies the file and line number that the exception occurred at as a UIA event. Comments in the code can then provide further explication of the error.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Log_write2(UIAErr_illegalInstruction,(IArg)__FILE__,__LINE__);
  ...
  "ERROR: Illegal Instruction executed at demo.c line 1234."

 

config UIAErr_indexOutOfRange  // module-wide

index URL

indexOutOfRange event code

C synopsis

target-domain

extern const Log_Event UIAErr_indexOutOfRange;

 

VALUES

__FILE__ — The file that the exception occurred in

__LINE__ — The line that the exception occurred at

index — The index value that was out of range

DETAILS

Used to log that an index out of range condition occurred.

EXAMPLE

The following C code shows how to log an exception that identifies the file and line number that the exception occurred at as a UIA event. Comments in the code can then provide further explication of the error.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Log_write3(UIAErr_indexOutOfRange,(IArg)__FILE__,__LINE__,badIndex);
  ...
  "ERROR: OIndex out of range at demo.c line 1234. [INDEX]0xFFFFFFFF"

 

config UIAErr_invalidParameter  // module-wide

index URL

invalidParameter event code

C synopsis

target-domain

extern const Log_Event UIAErr_invalidParameter;

 

VALUES

__FILE__ — The file that the exception occurred in

__LINE__ — The line that the exception occurred at

paramNum — The parameter number in the function's signature that was invalid

paramValue — The invalid parameter value

DETAILS

Used to log that an invalid parameter was detected

EXAMPLE

The following C code shows how to log an exception that identifies the file and line number that the exception occurred at as a UIA event. Comments in the code can then provide further explication of the error.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Void myFunc(Int caseNumber){
    switch(caseNumber){
      ...
      break;
      default : 
         Log_write4(UIAErr_floatingPointError,(IArg)__FILE__,__LINE__,1,caseNumber);
    }
  } 
  
  "ERROR: Invalid Parameter at demo.c line 1234. [ParamNum]1 [ParamValue]0xFFFFFFFF"

 

config UIAErr_memoryAccessFault  // module-wide

index URL

memoryAccessFault event code

C synopsis

target-domain

extern const Log_Event UIAErr_memoryAccessFault;

 

VALUES

__FILE__ — The file that the exception occurred in

__LINE__ — The line that the exception occurred at

adrs — The address that caused the memory access fault

DETAILS

Used to log that a memory access fault occurred.

EXAMPLE

The following C code shows how to log an exception that identifies the file and line number that the exception occurred at as a UIA event. Comments in the code can then provide further explication of the error.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Log_write3(UIAErr_memoryAccessFault,(IArg)__FILE__,__LINE__,(IArg)badAdrs);
  ...
  "ERROR: Memory Access Fault at demo.c line 1234. [ADRS]0xFFFFFFFF"

 

config UIAErr_moduleNotFound  // module-wide

index URL

moduleNotFound event code

C synopsis

target-domain

extern const Log_Event UIAErr_moduleNotFound;

 

VALUES

__FILE__ — The file that the exception occurred in

__LINE__ — The line that the exception occurred at

moduleId — The Module ID of the module that was not found

DETAILS

Used to log that a module was not found

EXAMPLE

The following C code shows how to log an exception that identifies the file and line number that the exception occurred at as a UIA event. Comments in the code can then provide further explication of the error.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Log_write3(UIAErr_moduleNotFound,(IArg)__FILE__,__LINE__,moduleIdThatWasNotFound);
  ...
  "ERROR: Module not found at demo.c line 1234. [MODULE_ID]0x32903"

 

config UIAErr_notImplemented  // module-wide

index URL

notImplemented event code

C synopsis

target-domain

extern const Log_Event UIAErr_notImplemented;

 

VALUES

__FILE__ — The file that the exception occurred in

__LINE__ — The line that the exception occurred at

DETAILS

Used to log that an attempt to access a feature that is not implemented

EXAMPLE

The following C code shows how to log an exception that identifies the file and line number that the exception occurred at as a UIA event. Comments in the code can then provide further explication of the error.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Log_write2(UIAErr_notImplemented,(IArg)__FILE__,__LINE__);
  ...
  "ERROR: Attempt to access feature that is not implemented at demo.c line 1234."

 

config UIAErr_nullPointerException  // module-wide

index URL

nullPointerException event code

C synopsis

target-domain

extern const Log_Event UIAErr_nullPointerException;

 

VALUES

__FILE__ — The file that the exception occurred in

__LINE__ — The line that the exception occurred at

DETAILS

Used to log that a null pointer exception occurred. Typically used with LogSnapshot or LogCrashDump APIs to log stack dump data that identifies why the exception occurred.

EXAMPLE

The following C code shows how to log an exception that identifies the file and line number that the exception occurred at as a UIA event.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Log_write2(UIAErr_nullPointerException,(IArg)__FILE__,__LINE__);
  ...
  "ERROR: Null Pointer Exception at demo.c line 1234."

 

config UIAErr_overflowException  // module-wide

index URL

overflowException event code

C synopsis

target-domain

extern const Log_Event UIAErr_overflowException;

 

VALUES

__FILE__ — The file that the exception occurred in

__LINE__ — The line that the exception occurred at

DETAILS

Used to log that an overflow exception occurred.

EXAMPLE

The following C code shows how to log an exception that identifies the file and line number that the exception occurred at as a UIA event. Comments in the code can then provide further explication of the error.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Log_write2(UIAErr_overflowException,(IArg)__FILE__,__LINE__);
  ...
  "ERROR: Overflow exception at demo.c line 1234."

 

config UIAErr_securityException  // module-wide

index URL

securityException event code

C synopsis

target-domain

extern const Log_Event UIAErr_securityException;

 

VALUES

__FILE__ — The file that the exception occurred in

__LINE__ — The line that the exception occurred at

DETAILS

Used to log that a security exception occurred.

EXAMPLE

The following C code shows how to log an exception that identifies the file and line number that the exception occurred at as a UIA event. Comments in the code can then provide further explication of the error.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Log_write2(UIAErr_securityException,(IArg)__FILE__,__LINE__);
  ...
  "ERROR: Security Exception at demo.c line 1234."

 

config UIAErr_stackOverflow  // module-wide

index URL

stackOverflow event code

C synopsis

target-domain

extern const Log_Event UIAErr_stackOverflow;

 

VALUES

__FILE__ — The file that the exception occurred in

__LINE__ — The line that the exception occurred at

DETAILS

Used to log that a stack overflow was detected. (Event Level = CRITICAL)

EXAMPLE

The following C code shows how to log an exception that identifies the file and line number that the exception occurred at as a UIA event. Comments in the code can then provide further explication of the error.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Log_write2(UIAErr_stackOverflow,(IArg)__FILE__,__LINE__);
  ...
  "ERROR: Stack Overflow detected at demo.c line 1234."

 

config UIAErr_uncaughtException  // module-wide

index URL

uncaughtException event code

C synopsis

target-domain

extern const Log_Event UIAErr_uncaughtException;

 

VALUES

__FILE__ — The file that the exception occurred in

__LINE__ — The line that the exception occurred at

DETAILS

Used to log that an uncaught exception occurred. Typically used with LogSnapshot or LogCrashDump APIs to log stack dump data that identifies why the exception occurred.

EXAMPLE

The following C code shows how to log an exception that identifies the file and line number that the exception occurred at as a UIA event.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Log_write2(UIAErr_uncaughtException,(IArg)__FILE__,__LINE__);
  ...
  "ERROR: Uncaught Exception at demo.c line 1234."

 

config UIAErr_unexpectedInterrupt  // module-wide

index URL

unexpectedInterrupt event code

C synopsis

target-domain

extern const Log_Event UIAErr_unexpectedInterrupt;

 

VALUES

__FILE__ — The file that the exception occurred in

__LINE__ — The line that the exception occurred at

DETAILS

Used to log that an unexpected interrupt occurred.

EXAMPLE

The following C code shows how to log an exception that identifies the file and line number that the exception occurred at as a UIA event.

  #include <xdc/runtime/Log.h>
  #include <ti/uia/events/UIAErr.h>
  ...
  Log_write2(UIAErr_unexpectedInterrupt,(IArg)__FILE__,__LINE__);
  ...
  "ERROR: Null Pointer Exception at demo.c line 1234."

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