From patchwork Thu Aug 9 05:19:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 955349 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41mGlg0lSSz9s1c for ; Thu, 9 Aug 2018 15:19:43 +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="gxU/hVmc"; 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 41mGlf3m1kzDr5t for ; Thu, 9 Aug 2018 15:19:42 +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="gxU/hVmc"; 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 41mGlV4zslzDqCD for ; Thu, 9 Aug 2018 15:19:34 +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="gxU/hVmc"; 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 41mGlV2Ds6z9s4Z; Thu, 9 Aug 2018 15:19:34 +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=1533791974; bh=JhNnOMz0DGZGPSmIYYxcYS3Sb8RKkUGSD/wRNosZZn4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gxU/hVmcPwRIJYgKJ038S2c+e09dqnsI5hceGlz5ZTHxN0y3lQ+1ej1aBSe9IaZ2g jNC0Ifu1wyiYlFd27KGJTt/5jKmfjw07S60sMaoOsA0aMR/s+NyFTUGJOPzmM/ti9B vrt/1c8ODRLZMhqznpEKo+2U24qY4HGKxo0Jdz5NprRTaD/3zPLtSZnkiO+o07zUmB +nfNvk4eY8yjm49vgSnQoEHmr58URJyQvIJPXXHJ2V41temJmu+2L779vYU/4wGP6b Zg8dcOQVDbEzR+H/lYOSiPhW/XbXM5FLBoIkV4/7bI2XY2uhCTlEwZlJoqEKYI4IKI hp6bBNQbRFi5A== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Thu, 9 Aug 2018 15:19:23 +1000 Message-Id: <20180809051927.243483-2-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 1/5] main: Define MAX_LINUX_CPUS for convenience 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index fcdab67..48956bb 100644 --- a/src/main.c +++ b/src/main.c @@ -68,6 +68,8 @@ static int i2c_addr = 0x50; #define MAX_CHIPS 24 #define MAX_THREADS THREADS_PER_CORE +#define MAX_LINUX_CPUS (MAX_PROCESSORS * MAX_CHIPS * MAX_THREADS) + static int **processorsel[MAX_PROCESSORS]; static int *chipsel[MAX_PROCESSORS][MAX_CHIPS]; static int threadsel[MAX_PROCESSORS][MAX_CHIPS][MAX_THREADS]; @@ -314,7 +316,7 @@ static bool parse_options(int argc, char *argv[]) int p_list[MAX_PROCESSORS]; int c_list[MAX_CHIPS]; int t_list[MAX_THREADS]; - int l_list[MAX_PROCESSORS * MAX_THREADS * MAX_CHIPS]; + int l_list[MAX_LINUX_CPUS]; int p_count = 0, c_count = 0, t_count = 0, l_count = 0; int i, j, k; struct option long_opts[] = { From patchwork Thu Aug 9 05:19:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 955350 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41mGlk1Kpzz9s1c for ; Thu, 9 Aug 2018 15:19:46 +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="vjiGx47n"; 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 41mGlj6WpQzDqxs for ; Thu, 9 Aug 2018 15:19:45 +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="vjiGx47n"; dkim-atps=neutral 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41mGlW32DszDqCF for ; Thu, 9 Aug 2018 15:19:35 +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="vjiGx47n"; 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 41mGlV4kMsz9s4c; Thu, 9 Aug 2018 15:19:34 +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=1533791974; bh=juG7kWwv2puyWc3HzbD6APTrwSinaXZnhFFWQKn2PCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vjiGx47nK6/hkBNmWZ7QF3L6FlXcTXnt5CrDTh7tPoEiURq78TPnVmbXm4QPSHxYz sYS69q4N9tdvBV8HHNmB8n72DPGmX183O9IoJdFeOamhKR90dQ3e/q3yXfU0lF3d4z QYy4JY/ctiKonw0uvZwwgbEv3+8mqme48sPJCa7QcowhhfkKB6NAjOlfh+3UOgYQAw P2GX3WezFq5tzKGQzlHdCbOAkW4QPViVaa8hQ7Y/L1s4Ky/KWXMBnltwbiPUbl9j4E cOZqETIIwi7hmGAcE0qpjVh8IlNvBX+Twcjltlp3f37A0PjVBatWix7IOvoFi0Nvbp 6wJHkjyfjHdPA== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Thu, 9 Aug 2018 15:19:24 +1000 Message-Id: <20180809051927.243483-3-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 2/5] main: Use the correct length of linux cpu list 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 48956bb..cfb01a8 100644 --- a/src/main.c +++ b/src/main.c @@ -391,7 +391,7 @@ static bool parse_options(int argc, char *argv[]) break; case 'l': - if (!parse_list(optarg, MAX_PROCESSORS, l_list, &l_count)) { + if (!parse_list(optarg, MAX_LINUX_CPUS, l_list, &l_count)) { fprintf(stderr, "Failed to parse '-l %s'\n", optarg); opt_error = true; } @@ -491,7 +491,7 @@ static bool parse_options(int argc, char *argv[]) if (l_count) { int pir = -1, i, chip, core, thread; - for (i = 0; i < MAX_PROCESSORS; i++) { + for (i = 0; i < MAX_LINUX_CPUS; i++) { if (l_list[i] == 1) { pir = get_pir(i); if (pir < 0) From patchwork Thu Aug 9 05:19:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 955351 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41mGln1fVwz9s4Z for ; Thu, 9 Aug 2018 15:19:49 +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="apShcZNv"; 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 41mGlm6xkhzDrH0 for ; Thu, 9 Aug 2018 15:19:48 +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="apShcZNv"; dkim-atps=neutral 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41mGlW4ZcbzDqBy for ; Thu, 9 Aug 2018 15:19:35 +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="apShcZNv"; 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 41mGlW2FLMz9s7Q; 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=dHPZFbGndTVJ7B6PaBwojUiS3ZKxG7gEb0nrCBSciew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=apShcZNvMIMohfmAZnxMzHfwiK9oLM01Tq6EHQrvyNHwEpRRY2hS631GQ5adzdyy/ kIarvZbzn+4RQDIL3CI24Y7/S8yk7rV4BiOXfozGssodlEy3xjh3I+K+MKLlJgmHt6 +cQ9u6lvtHud8iTjlmQqB4QbH1woS7O/una00wUfrpjTKWFi6xAF+oE9Thm1riMwnh XKIUnUQrsroa3ubfzYiCJmZibNVPaoEVUHWTx3F1eeMKVcK4HFKKEcLT2zGSEXioK9 kd8+7RWTjQg5ry3U3Fxsc/FpM1DgO9Nr5CU0xWfgL/K8SEr+N5PG2KjE2x+uilmHu3 0AMP51WBcG0yw== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Thu, 9 Aug 2018 15:19:25 +1000 Message-Id: <20180809051927.243483-4-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 3/5] main: Fix target selection of linux cpus 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" The selection should be applied to all the linux cpus in the list and not just the first one. Signed-off-by: Amitay Isaacs --- src/main.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main.c b/src/main.c index cfb01a8..d7c8589 100644 --- a/src/main.c +++ b/src/main.c @@ -496,18 +496,16 @@ static bool parse_options(int argc, char *argv[]) pir = get_pir(i); if (pir < 0) return true; - break; - } - } - if (pir < 0) - return true; - pir_map(pir, &chip, &core, &thread); + pir_map(pir, &chip, &core, &thread); - threadsel[chip][core][thread] = 1; - chipsel[chip][core] = &threadsel[chip][core][thread]; - processorsel[chip] = &chipsel[chip][core]; + processorsel[chip] = &chipsel[chip][0]; + chipsel[chip][core] = &threadsel[chip][core][0]; + threadsel[chip][core][thread] = 1; + } + } } + return true; } From patchwork Thu Aug 9 05:19:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 955352 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 41mGlr01DLz9s1c for ; Thu, 9 Aug 2018 15:19:52 +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="f2fhWRsu"; 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 41mGlq52wqzDqBy for ; Thu, 9 Aug 2018 15:19:51 +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="f2fhWRsu"; dkim-atps=neutral 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.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41mGlW60cSzDqCD for ; Thu, 9 Aug 2018 15:19:35 +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="f2fhWRsu"; 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 41mGlW4KZXz9s1c; 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=QoWd9h6LtopG9yGhVpYkZSJC8ANacqhH/mKgF2u0sHQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f2fhWRsuoTdd0OI2k6Umc8y4yweLq5S7oMmIIFf8x19EMcZvZlsKq3GsenlHB54f8 ygIVm8tUhNrFXGBIaSrf8ZfKYEvg3uJl/BUz11xuuoBGgl2hLJdhMCvcoGkcrs8r6q /AKmpAUYrGNefgJaEJNI69gIX2R/yBBpjKJXuI2B1yB55x3gSKp2BA1CFoFvcigK7s Hgck93Jz0tYJ9zD6NKGdDnd6P1tG0b6hUaw6ITQOThFvcH4XRnGDNW7lsgGAAuaZK8 Bhy6WXzCKC5J+AsmO6bfBc/LO4VWafq2tqFahQT6f1MYFMfjN4SsSfP3NSNzqUBRR7 SDeHcaFBUHpww== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Thu, 9 Aug 2018 15:19:26 +1000 Message-Id: <20180809051927.243483-5-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 4/5] main: Do not reset the previous selections in the list 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" This allows calling parse_list() multiple times to incrementally keep selecting entries for options -p/-c/-t/-l. Signed-off-by: Amitay Isaacs --- src/main.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main.c b/src/main.c index d7c8589..1ab0cff 100644 --- a/src/main.c +++ b/src/main.c @@ -181,10 +181,6 @@ static bool parse_list(const char *arg, int max, int *list, int *count) strcpy(str, arg); - for (i = 0; i < max; i++) { - list[i] = 0; - } - tmp = str; while ((tok = strtok_r(tmp, ",", &saveptr)) != NULL) { char *a, *b, *endptr, *saveptr2 = NULL; 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");