Skip to content

Commit

Permalink
logging: dictionary: new verion 3 format
Browse files Browse the repository at this point in the history
The package_len has been extended from 10 bits to 11 bits
in the log message header. So the format for dictionary
logging also needs to be updated.

Signed-off-by: Daniel Leung <[email protected]>
  • Loading branch information
dcpleung authored and aescolar committed Jun 28, 2024
1 parent 0e33c7a commit f5762e0
Show file tree
Hide file tree
Showing 5 changed files with 395 additions and 5 deletions.
8 changes: 4 additions & 4 deletions include/zephyr/logging/log_output_dict.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ enum log_dict_output_msg_type {
*/
struct log_dict_output_normal_msg_hdr_t {
uint8_t type;
uint32_t domain:3;
uint32_t level:3;
uint32_t package_len:10;
uint32_t data_len:12;
uint32_t domain:4;
uint32_t level:4;
uint32_t package_len:16;
uint32_t data_len:16;
uintptr_t source;
log_timestamp_t timestamp;
} __packed;
Expand Down
5 changes: 5 additions & 0 deletions scripts/logging/dictionary/dictionary_parser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"""

from .log_parser_v1 import LogParserV1
from .log_parser_v3 import LogParserV3


def get_parser(database):
Expand All @@ -19,4 +20,8 @@ def get_parser(database):
if db_ver in [1, 2]:
return LogParserV1(database)

# DB version 3 correspond to v3 parser
if db_ver == 3:
return LogParserV3(database)

return None
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class LogDatabase():
"""Class of log database"""
# Update this if database format of dictionary based logging
# has changed
ZEPHYR_DICT_LOG_VER = 2
ZEPHYR_DICT_LOG_VER = 3

LITTLE_ENDIAN = True
BIG_ENDIAN = False
Expand Down
Loading

0 comments on commit f5762e0

Please sign in to comment.