From patchwork Thu Aug 9 05:19:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 955353 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41mGlt6RR8z9s1c for ; Thu, 9 Aug 2018 15:19:54 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (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="I8j1AW/b"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41mGlt4SdYzDrH0 for ; Thu, 9 Aug 2018 15:19:54 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="I8j1AW/b"; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41mGlX0rkrzDqBy for ; Thu, 9 Aug 2018 15:19:36 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (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="I8j1AW/b"; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 41mGlW5k9fz9s4Z; Thu, 9 Aug 2018 15:19:35 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1533791975; bh=VboyrJTbUKe6CeespTep0AtKek4iwLdqHITjTygmTYU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I8j1AW/bQboYh16b+8uLM2Cqf9DRPLSaoxI/0o/sVhzZeprEBp9qVonrM2OL5VmPh N7dGlLisQf3lgML6VfdijBS1vzKdVrFcCRR2rj/YNs4pU3nNHw6lcXor3RE5NQm2QY /Zl5SNy2m7L48saEgv6PZzh/qVgNIer5gpsRyiYfjUZT2GZjjkKISTn0VtU3nL3gWr Wyk5qPsZ0eHA/O174JeLGPK0mYrlQe2i05eUQhCG1T0YoMgvCEogz6VMtV5LNqjwlj KtRZxlbX7bvpB+yTQSfjOL2FvS0qmoS96UhGlxCnFLhmpcyG5L+uhGl2OqZF8y+Lf0 Chmi+VKwu+ZdQ== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Thu, 9 Aug 2018 15:19:27 +1000 Message-Id: <20180809051927.243483-6-amitay@ozlabs.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180809051927.243483-1-amitay@ozlabs.org> References: <20180809051927.243483-1-amitay@ozlabs.org> Subject: [Pdbg] [PATCH 5/5] main: Fix print_target to only print selected targets X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.27 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 MIME-Version: 1.0 Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Signed-off-by: Amitay Isaacs --- src/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 1ab0cff..b446b5b 100644 --- a/src/main.c +++ b/src/main.c @@ -769,6 +769,9 @@ void print_target(struct pdbg_target *target, int level) } pdbg_for_each_child_target(target, next) { + if (!target_selected(next)) + continue; + print_target(next, level + 1); } } @@ -777,8 +780,12 @@ static int probe(void) { struct pdbg_target *target; - pdbg_for_each_class_target("pib", target) + pdbg_for_each_class_target("pib", target) { + if (!target_selected(target)) + continue; + print_target(target, 0); + } printf("\nNote that only selected targets will be shown above. If none are shown\n" "try adding '-a' to select all targets\n");