Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EC880C001B0 for ; Sun, 23 Jul 2023 03:44:43 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 56F9E86686; Sun, 23 Jul 2023 05:44:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="OUwF5lMa"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6C2958662E; Sun, 23 Jul 2023 05:44:18 +0200 (CEST) Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (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 DA7CB865DE for ; Sun, 23 Jul 2023 05:44:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x12b.google.com with SMTP id e9e14a558f8ab-3487d75e4c5so15625335ab.0 for ; Sat, 22 Jul 2023 20:44:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1690083853; x=1690688653; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=36JqLsW5Nw03JEQPWz+yAn62UXqtNqUqRSuMBpJVhX4=; b=OUwF5lMaU0FgIqGaC1Gq7syoZ3czr1qY3WgkQidEiAj3Sxt/cIScQvnjxjrs31/xpz lmQSaydW8HDv4ALxv5ssS2ROp9wepQ4ViQDOeGzwgrLhX5319ZWmAmx0birR/yfjPeMc GT8ob6BrFZCKzdKWx+Oh+nDFUvCfEO8BQZc/s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690083853; x=1690688653; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=36JqLsW5Nw03JEQPWz+yAn62UXqtNqUqRSuMBpJVhX4=; b=NYx+HmVeGSQUMFAOphI7n1okcVOu9SvD3ZWAopjEK3pWbiqLc9HODHg6xcH2sjkJMA 8kBaK3zYVStn3viJ9K57SmmlvptOs9qTVfc0Q6mIsAejwKrIx2WIfBVTr+/hNzBHpF8s 4LbXbBP3oC5H3grSeoO9+sSc8leBJt+dU1PKIoOsn41N0ExyJJHZlTSZujcRKlmDzcoD Yk7l9b1LhekJjkuyPHypPi9kcOejID74GuLw1ERD66HPSeAN+hU2OPT3e5k63MtDjeBZ geyUXqZIRvZrOFxBq7ViLmkPQyqwwGV3rB+ToyV46jEAgoasGFIu1idICXp63GSppFb5 cdjw== X-Gm-Message-State: ABy/qLYKWnydWbwqJ2xLo0p+2RHu2vewhP0uc8+z6/o9ymF5gRcPHNsY ZzHMTg8IsN5xf+uM5SAPIJiuphiw3KVfVMQssIM= X-Google-Smtp-Source: APBJJlGfbP4hQGQ8EAMJ/AcMiXW+TreQz/BNmUYNlepnyeKq7rZfbMbt8MEjWqUNQJI9Vk17gi3jhQ== X-Received: by 2002:a5e:940f:0:b0:783:63f9:55b9 with SMTP id q15-20020a5e940f000000b0078363f955b9mr3810559ioj.16.1690083853444; Sat, 22 Jul 2023 20:44:13 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id a11-20020a056638018b00b0042b3e04510asm2077384jaq.98.2023.07.22.20.44.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Jul 2023 20:44:13 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Alper Nebi Yasak , Neha Malcom Francis , Stefan Herbrechtsmeier , Philippe Reynes , Peng Fan , Simon Glass , Heinrich Schuchardt Subject: [PATCH v2 3/6] dtoc: Add some debugging when copying nodes Date: Sat, 22 Jul 2023 21:43:54 -0600 Message-ID: <20230723034406.87673-4-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230723034406.87673-1-sjg@chromium.org> References: <20230723034406.87673-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.8 at phobos.denx.de X-Virus-Status: Clean Show the operations being performed, when debugging is enabled. Convert a mistaken 'print' in test_copy_subnodes_from_phandles() while we are here. Signed-off-by: Simon Glass --- Changes in v2: - Use a 'done' variable to reduce code duplication tools/dtoc/fdt.py | 5 +++++ tools/dtoc/test_fdt.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/dtoc/fdt.py b/tools/dtoc/fdt.py index 2589be990ae9..f6a9dee0db12 100644 --- a/tools/dtoc/fdt.py +++ b/tools/dtoc/fdt.py @@ -249,6 +249,7 @@ class Prop: """ if self.dirty: node = self._node + tout.debug(f'sync {node.path}: {self.name}') fdt_obj = node._fdt._fdt_obj node_name = fdt_obj.get_name(node._offset) if node_name and node_name != node.name: @@ -716,9 +717,13 @@ class Node: 'phandle' property is not copied since this might result in two nodes with the same phandle, thus making phandle references ambiguous. """ + tout.debug(f'copy to {self.path}: {src.path}') for name, src_prop in src.props.items(): + done = False if name != 'phandle' and name not in self.props: self.props[name] = Prop(self, None, name, src_prop.bytes) + done = True + tout.debug(f" {name}{'' if done else ' - ignored'}") def copy_node(self, src): """Copy a node and all its subnodes into this node diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py index 84dcd8b5caa5..f77e48b54eaf 100755 --- a/tools/dtoc/test_fdt.py +++ b/tools/dtoc/test_fdt.py @@ -32,6 +32,7 @@ from dtoc.fdt import Type, BytesToValue import libfdt from u_boot_pylib import test_util from u_boot_pylib import tools +from u_boot_pylib import tout #pylint: disable=protected-access @@ -414,7 +415,7 @@ class TestNode(unittest.TestCase): # Make sure that the phandle for 'over' is not copied over = dst.FindNode('over') - print('keys', over.props.keys()) + tout.debug(f'keys: {over.props.keys()}') self.assertNotIn('phandle', over.props.keys()) # Check the merged properties, first the base ones in '/dest' -- 2.41.0.487.g6d72f3e995-goog