diff options
author | Simon Glass | 2023-01-15 14:15:47 -0700 |
---|---|---|
committer | Tom Rini | 2023-02-11 12:22:35 -0500 |
commit | c3d91812a2b69fbc73eccdcec70d7ea510d7c8bd (patch) | |
tree | 5ae0a2527e8e8541c41c53159fd9a89bc79b861f /include/trace.h | |
parent | d9044e5363bb0b32a7aff00adf47c227f78f0f32 (diff) |
trace: Reduce the number of function sites
Given that the compiler adds two function calls into each function, the
current spacing is overkill. Drop it down to 16 bytes per function, which
is still plenty. This saves some space in the trace buffer.
Also move the calculation into a function, so it is common code. Add a
check for gd->mon_len being unset, which breaks tracing.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/trace.h')
-rw-r--r-- | include/trace.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/trace.h b/include/trace.h index 2be8d81b515..763d6d1255a 100644 --- a/include/trace.h +++ b/include/trace.h @@ -17,14 +17,16 @@ enum { * * The value here assumes a minimum instruction size of 4 bytes, * or that instructions are 2 bytes but there are at least 2 of - * them in every function. + * them in every function. Given that each function needs a call to + * __cyg_profile_func_enter() and __cyg_profile_func_exit() as well, + * we cannot have functions smaller that 16 bytes. * * Increasing this value reduces the number of functions we can * resolve, but reduces the size of the uintptr_t array used for * our function list, which is the length of the code divided by * this value. */ - FUNC_SITE_SIZE = 4, /* distance between function sites */ + FUNC_SITE_SIZE = 16, /* distance between function sites */ TRACE_VERSION = 1, }; |