From patchwork Sun Jan 10 12:42:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pragnesh Patel X-Patchwork-Id: 1424242 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=85.214.62.61; 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=lXF4OOec; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4DDGjR4HxDz9sVp for ; Sun, 10 Jan 2021 23:43:29 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EFE05829C5; Sun, 10 Jan 2021 13:43:20 +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="lXF4OOec"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8E667829C8; Sun, 10 Jan 2021 13:43:18 +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-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) (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 8A33F829BF for ; Sun, 10 Jan 2021 13:43:15 +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-qv1-xf33.google.com with SMTP id s6so6374601qvn.6 for ; Sun, 10 Jan 2021 04:43:15 -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=iDOqQA6vTGRnb8U7ajUapdgx4LYHIH4rDdXyygRhKNc=; b=lXF4OOecDybBUqMQmCVhBvVFnXN4K1+zdSxZBYcMJ+lW3p4tP/DVBLGB64qe/ANilT j2xxBqEc40TgHN6EydRr1VbnnAL59kMwxiK+V+R1czaVGvEFIOBWYaHkEUiFSsGfv3sP uCuffMSjL8GPvL9V81xmsWX/GnsWkQ276BwFnUVcndRN6BhT8pesDDFq2b3EQdlaz18n sjdtJyNDWC3wwWmssLt/1Mq8ZaA52EJwHmJm9ZhIzuKNsIOAJAbWkNP5nMLljVhUdvIg ZG/JGrTuBd7JN5tALLT6zOiR8ZcDiCjxbhrwD7lddutqIda0zEymqkNEAQjgmKagTIQ0 n8Nw== 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=iDOqQA6vTGRnb8U7ajUapdgx4LYHIH4rDdXyygRhKNc=; b=c+tpQbNDQefJIonj8fIW6ikMA58jp0HXUe3GfjLbmOVHoEDeF0HoEr4SrPeKJMe9gX N7RhaN0iIhCztJH2f942BoDA90OlySnqnzLuT8sBYq23QvBblkLvI23mXst8PC/w1y70 FJASZQs8mePvdhP26M4PhsUzKKx5Gh2rZ8/jRUdwurku8bXkGViJPRoo8C7azAX2U+vh AXZdjn8BjQ5pnHVJqLSnSwNBJU0jzEDokv92pz+IBeZLXYTC0quqVRLgH8jdxwAbjIUG z6M0+X0kwJ+6zGDVvbF1o/aMnI8LNNOIC2JP5GoDnYawxFPpg0mxKe3sizNfCWYML0kv jFtQ== X-Gm-Message-State: AOAM533GGGFwt5EsrUKl1KZ3+38wIyuBpCz/TljXZeq1PBVNOxcD3AkG 8r2HZQ0wFPPjpUPoDVXptRTq0a9kJPucD0GH X-Google-Smtp-Source: ABdhPJy0S5xHGkLmUfiXhdpznQrXi9YbZvo1rAGCaRBa+ht4wz5N1gVxOpazx+4R2Ef7JOEzT1UGAw== X-Received: by 2002:a05:6214:321:: with SMTP id j1mr14997247qvu.32.1610282593994; Sun, 10 Jan 2021 04:43:13 -0800 (PST) Received: from sachinj2-OptiPlex-7010.open-silicon.com ([114.143.65.226]) by smtp.gmail.com with ESMTPSA id m13sm6665077qtu.93.2021.01.10.04.43.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jan 2021 04:43:13 -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 , Simon Glass , Stefan Roese , Joao Marcos Costa , Heinrich Schuchardt , Reuben Dowle , Sean Anderson , Michael Walle , Marek Szyprowski , Keerthy , Marcin Juszkiewicz Subject: [PATCH v3 1/2] trace: select TIMER_EARLY to avoid infinite recursion Date: Sun, 10 Jan 2021 18:12:52 +0530 Message-Id: <20210110124254.16312-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 v3: - no change 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