Tracing: Trace hook support macros
Adds generic trace hook macros for inserting trace hook for function entry, exit, blocking, and object initialization with a variable number of arguments (objects, return values, etc.). Utilizing macro concatenation these macros produce trace hooks of a similar format to the old trace system with SYS_TRACING_OBJ_FUNC(k_thread, switched_in) being turned into sys_trace_k_thread_switched_in() by the preprocessor. Although these macros still rely on the manual definition of each unique trace hook in tracing.h, the benefit of not directly calling those is that we can enable/disable trace hooks based on object type (k_thread, k_sem, etc.) through the preprocessor while providing the ability of adding type specific runtime trace processing similar to SYS_TRACING_OBJ_INIT. Signed-off-by: Torbjörn Leksell <torbjorn.leksell@percepio.com> Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
2f01479b56
commit
16bbb8ef34
3 changed files with 421 additions and 1 deletions
|
@ -19,6 +19,7 @@
|
|||
#include <limits.h>
|
||||
#include <stdbool.h>
|
||||
#include <toolchain.h>
|
||||
#include <tracing/tracing_macros.h>
|
||||
|
||||
#ifdef CONFIG_THREAD_RUNTIME_STATS_USE_TIMING_FUNCTIONS
|
||||
#include <timing/timing.h>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue