Skip to content
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: syst: add support for catalog messages #42500

Closed

Conversation

dcpleung
Copy link
Member

@dcpleung dcpleung commented Feb 4, 2022

MIPI Sys-T catalog messages are similar to dictionary logging where an ID is emitted instead of the whole format string to minimize log data. This adds the necessary bits to determine when to emit catalog messages.

This also changes how the collateral file for dictionary logging is created.

See individual commits for details.

@github-actions
Copy link

github-actions bot commented Feb 4, 2022

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
mipi-sys-t zephyrproject-rtos/mipi-sys-t@d9da086 (zephyr) zephyrproject-rtos/mipi-sys-t#6 zephyrproject-rtos/mipi-sys-t#6/files

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@dcpleung dcpleung force-pushed the logging_syst_catalog_msg branch from 3236e84 to b1a468b Compare February 4, 2022 21:31
@github-actions github-actions bot added the DNM This PR should not be merged (Do Not Merge) label Feb 4, 2022
@dcpleung dcpleung force-pushed the logging_syst_catalog_msg branch 2 times, most recently from 9331a2e to d7b00d3 Compare February 7, 2022 19:47
@dcpleung dcpleung marked this pull request as ready for review February 7, 2022 20:14
andyross
andyross previously approved these changes Feb 7, 2022
Copy link
Contributor

@andyross andyross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nitpick on the linkage stuff. Everything else looks great to me, but then I'm not a logging expert so apply salt.

@SebastianBoe SebastianBoe removed their request for review February 8, 2022 13:16
@dcpleung dcpleung force-pushed the logging_syst_catalog_msg branch from d5ad69f to 126b98a Compare February 8, 2022 17:33
@dcpleung dcpleung requested a review from npitre as a code owner February 8, 2022 17:33
@dcpleung dcpleung force-pushed the logging_syst_catalog_msg branch 3 times, most recently from 683e4f9 to 1148f44 Compare February 8, 2022 19:52
@dcpleung dcpleung force-pushed the logging_syst_catalog_msg branch from 5324d7b to fa3dc46 Compare February 14, 2022 21:05
@dcpleung dcpleung closed this Feb 15, 2022
@dcpleung dcpleung reopened this Feb 15, 2022
Copy link
Collaborator

@tejlmand tejlmand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, generally good looking.

A couple of minor nits.

@dcpleung dcpleung force-pushed the logging_syst_catalog_msg branch from fa3dc46 to d8e7d9a Compare February 15, 2022 22:17
@dcpleung dcpleung force-pushed the logging_syst_catalog_msg branch from d8e7d9a to 829c440 Compare March 2, 2022 00:34
@github-actions github-actions bot added the area: Tests Issues related to a particular existing or missing test label Mar 2, 2022
@dcpleung dcpleung force-pushed the logging_syst_catalog_msg branch from 829c440 to 95e78fb Compare March 2, 2022 00:41
This adds a field to z_log_msg2_runtime_create() to pass
through packaging flags to cbprintf_package().

Signed-off-by: Daniel Leung <[email protected]>
@dcpleung dcpleung force-pushed the logging_syst_catalog_msg branch from 95e78fb to de77d8a Compare March 4, 2022 22:37
dcpleung added 16 commits March 4, 2022 15:25
This adds some bits to support tagged arguments to be used for
packaging. If enabled, the packaging function no longer looks at
the format strings to determine the types of arguments, but
instead, each argument is tagged with a type by preceding it
with another argument as type (integer). This allows the format
strings to be removed from the final binary to conserve space.

Signed-off-by: Daniel Leung <[email protected]>
The test test_mode_size_str_with_strings() is defined but was not
added to the test suite, so it never ran before. Add this to
the suite so this can be tested.

Signed-off-by: Daniel Leung <[email protected]>
This adds support for runtime packaging with tagged arguments
so that cbvprintf_package() can function without the format
strings in memory. This allows the format strings to be removed
from final binary to converse space.

Signed-off-by: Daniel Leung <[email protected]>
This adds a few bits to support testing for runtime tagged arguments
when CONFIG_LOG2_RUNTIME_USE_TAGGED_ARGUMENTS is enabled.

Signed-off-by: Daniel Leung <[email protected]>
This adds a few bits to support testing for runtime tagged arguments
when CONFIG_LOG2_RUNTIME_USE_TAGGED_ARGUMENTS is enabled.

Signed-off-by: Daniel Leung <[email protected]>
The MIPI Sys-T library can now take a format string with a variable
argument list so there is no need for the temporary buffer anymore.

This saves some stack space in v1 immediate mode.

Signed-off-by: Daniel Leung <[email protected]>
Fixes some easy pylint warnings.

Signed-off-by: Daniel Leung <[email protected]>
This changes the database generation to actually extracting
individual strings instead of stuffing the whole binary sections
into the database. This allows the generation script to be
extended to accommodate more output formats.

Note that if CONFIG_LOG2_FMT_SECTION is enabled, the format
strings are in log_strings_sections, and also have associated
debug symbols in DWARF. So there is no need to manually
extract them.

Signed-off-by: Daniel Leung <[email protected]>
This changes the script to allow output format to be specified.
Currently, only JSON is support. This will allow supporting
other formats in the future.

Signed-off-by: Daniel Leung <[email protected]>
Compilers often combine strings to conserve space, if one string is
a perfect substring of another one towards the end. So add another
string in the test to make sure dictionary logging is still working
correctly under this scenario.

Signed-off-by: Daniel Leung <[email protected]>
This adds the ability to the dictionary logging database
generation script to output MIPI Sys-T collateral in XML.
This will allow usage of catalog logging under Sys-T, which
is similar to dictionary logging.

Signed-off-by: Daniel Leung <[email protected]>
This updates the mipi-sys-t module to support prepared argument
list for catalog messages.

Signed-off-by: Daniel Leung <[email protected]>
MIPI Sys-T catalog messages are similar to dictionary logging
where an ID is emitted instead of the whole format string to
minimize log data. This adds the necessary bits to determine
when to emit catalog messages.

Signed-off-by: Daniel Leung <[email protected]>
Compilers often combine strings to conserve space, if one string is
a perfect substring of another one towards the end. So add another
string in the test to make sure sys-t with catalog messages is still
working correctly under this scenario.

Signed-off-by: Daniel Leung <[email protected]>
This adds qemu_x86_64 and qemu_cortex_a53 to make sure 64-bit
support for Sys-T is not broken in the future.

Signed-off-by: Daniel Leung <[email protected]>
This adds to sample.yaml to build for MIPI Sys-T catalog message
support.

Signed-off-by: Daniel Leung <[email protected]>
@dcpleung dcpleung force-pushed the logging_syst_catalog_msg branch from de77d8a to e4930a5 Compare March 4, 2022 23:25
@dcpleung
Copy link
Member Author

dcpleung commented Mar 6, 2022

This won't work in C++... so need to start over.

@dcpleung dcpleung closed this Mar 6, 2022
@dcpleung dcpleung deleted the logging_syst_catalog_msg branch March 6, 2022 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: Build System area: Logging area: Modules area: Samples Samples area: Tests Issues related to a particular existing or missing test DNM This PR should not be merged (Do Not Merge) manifest manifest-mipi-sys-t
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants