From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24084FBF6 for ; Mon, 15 May 2023 17:43:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C297C433EF; Mon, 15 May 2023 17:43:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1684172620; bh=22/0GyGstKxSi5WyUg/SfzoRo+KeW+wvMb1rDRutY3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DD7dE24hXB+xa6lqwFel7YmMypOhHCKbkQBdHIa8JKsQ9/TgE1nJwPe4XHlVbqfyM UKzK7rmk/KGEmCHhEj1S2a80uLwkHznOxgeyNZOvYHcJvHyGpwPikIMD5s1rq9PnOC 9DiGFPM75TKcbxeBTwuSwmTC8JuWDoyK7F8Ipw5M= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Florian Fainelli , Jan Kiszka , Kieran Bingham , Leonard Crestez , Stephen Boyd , Andrew Morton , Sasha Levin Subject: [PATCH 5.10 212/381] scripts/gdb: bail early if there are no clocks Date: Mon, 15 May 2023 18:27:43 +0200 Message-Id: <20230515161746.357779008@linuxfoundation.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230515161736.775969473@linuxfoundation.org> References: <20230515161736.775969473@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Florian Fainelli [ Upstream commit 1d7adbc74c009057ed9dc3112f388e91a9c79acc ] Avoid generating an exception if there are no clocks registered: (gdb) lx-clk-summary enable prepare protect clock count count count rate ------------------------------------------------------------------------ Python Exception : No symbol "clk_root_list" in current context. Error occurred in Python: No symbol "clk_root_list" in current context. Link: https://lkml.kernel.org/r/20230323225246.3302977-1-f.fainelli@gmail.com Fixes: d1e9710b63d8 ("scripts/gdb: initial clk support: lx-clk-summary") Signed-off-by: Florian Fainelli Cc: Jan Kiszka Cc: Kieran Bingham Cc: Leonard Crestez Cc: Stephen Boyd Signed-off-by: Andrew Morton Signed-off-by: Sasha Levin --- scripts/gdb/linux/clk.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/gdb/linux/clk.py b/scripts/gdb/linux/clk.py index 061aecfa294e6..7a01fdc3e8446 100644 --- a/scripts/gdb/linux/clk.py +++ b/scripts/gdb/linux/clk.py @@ -41,6 +41,8 @@ are cached and potentially out of date""" self.show_subtree(child, level + 1) def invoke(self, arg, from_tty): + if utils.gdb_eval_or_none("clk_root_list") is None: + raise gdb.GdbError("No clocks registered") gdb.write(" enable prepare protect \n") gdb.write(" clock count count count rate \n") gdb.write("------------------------------------------------------------------------\n") -- 2.39.2