Tracealyzer integration

I'm trying to use the nrf/samples/matter/window_covering example with Percepio Tracealyzer and Visual Studio Code (using nRF Connect SDK v2.3.0). I had success with the zephyr/samples/hello_world example. But this Matter example doesn't build: the symbols for the trace recorder somehow get lost along the way. libmodules__TraceRecorder.a does get built, but in the first linker stage ld complains about undefined references to sys_trace_syscall_... functions. How to figure out what went wrong?

  • Hi,

    The team identified the problem: the tracing_tracerecored.h ' header is missing the 'extern C' modifier, which causes the linking to fail when attempting to link the trace functions written in C with the C++ library.

    Fix:

    diff --git a/kernelports/Zephyr/include/tracing_tracerecorder.h b/kernelports/Zephyr/include/tracing_tracerecorder.h
    index 442cc82..2ada548 100644
    --- a/kernelports/Zephyr/include/tracing_tracerecorder.h
    +++ b/kernelports/Zephyr/include/tracing_tracerecorder.h
    @@ -9,6 +9,10 @@
     #ifndef _TRACE_TRACERECORDER_H
     #define _TRACE_TRACERECORDER_H
     
    +#ifdef __cplusplus
    +extern "C" {
    +#endif
    +
     #include <zephyr/kernel.h>
     #include <zephyr/init.h>
     #include <trcRecorder.h>
    @@ -1256,4 +1260,8 @@ void sys_trace_idle(void);
     void sys_trace_isr_enter(void);
     void sys_trace_isr_exit(void);
     
    +#ifdef __cplusplus
    +}
    +#endif
    +
     #endif /*_TRACE_TRACERECORDER_H*/
    

Related