diff mbox series

[v4,1/2] trace: select TIMER_EARLY to avoid infinite recursion

Message ID 20210117124128.28130-1-pragnesh.patel@sifive.com
State Accepted
Commit a80f85138c9457141c799c022b5c924252031512
Headers show
Series [v4,1/2] trace: select TIMER_EARLY to avoid infinite recursion | expand

Commit Message

Pragnesh Patel Jan. 17, 2021, 12:41 p.m. UTC
When tracing functions is enabled this adds calls to
__cyg_profile_func_enter() and __cyg_profile_func_exit() to the traced
functions.

__cyg_profile_func_enter() and __cyg_profile_func_exit() invoke
timer_get_us() to record the entry and exit time.

initr_dm() will make gd->dm_root = NULL and gd->timer = NULL, so
timer_get_us() -> get_ticks() -> dm_timer_init() will lead to an
indefinite recursion.

So select TIMER_EARLY when tracing got enabled.

Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Rick Chen <rick@andestech.com>
---

Changes in v4:
- no change

Changes in v3:
- no change

Changes in v2:
- new patch

 lib/Kconfig | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/lib/Kconfig b/lib/Kconfig
index a704568443..9b9177f2aa 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -210,6 +210,7 @@  config BITREVERSE
 config TRACE
 	bool "Support for tracing of function calls and timing"
 	imply CMD_TRACE
+	select TIMER_EARLY
 	help
 	  Enables function tracing within U-Boot. This allows recording of call
 	  traces including timing information. The command can write data to