Skip to content

Conversation

@dcpleung
Copy link
Member

@dcpleung dcpleung commented May 15, 2024

(See individual commits for details.)

@dcpleung dcpleung force-pushed the logging/dictionary_pytest branch 9 times, most recently from c65c143 to eb97730 Compare May 20, 2024 16:30
@dcpleung dcpleung force-pushed the logging/dictionary_pytest branch from eb97730 to 150a41c Compare May 23, 2024 18:57
@dcpleung dcpleung marked this pull request as ready for review May 23, 2024 20:27
@dcpleung

This comment was marked as outdated.

@zephyrbot zephyrbot added Release Notes To be mentioned in the release notes area: Logging area: Build System labels May 23, 2024
@dcpleung dcpleung force-pushed the logging/dictionary_pytest branch from 150a41c to b8f4895 Compare May 24, 2024 19:08
@dcpleung dcpleung changed the title samples: logging/dictionary: enable pytest to test output logging: fix dictionary logging and added pytest May 28, 2024
@nashif
Copy link
Member

nashif commented Jun 14, 2024

@dcpleung please rebase.

@nashif nashif added this to the v3.7.0 milestone Jun 14, 2024
dcpleung added 2 commits June 14, 2024 09:41
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]>
dcpleung added 3 commits June 14, 2024 09:41
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]>
@dcpleung dcpleung force-pushed the logging/dictionary_pytest branch from b8f4895 to e5ea973 Compare June 14, 2024 16:41
dcpleung added 5 commits June 14, 2024 09:41
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]>
@dcpleung
Copy link
Member Author

Rebased.

@aescolar
Copy link
Member

@dcpleung If this is a bug, would you be so kind as to label it so and create a linked bug report.
Otherwise the milestone should be changed to 4.0.
(A rebase is needed in any case)

@dcpleung dcpleung modified the milestones: v3.7.0, v4.0.0 Jun 17, 2024
@nashif nashif modified the milestones: v4.0.0, v3.7.0 Jun 17, 2024
@nashif nashif assigned dcpleung and unassigned nordic-krch Jun 17, 2024
@nashif
Copy link
Member

nashif commented Jun 17, 2024

re-assigning to @dcpleung who maintains the dictionary logging feature and its tests.

@nashif nashif requested a review from teburd June 21, 2024 13:35
@aescolar aescolar merged commit 9a08fdc into zephyrproject-rtos:main Jun 28, 2024
@dcpleung dcpleung deleted the logging/dictionary_pytest branch June 28, 2024 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Build System area: Logging Release Notes To be mentioned in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants