From patchwork Mon Oct 14 05:17:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1175969 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46s6LY355fz9sQw for ; Mon, 14 Oct 2019 16:19:33 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="pdh7Bt45"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46s6LY0MXyzDqW9 for ; Mon, 14 Oct 2019 16:19:33 +1100 (AEDT) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [203.11.71.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46s6K10P33zDqX2 for ; Mon, 14 Oct 2019 16:18:13 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="pdh7Bt45"; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (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 mail.ozlabs.org (Postfix) with ESMTPSA id 46s6K042bqz9sPj; Mon, 14 Oct 2019 16:18:12 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1571030292; bh=e9szRdHKHlcatnuku6tg40e0JCwsbxL2p264XRGsVCM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pdh7Bt45yAatOpn2WosShHJ0zly4C/WpbjMDMuQk5qEsNeCvlybAHkSu31Z2nP67C 2+7ekJo76jqyCzXkCA3/isxXBx+THlBN0ie7oVI+x3k985iu/3E/TXhSKj7cRJeyPG H2j5K5/9NH0Liu1GaGwTR2hPRXTMirh5ORpTf9R6eWKrykL5OnNCJjmEfk3eflocOq BQFPHhcVAqi6QH9QEI8hIjmbZur/OW2sAVaJLLyiuv0I8B4QbnZ1CPmeme1DGMb5i/ cD0iDMk15Lgxegpgq7+JHhTA8mOAHFoBB+xoYyDtj28oo2yolYdVHsuVlkM9ZpIzQA ySoTmO/yZZuTg== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Mon, 14 Oct 2019 16:17:35 +1100 Message-Id: <20191014051748.20190-18-amitay@ozlabs.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191014051748.20190-1-amitay@ozlabs.org> References: <20191014051748.20190-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH v5 17/30] main: Use dn_name for printing virtual nodes X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amitay Isaacs Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Virtual nodes do not have a class name. When traversing system device tree view, virtual nodes need to be handled correctly. So instead of skipping the nodes if classname is not set, print dn name for virtual nodes. Signed-off-by: Amitay Isaacs Reviewed-by: Alistair Popple --- src/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index 44d1c55..f7f891a 100644 --- a/src/main.c +++ b/src/main.c @@ -529,10 +529,10 @@ static void print_target(struct pdbg_target *target, int level) printf(" "); classname = pdbg_target_class_name(target); - if (!classname) - return; - - printf("%s%d: %s", classname, pdbg_target_index(target), pdbg_target_name(target)); + if (classname) + printf("%s%d: %s", classname, pdbg_target_index(target), pdbg_target_name(target)); + else + printf("%s:", pdbg_target_dn_name(target)); if (path_target_selected(target)) printf(" (*)"); printf("\n");