All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] trace: select TIMER_EARLY to avoid infinite recursion
@ 2020-12-22  6:22 Pragnesh Patel
  2020-12-22  6:22 ` [PATCH v2 2/2] riscv: timer: Add support for an early timer Pragnesh Patel
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Pragnesh Patel @ 2020-12-22  6:22 UTC (permalink / raw)
  To: u-boot

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>
---

Changes in v2:
- new patch

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

diff --git a/lib/Kconfig b/lib/Kconfig
index 7673d2e4e0..671386963a 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
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-01-10 12:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-22  6:22 [PATCH v2 1/2] trace: select TIMER_EARLY to avoid infinite recursion Pragnesh Patel
2020-12-22  6:22 ` [PATCH v2 2/2] riscv: timer: Add support for an early timer Pragnesh Patel
     [not found]   ` <752D002CFF5D0F4FA35C0100F1D73F3FB28D556F@ATCPCS16.andestech.com>
2020-12-30  6:40     ` Rick Chen
2021-01-05  1:37       ` Rick Chen
2021-01-05  1:42         ` Sean Anderson
2021-01-05  7:39           ` Pragnesh Patel
2021-01-06  1:58             ` Rick Chen
2021-01-10 12:16               ` Pragnesh Patel
2020-12-29  3:31 ` [PATCH v2 1/2] trace: select TIMER_EARLY to avoid infinite recursion Simon Glass
     [not found] ` <752D002CFF5D0F4FA35C0100F1D73F3FB28D5564@ATCPCS16.andestech.com>
2020-12-30  6:38   ` Rick Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.