From 4f4b8ef4ea988d323c5f8c2498e17a023958e1a8 Mon Sep 17 00:00:00 2001 From: Wentong Wu Date: Fri, 31 Jan 2020 22:49:25 +0800 Subject: [PATCH] tracing: add TRACING_TEST Kconfig option Add Kconfig option TRACING_TEST which can be used to customize tracing packet format (currently supporting string format and data format) for testing purpose. Signed-off-by: Wentong Wu --- include/debug/tracing.h | 3 ++ subsys/debug/Kconfig | 7 ++++ subsys/debug/tracing/include/tracing_test.h | 39 +++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 subsys/debug/tracing/include/tracing_test.h diff --git a/include/debug/tracing.h b/include/debug/tracing.h index 124cd6aece6..5425aafbe44 100644 --- a/include/debug/tracing.h +++ b/include/debug/tracing.h @@ -27,6 +27,9 @@ #elif defined CONFIG_TRACING_CTF #include "tracing_ctf.h" +#elif defined CONFIG_TRACING_TEST +#include "tracing_test.h" + #else /** diff --git a/subsys/debug/Kconfig b/subsys/debug/Kconfig index 1b0460ff9a6..ed6c2b68454 100644 --- a/subsys/debug/Kconfig +++ b/subsys/debug/Kconfig @@ -448,6 +448,13 @@ config TRACING_CTF_TIMESTAMP Timestamp prefix will be added to the beginning of CTF event internally. +config TRACING_TEST + bool "Tracing for test usage" + depends on TRACING + help + Enable tracing for testing kinds of format purpose. It must + implement the tracing hooks defined in tracing_test.h + source "subsys/debug/Kconfig.segger" diff --git a/subsys/debug/tracing/include/tracing_test.h b/subsys/debug/tracing/include/tracing_test.h new file mode 100644 index 00000000000..840bd709ef9 --- /dev/null +++ b/subsys/debug/tracing/include/tracing_test.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2019 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _TRACE_TEST_H +#define _TRACE_TEST_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void sys_trace_thread_switched_out(void); +void sys_trace_thread_switched_in(void); +void sys_trace_thread_priority_set(struct k_thread *thread); +void sys_trace_thread_create(struct k_thread *thread); +void sys_trace_thread_abort(struct k_thread *thread); +void sys_trace_thread_suspend(struct k_thread *thread); +void sys_trace_thread_resume(struct k_thread *thread); +void sys_trace_thread_ready(struct k_thread *thread); +void sys_trace_thread_pend(struct k_thread *thread); +void sys_trace_thread_info(struct k_thread *thread); +void sys_trace_thread_name_set(struct k_thread *thread); +void sys_trace_isr_enter(void); +void sys_trace_isr_exit(void); +void sys_trace_isr_exit_to_scheduler(void); +void sys_trace_idle(void); +void sys_trace_void(unsigned int id); +void sys_trace_end_call(unsigned int id); + +#ifdef __cplusplus +} +#endif + +#endif