From patchwork Tue Dec 22 06:22:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pragnesh Patel X-Patchwork-Id: 1419258 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=f4qskugl; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4D0R9H1j9wz9sWP for ; Tue, 22 Dec 2020 17:23:15 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8031D829DB; Tue, 22 Dec 2020 07:23:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.b="f4qskugl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 018E382A08; Tue, 22 Dec 2020 07:23:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EFF738277D for ; Tue, 22 Dec 2020 07:23:03 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pragnesh.patel@sifive.com Received: by mail-qt1-x82a.google.com with SMTP id z20so8355309qtq.3 for ; Mon, 21 Dec 2020 22:23:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id; bh=g3HYQu0X4QrN5rxClwxa+JW3QzOviWsS8mSRmu1JT9I=; b=f4qskuglObXIHZFQX4FHOr0R0XxfqOQr4TeaqrSkYSK+wf5RUWl/44I055ot2nIYjB i5Vo91+Ud+OqC3jN2/AZZJ4VLHGwTkx0v7JmI7HtJHuvI/EZGkUyCZzfjmr18372XGbg D2ISLXrzicC3chbEAYOh4BD/p+ESQbCWLpobwJ6GjJtiwhyG3Tf6MsOCthxQI1Cb8wxt 8w3lYo38nXUteI8tQKiAWSrdTMELcB6jmF5XYARBAq/RWG1Ew8FK1nJNerxJbAZqMa73 DZYpwYBhoLtSpXpLMGa+rIkno9mjCzOSKuuXo0jltYeokEKBA6lIHLoFA/TtJxh5GXRR H+eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=g3HYQu0X4QrN5rxClwxa+JW3QzOviWsS8mSRmu1JT9I=; b=Uj2cwKVj13+OmEcyXp0vtG555NPxb3e0eH2c16T1sUi22ENWJjAqnHlgvc9mTVltmQ JNpfGN1xV+4jmNdESGclNuQ+o7aap8PPul9D9371o74xMO+Zn3xm48nhOUpSQkDpmHXl z8fIitSbvqTiEYv+RpdzD8U2I7j6dbGFFzXYqHaVJOOADeIfmSRKsFL50x+RR9lb3WIy rgvVl71inCDerPRBRnaXYKbjLrLzyG/vg8+Ay0dE5oO5CYGFsbPdXXgcnuQ8b4EfC1Pl SFpkknsQ+bztVlYIXITBt7QqMKqNA/yaZlREskDGLKG4fpB+Zz0aQFZl30RxII/dUkVU iOmg== X-Gm-Message-State: AOAM5311p22igJ5pXf2P0Qnni1Odv/dPk8oPgSnubsiecGx3OyFWF/JF fJGzNAjvwpEN7uGzeLSlTbT0gptskupB7mjkBgk= X-Google-Smtp-Source: ABdhPJyeod+GtFunB6TK4BqjbDSOqMJNbj75kU5QHOono2bFC6Po7lefjOdFaRP65lKjK2qCzjMbeg== X-Received: by 2002:ac8:5bc9:: with SMTP id b9mr20156940qtb.195.1608618182395; Mon, 21 Dec 2020 22:23:02 -0800 (PST) Received: from sachinj2-OptiPlex-7010.open-silicon.com ([114.143.65.226]) by smtp.gmail.com with ESMTPSA id n3sm11837023qtp.72.2020.12.21.22.22.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Dec 2020 22:23:01 -0800 (PST) From: Pragnesh Patel To: u-boot@lists.denx.de Cc: atish.patra@wdc.com, palmerdabbelt@google.com, bmeng.cn@gmail.com, paul.walmsley@sifive.com, anup.patel@wdc.com, sagar.kadam@sifive.com, rick@andestech.com, pragnesh.patel@openfive.com, Pragnesh Patel , Simon Glass , Stefan Roese , Joao Marcos Costa , Reuben Dowle , Weijie Gao , Marcin Juszkiewicz , Michael Walle , Marek Szyprowski , Keerthy Subject: [PATCH v2 1/2] trace: select TIMER_EARLY to avoid infinite recursion Date: Tue, 22 Dec 2020 11:52:35 +0530 Message-Id: <20201222062236.27372-1-pragnesh.patel@sifive.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean 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 Reviewed-by: Simon Glass Reviewed-by: Rick Chen --- 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