Hi Heinrich,

On Sat, 20 Dec 2025 at 18:59, Heinrich Schuchardt
<[email protected]> wrote:
>
> __cyg_profile_func_enter() adds timer information to function traces.
>
> Commit 852d4dbd70ba ("trace: Detect an infinite loop") introduced a logic
> letting any recursive call to __cyg_profile_func_enter() deactivate
> tracing.
>
> This implies that a lot of the DM core and timer drivers functions need to
> be marked as `notrace`. This in not desirable as those functions are part
> of what we want to trace when not invoked by __cyg_profile_func_enter().
>
> A better approach than switching of tracing is to immediately leave
> __cyg_profile_func_enter() when reentered.
>
> Reported-by: Patrick Rudolph <[email protected]>
> Signed-off-by: Heinrich Schuchardt <[email protected]>
> ---
>  lib/trace.c | 59 ++++++++++++++++++++++++-----------------------------
>  1 file changed, 27 insertions(+), 32 deletions(-)
>

Please see here:

https://docs.u-boot.org/en/latest/develop/trace.html#board-requirements

This really just papers over the problem you are having. You cannot
use driver model to obtain the timer as tracing starts before that.

So please instead do the small extra work of defining timer_get_us()
for your board.

Regards,
SImon

Reply via email to