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

lib: nrf_modem: trace: remove deprecated backends and other updates #15353

Merged
merged 5 commits into from
May 27, 2024

Conversation

lemrey
Copy link
Contributor

@lemrey lemrey commented May 16, 2024

  • Remove deprecated trace backends (since NCS v2.5.0).
  • Fix compilation warnings in nrf_modem_lib_trace.c
  • Add possibility to process traces in chunks of configurable size

@lemrey lemrey requested review from balaji-nordic and bjda and removed request for a team May 16, 2024 14:33
@lemrey lemrey added this to the 2.7.0 milestone May 16, 2024
@github-actions github-actions bot added the doc-required PR must not be merged without tech writer approval. label May 16, 2024
@NordicBuilder
Copy link
Contributor

NordicBuilder commented May 16, 2024

Test specification

CI/Jenkins/NRF

  • Integration Platforms

CI/Jenkins/integration

Test Module File based changes Manually selected West overwrite
test-fw-nrfconnect-nrf-iot_lwm2m X
test-fw-nrfconnect-nrf-iot_mosh X
test-fw-nrfconnect-nrf-iot_samples X
test-fw-nrfconnect-nrf-iot_serial_lte_modem X
test-fw-nrfconnect-nrf-iot_thingy91 X
test-fw-nrfconnect-nrf-iot_zephyr_lwm2m X

Detailed information of selected test modules

Note: This message is automatically posted and updated by the CI

@NordicBuilder
Copy link
Contributor

You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds.

Note: This comment is automatically posted by the Documentation Publishing GitHub Action.


* Updated:

* Fixed an issue with the CFUN hooks when the Modem library is initialized during ``SYS_INIT`` at kernel level and makes calls to the :ref:`nrf_modem_at` interface before the application level initialization is done.
Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed needs to be a separate bullet point like Added, updated and removed, after the "updated" entry.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Copy link

@balaji-nordic balaji-nordic left a comment

Choose a reason for hiding this comment

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

net samples look good

Copy link
Contributor

@divipillai divipillai left a comment

Choose a reason for hiding this comment

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

Should the migration guide also be updated?

@lemrey
Copy link
Contributor Author

lemrey commented May 21, 2024

Should the migration guide also be updated?

Yes, updated now

.. toggle::

* For applications using :ref:`nrf_modem_lib_readme`:
The option :kconfig:option:`CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART_ZEPHYR` is now deprecated. Use the option :kconfig:option:`CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART` instead.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The option :kconfig:option:`CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART_ZEPHYR` is now deprecated. Use the option :kconfig:option:`CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART` instead.
The option :kconfig:option:`CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART_ZEPHYR` is now deprecated.
Use the option :kconfig:option:`CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART` instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added line break

@@ -753,7 +753,10 @@ Modem libraries

* :ref:`nrf_modem_lib_readme`:

* Added the Kconfig option :kconfig:option:`CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART_CHUNK_SZ` to process traces in chunks. This can improve the availability of trace memory, and thus reduce the chances of losing traces.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Added the Kconfig option :kconfig:option:`CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART_CHUNK_SZ` to process traces in chunks. This can improve the availability of trace memory, and thus reduce the chances of losing traces.
* Added the Kconfig option :kconfig:option:`CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART_CHUNK_SZ` to process traces in chunks.
This can improve the availability of trace memory, and thus reduce the chances of losing traces.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added line break

@lemrey lemrey force-pushed the trace-updates branch 2 times, most recently from c1cfe0c to ca6d212 Compare May 22, 2024 10:11
Fix build warnings when any of the following were defined:
- CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_BITRATE
- CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_BITRATE_LOG
- CONFIG_NRF_MODEM_LIB_TRACE_BITRATE_LOG

These warnings triggered a crash in the application.
Use the correct function to cancel the delayed work item.

Signed-off-by: Emanuele Di Santo <[email protected]>
Remove CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART from project config.
The trace backend selection is a choice, and the sample is already
selecting one of the choices; no point in turning the other off.

Signed-off-by: Emanuele Di Santo <[email protected]>
Remove deprecated options:
- CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART_ASYNC
- CONFIG_NRF_MODEM_LIB_TRACE_BACKEND_UART_SYNC

After removing the depreacated options, there is only one
config left in choice NRF_MODEM_LIB_TRACE_BACKEND_UART_VERSION,
and that is NRF_MODEM_LIB_TRACE_BACKEND_UART_ZEPHYR.

It therefore makes no point to keep the choice altogether.
Deprecate the choie config NRF_MODEM_LIB_TRACE_BACKEND_UART_ZEPHYR.

Signed-off-by: Emanuele Di Santo <[email protected]>
Update log strings.

Signed-off-by: Emanuele Di Santo <[email protected]>
Trace data is processed in chunks.
Every time a whole chunk of trace data is processed, it is freed
from the shared memory. By reducing or tweaing the chunk size,
it is possible to free the shared memory more often, albeit by a
smaller amount. This, however, can improve the availability of
shared memory, thus reducing the chance of losing traces.

Signed-off-by: Emanuele Di Santo <[email protected]>
@rlubos rlubos merged commit ca6ee8b into nrfconnect:main May 27, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-required PR must not be merged without tech writer approval.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants