-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
logging: fix dictionary logging and added pytest #72829
Open
dcpleung
wants to merge
10
commits into
zephyrproject-rtos:main
Choose a base branch
from
dcpleung:logging/dictionary_pytest
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
logging: fix dictionary logging and added pytest #72829
dcpleung
wants to merge
10
commits into
zephyrproject-rtos:main
from
dcpleung:logging/dictionary_pytest
+989
−129
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dcpleung
force-pushed
the
logging/dictionary_pytest
branch
9 times, most recently
from
May 20, 2024 16:30
c65c143
to
eb97730
Compare
dcpleung
force-pushed
the
logging/dictionary_pytest
branch
from
May 23, 2024 18:57
eb97730
to
150a41c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
zephyrbot
added
Release Notes
To be mentioned in the release notes
area: Logging
area: Build System
labels
May 23, 2024
zephyrbot
requested review from
57300,
aescolar,
jeremybettis,
kartben,
nashif,
nordic-krch,
nordicjm and
tejlmand
May 23, 2024 20:27
Fix the dictionary database not being generated under some situations even though CONFIG_LOG_DICTIONARY_DB_TARGET is disabled. For example, build and run through QEMU via west build -t run. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
If logging packages need to be created at runtime, the format strings need to be in memory for the packaging code to know what to be packed. So prevent stripping the logging string section if CONFIG_LOG_ALWAYS_RUNTIME is enabled. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This extracts the DataTypes class into its own file. This is in preparation to add a new version of parser which can reuse this class. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Printing long long requires alignment on 64-bit before parsing the actual argument. Or else the parser would be looking at some unrelated bits. So fix it. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
... and put them into the LogParser class file instead of the verisoned parser. This is in preparation for introducing a new parser version. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Python does not really support long long double, so %llx cannot be formatted correctly, so we replace it with a simple %lx. There is another variant %#llx and we also need replace it to %#lx. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
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 <daniel.leung@intel.com>
pylint keeps failing and complaining about arg_data_type is used before assignment. So assign it to None to silence the warning. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This is in preparation for introducing pytest to test the output of dictionary logging. Code is the same, but the testcase.yaml is trimmed to only those that can be tested. Note that a copy is made instead of moving the whole sample over is simply due to various documentation having references to the sample. Since RST files under tests/ are not parsed for zephyr:code-sample:<name>, the linking would have been vanished. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add pytest to test the output of dictionary logging to make sure the encoded logs can be decoded back into strings, and to also make sure the decoded logs have the expected strings. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
dcpleung
force-pushed
the
logging/dictionary_pytest
branch
from
May 24, 2024 19:08
150a41c
to
b8f4895
Compare
dcpleung
changed the title
samples: logging/dictionary: enable pytest to test output
logging: fix dictionary logging and added pytest
May 28, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(See individual commits for details.)