diff --git a/include/tracing/tracing.h b/include/tracing/tracing.h index 9d9fae21915..a6bcfae664a 100644 --- a/include/tracing/tracing.h +++ b/include/tracing/tracing.h @@ -8,7 +8,10 @@ #include -#if defined CONFIG_SEGGER_SYSTEMVIEW +#if defined CONFIG_PERCEPIO_TRACERECORDER +#include "tracing_tracerecorder.h" + +#elif defined CONFIG_SEGGER_SYSTEMVIEW #include "tracing_sysview.h" #elif defined CONFIG_TRACING_CTF diff --git a/modules/TraceRecorder/CMakeLists.txt b/modules/TraceRecorder/CMakeLists.txt new file mode 100644 index 00000000000..eb34c14714e --- /dev/null +++ b/modules/TraceRecorder/CMakeLists.txt @@ -0,0 +1,34 @@ +# Copyright (c) 2021, Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +if(CONFIG_PERCEPIO_TRACERECORDER) + + set(TRACERECORDER_DIR ${ZEPHYR_CURRENT_MODULE_DIR}) + + zephyr_library() + zephyr_library_sources_ifdef( + CONFIG_PERCEPIO_TRACERECORDER + ${TRACERECORDER_DIR}/kernelports/Zephyr/trcKernelPort.c + ${TRACERECORDER_DIR}/trcStreamingRecorder.c + ${TRACERECORDER_DIR}/extras/SDK/trcSDK.c + ) + + if(CONFIG_PERCEPIO_RECORDER_TRC_RECORDER_STREAM_PORT_RTT) + zephyr_library_sources( + ${TRACERECORDER_DIR}/streamports/Jlink_RTT/trcStreamingPort.c + ) + + zephyr_include_directories( + ${TRACERECORDER_DIR}/streamports/Jlink_RTT/include/ + ) + endif() + + zephyr_include_directories( + ${TRACERECORDER_DIR}/kernelports/Zephyr/include + ${TRACERECORDER_DIR}/kernelports/Zephyr/config + ${TRACERECORDER_DIR}/include + ${TRACERECORDER_DIR}/extras/SDK/include + ) + +endif() diff --git a/subsys/tracing/Kconfig b/subsys/tracing/Kconfig index 35ea2f367b6..06aacd4f424 100644 --- a/subsys/tracing/Kconfig +++ b/subsys/tracing/Kconfig @@ -32,6 +32,13 @@ config TRACING_NONE help None of the available tracing formats is selected. +config PERCEPIO_TRACERECORDER + bool "Percepio Tracealyzer support" + select THREAD_NAME + select INIT_STACKS + select THREAD_MONITOR + depends on ZEPHYR_TRACERECORDER_MODULE + config SEGGER_SYSTEMVIEW bool "Segger SystemView support" select CONSOLE diff --git a/west.yml b/west.yml index f9dba087db6..5f6851d5e82 100644 --- a/west.yml +++ b/west.yml @@ -132,6 +132,9 @@ manifest: - name: nrf_hw_models path: modules/bsim_hw_models/nrf_hw_models revision: a47e326ca772ddd14cc3b9d4ca30a9ab44ecca16 + - name: TraceRecorderSource + path: modules/debug/TraceRecorder + revision: 41daf89c15ff841ed63fa882a916ec97089141ce - name: hal_xtensa revision: 2f04b615cd5ad3a1b8abef33f9bdd10cc1990ed6 path: modules/hal/xtensa