From patchwork Fri Nov 23 04:40:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 1002108 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 431NsZ5sMjz9s7T for ; Fri, 23 Nov 2018 15:40:34 +1100 (AEDT) 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="IE/GhXWS"; 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 431NsZ2k9qzDqSr for ; Fri, 23 Nov 2018 15:40:34 +1100 (AEDT) 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="IE/GhXWS"; 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 431NsM1hs0zDqSr for ; Fri, 23 Nov 2018 15:40:23 +1100 (AEDT) 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="IE/GhXWS"; 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 431NsL3Zbkz9s7T; Fri, 23 Nov 2018 15:40:22 +1100 (AEDT) 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=1542948022; bh=pwP3irUMtqJVcfCX6d3ZCcARKR+cM8ltPDeBJZzVV2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IE/GhXWSUkMpK7C4stN6eDuAu0zuDS23icEWYetwwDuOmUk62DVgkIHieTVUQ4jFG A+uR9vZrqwELsAzBrzf5zk9Vyz3PLhTYE7xhH4uK6DOIBgHdkuNxGr8k+ZMqelTCgT f8Z4JuWYxA3aE0SvOdrY6nVpbeTFCEtffGktUOHmxrRfXNSzcFBgE7mu+kV0zfMnX9 y3EOEu2zr+9SzRpKmHFui4mbqAphtXeYW5emKiCcjN5gcKZav7qtrH3osF74iWszm+ rfkSii7Vs3ZN7ItgM8+Q7Fm182gjR3St/aRc0veSa2FIRRU+dAlOJridxO6OjqtUtL 4Ti+WiXmlrlog== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Fri, 23 Nov 2018 15:40:10 +1100 Message-Id: <20181123044019.633814-2-amitay@ozlabs.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181123044019.633814-1-amitay@ozlabs.org> References: <20181123044019.633814-1-amitay@ozlabs.org> MIME-Version: 1.0 Subject: [Pdbg] [PATCH v2 01/10] main: Move device_node setting before parse_options 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" Parsing -l options requires device_node to be set. It is used in pir_map() to map Linux CPU to proc/core/thread. Signed-off-by: Amitay Isaacs --- src/main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 961d850..45ecd6a 100644 --- a/src/main.c +++ b/src/main.c @@ -502,6 +502,9 @@ static bool parse_options(int argc, char *argv[]) if (l_count) { int pir = -1, i, chip, core, thread; + if (!device_node) + return false; + for (i = 0; i < MAX_LINUX_CPUS; i++) { if (l_list[i] == 1) { pir = get_pir(i); @@ -730,6 +733,9 @@ int main(int argc, char *argv[]) backend = default_backend(); + if (!device_node) + device_node = default_target(backend); + if (!parse_options(argc, argv)) return 1; @@ -738,9 +744,6 @@ int main(int argc, char *argv[]) return 1; } - if (!device_node) - device_node = default_target(backend); - /* Disable unselected targets */ if (!target_selection()) return 1;