nRF Connect SDK v2.1.1 build errors on thread_analyzer.c

Hello Community & Nordic support,

Observed behaviour:
my project build with nRF Connect SDk v2.1.1 was with errors

expected behaviour:
my project build with nRF Connect SDk v2.1.1 was OK

Description:
I recently switch fro
m nRF Connect SDK v2.0.2 to v2.1.1

The build with v2.0.2 went fine.
The build with v2.1.1 went bad see below:


My proj.conf (related to the issue)

CONFIG_THREAD_STACK_INFO=y
CONFIG_THREAD_NAME=y

CONFIG_THREAD_ANALYZER=y
CONFIG_THREAD_RUNTIME_STATS=y

I recently switch from nRF Connect SDK v2.0.2 to v2.1.1

The build with v2.0.2 went fine.
The build with v2.1.1 went bad see below:

MF zephyr\CMakeFiles\zephyr.dir\subsys\debug\thread_analyzer.c.obj.d -o zephyr/CMakeFiles/zephyr.dir/subsys/debug/thread_analyzer.c.obj -c C:/cm/ncs/v2.1.1/zephyr/subsys/debug/thread_analyzer.c
C:/cm/ncs/v2.1.1/zephyr/subsys/debug/thread_analyzer.c: In function 'thread_analyze_cb':
C:\cm\ncs\v2.1.1\zephyr\subsys\debug\thread_analyzer.c:114:46: error: 'struct thread_analyzer_info' has no member named 'usage'
  114 |  if (k_thread_runtime_stats_get(thread, &info.usage) != 0) {
      |                                              ^
C:\cm\ncs\v2.1.1\zephyr\subsys\debug\thread_analyzer.c:122:27: error: 'struct thread_analyzer_info' has no member named 'usage'
  122 |   info.utilization = (info.usage.execution_cycles * 100U) /
      |                           ^
C:\cm\ncs\v2.1.1\zephyr\subsys\debug\thread_analyzer.c:123:16: error: 'k_thread_runtime_stats_t' {aka 'struct k_thread_runtime_stats'} has no member named 'execution_cycles'
  123 |    rt_stats_all.execution_cycles;
      |                ^
[35/269] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_cmds.c.obj

Parents
  • I did manage to compile, flash and run ncs\v2.1.1\nrf\samples\bluetooth\peripheral_uart\ with trace analyzer enabled without any problem.

    here is the extra configs that I added to the existing proj.conf file

    CONFIG_THREAD_ANALYZER=y
    CONFIG_THREAD_ANALYZER_USE_PRINTK=y
    CONFIG_THREAD_ANALYZER_AUTO=y
    CONFIG_THREAD_ANALYZER_AUTO_INTERVAL=5
    CONFIG_THREAD_STACK_INFO=y
    CONFIG_THREAD_NAME=y
    CONFIG_THREAD_RUNTIME_STATS=y

  • Hi Susheel Nuguru,

    From my custom application, I just did (as intended from the documentation)

    - step 1:
    #include <debug/thread_analyzer.h>

     - step 2:
    #if IS_ENABLED(CONFIG_THREAD_ANALYZER)

            // Run the thread analyzer and prints the output in standard form.
            thread_analyzer_print();
    #endif

    and then I got the compile errors ... can you please do this yourself as well to reproduce the issue as close as possible.

    best regards,
        nRFxFanBoy

     

  • I did exactly the same as you mentioned in the main.c but also added these in the proj.conf and it works fine at my end.

    CONFIG_THREAD_ANALYZER=y
    CONFIG_THREAD_ANALYZER_USE_PRINTK=y
    CONFIG_THREAD_ANALYZER_AUTO=y
    CONFIG_THREAD_ANALYZER_AUTO_INTERVAL=5
    CONFIG_THREAD_STACK_INFO=y
    CONFIG_THREAD_NAME=y
    CONFIG_THREAD_RUNTIME_STATS=y

Reply Children
Related