All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pragnesh Patel <pragnesh.patel@sifive.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 1/2] trace: select TIMER_EARLY to avoid infinite recursion
Date: Tue, 22 Dec 2020 11:52:35 +0530	[thread overview]
Message-ID: <20201222062236.27372-1-pragnesh.patel@sifive.com> (raw)

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

             reply	other threads:[~2020-12-22  6:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-22  6:22 Pragnesh Patel [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201222062236.27372-1-pragnesh.patel@sifive.com \
    --to=pragnesh.patel@sifive.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.