-
Notifications
You must be signed in to change notification settings - Fork 8.2k
logging: fix dictionary logging and added pytest #72829
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
Merged
aescolar
merged 10 commits into
zephyrproject-rtos:main
from
dcpleung:logging/dictionary_pytest
Jun 28, 2024
Merged
logging: fix dictionary logging and added pytest #72829
aescolar
merged 10 commits into
zephyrproject-rtos:main
from
dcpleung:logging/dictionary_pytest
Jun 28, 2024
Conversation
This file contains hidden or 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
c65c143 to
eb97730
Compare
eb97730 to
150a41c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
150a41c to
b8f4895
Compare
Member
|
@dcpleung please rebase. |
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
... 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 <[email protected]>
b8f4895 to
e5ea973
Compare
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 <[email protected]>
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]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Member
Author
|
Rebased. |
nashif
approved these changes
Jun 14, 2024
Member
|
@dcpleung If this is a bug, would you be so kind as to label it so and create a linked bug report. |
Member
|
re-assigning to @dcpleung who maintains the dictionary logging feature and its tests. |
teburd
approved these changes
Jun 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.)