Dlt To Elos Conversion¶
Dlt Message Attributes¶
Storage Header¶
DLT MAGIC BYTE : Magic byte “DLT”+0x1 to recognize the message to be a Dlt message.
TIMESTAMP : System time when the client receives the dlt message.
ECU ID : ECU-ID of ECu sending Dlt message.
Standard Header¶
- Header Type
UEH : Use extended Header flag.
MSBF : MSB First Flag.
WEID : “With ECU ID” flag.
WSID : “With Session ID” flag.
WTMS : “With Timestamp” flag.
VERS : Dlt Data Protocol version.
- Message CounterThe Message Counter counts Dlt messages received by the Dlt module. With the Message Counter,
lost messages can be recognized to a certain level. After initialization of the Dlt module, the Message Counter shall be set to ‘0’.The Dlt module shall increment the Message Counter by one at every Log and Trace message received via the Dlt API. If the Message Counter reaches 255, the counter shall wrap around and start with the value ‘0’ at the next Log and Trace message to be transmitted.
Length : Message Length, which is the sum of the length of the Standard Header itself, the length of the optional Dlt Extended Header, and the length of the optional Payload.
ECU ID : The optional ECU ID is used to identify which ECU has sent a Dlt message.
Session ID : The optional Session ID is used to identify the source of a log or trace message within an ECU.
Timestamp : The MONOTONIC time when the ECU sends the message since starting up.
Extended Header¶
- Message Info
Verbose : Verbose flag for determining the verbosity of dlt message (verbose/ non-verbose).
- Message TypeThe dlt message Type which shall have one of the following values :
[0x0] DLT_TYPE_LOG (Dlt Log Message)
[0x1] DLT_TYPE_APP_TRACE (Dlt Trace Message)
[0x2] DLT_TYPE_NW_TRACE (Dlt Network Message)
[0x2] DLT_TYPE_CONTROL (Dlt Control Message)
- Message Type InfoThe Message Type Information based on the above message type :
- DLT_TYPE_LOG (Dlt Log Message)
[0x1] DLT_LOG_FATAL (Fatal system error)
[0x2] DLT_LOG_DLT_ERROR (Application error)
[0x3] DLT_LOG_WARN (Correct behavior cannot be ensured)
[0x4] DLT_LOGINFO (Message of LogLevel type “Information”)
[0x5] DLT_LOG_DEBUG (Message of LogLevel type “Debug”)
[0x6] DLT_LOG_VERBOSE (Message of LogLevel type “Verbose”)
- DLT_TYPE_APP_TRACE (Dlt Trace Message)
[0x1] DLT_TRACE_VARIABLE (Value of variable)
[0x2] DLT_TRACE_FUNCTION_IN (Call of a function)
[0x3] DLT_TRACE_FUNCTION_OUT (Return of a function)
[0x4] DLT_TRACE_STATE (State of a State Machine)
[0x5] DLT_TRACE_VFB (RTE events)
- DLT_TYPE_NW_TRACE (Dlt Network Message)
[0x1] DLT_NW_TRACE_IPC (Inter-Process-Communication)
[0x2] DLT_NW_TRACE_CAN (CAN Communications bus)
[0x3] DLT_NW_TRACE_FLEXRAY (FlexRay Communications bus)
[0x4] DLT_NW_TRACE_MOST (Most Communications bus)
[0x5] DLT_NW_TRACE_ETHERNET (Ethernet Communications bus)
[0x6] DLT_NW_TRACE_SOMEIP (Inter-SOME/IP Communication)
- DLT_TYPE_CONTROL (Dlt Control Message)
[0x1] DLT_CONTROL_REQUEST (Request Control Message)
[0x2] DLT_CONTROL_RESPONSE (Respond Control Message)
Number of arguments : Number of Arguments represents the number of consecutive parameters in the payload segment of one Dlt message.
Application ID : The Application ID is an abbreviation of the application, which generates the Dlt message.
Context ID : Context ID is a user defined ID to group Log and Trace Messages generated by a application. Context ID is not needed for mapping
Body/Payload¶
Message ID : Use message Id to check control message types and add it as payload
Payload : Dlt Message Payload
Mapping Dlt Message Attributes to Elos Events¶
The mapping of Elos Event Attributes to Dlt Message Attributes is as follows:
- Date :
If stdHeader.wtms flag is set and stdHeader.timestamp is available then use ECU Timestamp. The mapping between the monotonic ecu time to elos event timespec time is a follows: - Since elos, the ecu sending dlt message and dlt module are assumed to be in the same power domain, get system uptime. - Add the monotonic time from ecu to the system uptime to get time in actual date time format.
If stdHeader.wtms flag is not set but a storage header is available with time stamp then map this value to elos timestamp. The storage header time stamp should be converted from the seconds and microseconds format into timespec format which is seconds and nanoseconds.
- Source :
- App Name:
If stdHeader.ueh flag is set and extheader.applicationId is set, then use this for app id
If extheader.applicationId is not set, but stdHeader.weid is set and stdHeader.ecu_id is available an application name “dlt_module_[ECU_ID]” where the ecu id is from stdheader is set.
If extheader.applicationId is not set and stdHeader.weid is not set, a default application name “dlt_module” should be used
- File Name:
The file name will be mapped to the shared memory ringbuffer from the dlt plugin config.
- PID :
There are no appropriate dlt attributes that can be mapped to elos event PID so set pid to 0.
- Severity :
- If stdHeader.ueh flag is set and
- If extHeader.MessageType is DLT_TYPE_LOG the corresponding severity is set according to the message type info as given below :
DLT_LOG_FATAL <-> ELOS_SEVERITY_FATAL
DLT_LOG_ERROR <-> ELOS_SEVERITY_ERROR
DLT_LOG_WARN <-> ELOS_SEVERITY_WARN
DLT_LOG_INFO <-> ELOS_SEVERITY_INFO
DLT_LOG_DEBUG <-> ELOS_SEVERITY_DEBUG
DLT_LOG_VERBOSE <-> ELOS_SEVERITY_VERBOSE
If extHeader.MessageType is either DLT_TYPE_APP_TRACE, DLT_TYPE_NW_TRACE or DLT_TYPE_CONTROL, the severity is set to ELOS_SEVERITY_OFF.
If stdHeader.ueh flag is not set but when a unique MessageId with its external description is available, then parse the message type and message type info from message id, and map it to elos event severity as given in a.
If stdHeader.ueh flag is not set, which makes the message type and message type info unavailable, then the severity is set to ELOS_SEVERITY_OFF.
Hardwareid : The target hardware/hypervisor Id will be used as event hardware id. This is usually the target machine id retrieved from the target as given here Hardware ID
- Classification :
- If stdHeader.ueh flag is set and message is of type
DLT_TYPE_LOG then message is classified as ELOS_CLASSIFICATION_LOG. This is a new classification and should be added to elos.
DLT_TYPE_APP_TRACE then message is classified as ELOS_CLASSIFICATION_PROCESS
DLT_TYPE_NW_TRACE then message is classified as ELOS_CLASSIFICATION_NETWORK
DLT_TYPE_CONTROL then message is classified as ELOS_CLASSIFICATION_IPC
If stdHeader.ueh flag is not set but when a unique MessageId with its external description is available, then parse the message type and message type info from message id, and map it to elos event classification as given in a.
If stdHeader.ueh flag is not set making the message type and message type info unavailable set the classification to ELOS_CLASSIFICATION_LOG
- Message Code :
- If stdHeader.ueh flag is set and extHeader.MessageType is
- DLT_TYPE_LOG :
DLT_LOG_FATAL <-> ELOS_MSG_CODE_FATAL_LOG (should be added to elos)
DLT_LOG_ERROR <-> ELOS_MSG_CODE_ERROR_LOG (should be added to elos)
DLT_LOG_WARN <-> ELOS_MSG_CODE_WARN_LOG (should be added to elos)
DLT_LOG_INFO <-> ELOS_MESG_CODE_INFO_LOG
DLT_LOG_DEBUG <-> ELOS_MSG_CODE_DEBUG_LOG
DLT_LOG_VERBOSE <-> ELOS_MSG_CODE_VERBOSE_LOG (should be added to elos)
DLT_TYPE_APP_TRACE : ELOS_MSG_CODE_TRACE_LOG as general purpose application trace message code.
- DLT_TYPE_NW_TRACE :
if the message type info is DLT_NW_TRACE_IPC then use message codes from 4000 - 4006
For DLT_NW_TRACE_* use messge codes from 7200 - 7205
DLT_TYPE_CONTROL : use ELOS_MSG_CODE_KMSG and treat them as kernel message logs
If stdHeader.ueh flag is not set but when a unique MessageId with its external description is available, then parse the message type and message type info from message id, and map it to elos event severity as given in a.
If Message Id is 0 or if message id is unavailable and message type and message type info is not available, then use new message code ELOS_MSG_CODE_FORWARDED_LOG whose value will be 1008.
- Payload :
If stdHeader.ueh flag is set and message type is DLT_TYPE_CONTROL the payload is parsed a binary data encoded as base64 string.
If stdHeader.ueh flag is not set and the message type can not be determined, then the payload will be an ASCII string dumped from the dlt message
Verbose Messages¶
In a Verbose dlt message :
- if UEH flag is set
the message type and message type info should be available, map the message based on these values to elos event as given above
the payload with the type info and the payload value for all arguments are dumped as ASCII encoded string into the elos event payload.
- if UEH flag is not set for a verbose message
use the default values as defined above for the different event attributes.
dump payload as ASCII encoded string into event payload.