Skip to content

Commit 0d91de3

Browse files
noahpjtguggedal
authored andcommitted
modules: memfault: Update Bluetooth stack metrics
Zephyr 3.7.0 changed the 2 threads being tracked: - `BT RX` thread was renamed to `BT RX WQ`: zephyrproject-rtos/zephyr@5591d23 - `BT TX` thread was removed, TX ops now run on sysworkq Update the `ncs_bt_rx_unused_stack` metric to track the `BT RX WQ` thread. Remove the `ncs_bt_tx_unused_stack` metric. Add a new metric, `ncs_bt_lw_wq_unused_stack`, to track the `BT LW WQ` thread stack usage. To test: Build a sample like so: ❯ west build --board nrf54l15dk/nrf54l15/cpuapp \ --pristine=always zephyr/samples/bluetooth/peripheral_hr \ -- \ -DCONFIG_SHELL=y \ -DCONFIG_MEMFAULT=y \ -DCONFIG_MEMFAULT_DEVICE_INFO_CUSTOM=y \ -DCONFIG_HWINFO=y \ -DCONFIG_BT_SHELL=y \ -DCONFIG_MEMFAULT_NCS_FW_TYPE=\"app\" \ -DCONFIG_MEMFAULT_NCS_DEVICE_ID=\"testserial\" \ -DCONFIG_MEMFAULT_NCS_BT_METRICS=y \ -DCONFIG_MEMFAULT_NCS_STACK_METRICS=y Trigger a heartbeat using shell commands, and do the usual upload-symbol-file-and-upload-chunks dance to push the data into Memfault, and confirm it decodes correctly: uart:~$ mflt test heartbeat Triggering Heartbeat uart:~$ mflt export <chunks follow> Decoded heartbeat metrics: "ncs_bt_rx_unused_stack": 2952, "ncs_bt_lw_wq_unused_stack": 848, Signed-off-by: Noah Pendleton <[email protected]>
1 parent 0bcbd45 commit 0d91de3

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,12 @@ Memfault integration
760760
* The ``CONFIG_MEMFAULT_DEVICE_INFO_CUSTOM`` Kconfig option has been renamed to :kconfig:option:`CONFIG_MEMFAULT_NCS_DEVICE_INFO_CUSTOM`.
761761
* The ``CONFIG_MEMFAULT_DEVICE_INFO_BUILTIN`` Kconfig option has been renamed to :kconfig:option:`CONFIG_MEMFAULT_NCS_DEVICE_INFO_BUILTIN`.
762762

763+
* Added a metric tracking the unused stack space of the Bluetooth Long workqueue thread, when the :kconfig:option:`CONFIG_MEMFAULT_NCS_BT_METRICS` Kconfig option is enabled.
764+
The new metric is named ``ncs_bt_lw_wq_unused_stack``.
765+
766+
* Removed a metric for the tracking Bluetooth TX thread unused stack ``ncs_bt_tx_unused_stack``.
767+
The thread in question was removed in Zephyr v3.7.0.
768+
763769
AVSystem integration
764770
--------------------
765771

modules/memfault-firmware-sdk/config/memfault_metrics_heartbeat_extra.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifdef CONFIG_MEMFAULT_NCS_STACK_METRICS
88
MEMFAULT_METRICS_KEY_DEFINE(ncs_connection_poll_unused_stack, kMemfaultMetricType_Unsigned)
99
MEMFAULT_METRICS_KEY_DEFINE(ncs_bt_rx_unused_stack, kMemfaultMetricType_Unsigned)
10-
MEMFAULT_METRICS_KEY_DEFINE(ncs_bt_tx_unused_stack, kMemfaultMetricType_Unsigned)
10+
MEMFAULT_METRICS_KEY_DEFINE(ncs_bt_lw_wq_unused_stack, kMemfaultMetricType_Unsigned)
1111
#endif /* CONFIG_MEMFAULT_NCS_STACK_METRICS */
1212

1313
#ifdef CONFIG_MEMFAULT_NCS_LTE_METRICS

modules/memfault-firmware-sdk/memfault_bt_metrics.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ static atomic_t connection_count = ATOMIC_INIT(0);
2222
#if CONFIG_MEMFAULT_NCS_STACK_METRICS
2323
static struct memfault_ncs_metrics_thread metrics_threads[] = {
2424
{
25-
.thread_name = "BT RX",
25+
.thread_name = "BT RX WQ",
2626
.key = MEMFAULT_METRICS_KEY(ncs_bt_rx_unused_stack)
2727
},
2828
{
29-
.thread_name = "BT TX",
30-
.key = MEMFAULT_METRICS_KEY(ncs_bt_tx_unused_stack)
29+
.thread_name = "BT LW WQ",
30+
.key = MEMFAULT_METRICS_KEY(ncs_bt_lw_wq_unused_stack)
3131
}
3232
};
3333
#endif /* CONFIG_MEMFAULT_NCS_STACK_METRICS */

0 commit comments

Comments
 (0)