From patchwork Thu Nov 15 07:19:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitay Isaacs X-Patchwork-Id: 998128 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42wXn51WxYz9sBQ for ; Thu, 15 Nov 2018 18:19:53 +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="ephix6NY"; 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 42wXn42DTrzF3cT for ; Thu, 15 Nov 2018 18:19:52 +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="ephix6NY"; dkim-atps=neutral X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (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 42wXmn4fjgzF3b3 for ; Thu, 15 Nov 2018 18:19:37 +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="ephix6NY"; 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 42wXmn1V7Tz9sCQ; Thu, 15 Nov 2018 18:19:37 +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=1542266377; bh=AItu8AQlTrw+vPjmVNb0h8EAmoL67QX7Uey4c1ov/NU=; h=From:To:Cc:Subject:Date:From; b=ephix6NY5ldCW1syfo4Vo7PcVazM3pvft2V+J3D8KAhMiaiUad+1N0AjISVeTkKOo fi0dPBbyXo2bHMLDDzKSTMSIf4w1HVml7tIXyVwyVX049kbkkKC5nLOYSXz6wY92Ny BGrtay3KiSadpgZAyencIicQW4SrYzYhAQV8x+ar1/qcDI1LBSKaDWrTxEdpgW9xFX B5OR36XSQTGo9GJFKEg3ZVHKjgtBkQEQHk+A2HF2IzRupuD+4bmWkEelYeD+sg5L01 aQQ72oXcL32DMhGPDCkmQsO2nqbz/Xf9xmzOJgzQ0tyGn1hB2S3Dd+k5mBYHw172ss YHwIMaeolDhKQ== From: Amitay Isaacs To: pdbg@lists.ozlabs.org Date: Thu, 15 Nov 2018 18:19:13 +1100 Message-Id: <20181115071929.206974-1-amitay@ozlabs.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [Pdbg] [PATCH v3 00/16] Device tree path based targeting 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" This patchset adds ability to select any arbitrary target in a device tree. A target is identified by it's class name in the device tree (e.g. 'pib' for processor, 'thread' for hardware thread). Path based targets are specified using -P. Examples: -P thread select all threads -P thread0 select all threads with index 0 -P pib0/thread select all threads for proc 0 -P pib0/core[1,2]/thread select all threads for proc 0 and cores 1,2 The existing target selection using -p/-c/-t/-a/-l now maps to path based targets. Currently following commands are converted to use path based targeting: probe getcfam/putcfam getscom/putscom getgpr/putgpr getnia/putnia getspr/putspr getmsr/putmsr getcr/putcr getxer/putxer V2 changes: - Correctly handle invalid patterns for -P - Use class names to match device tree nodes - Drop do_enabled argument from for_each iterators (path api does not probe targets anymore) - Probe output is changed to print all the device tree nodes that are required to list all the selected nodes [marked with (*)] V3 changes: - Select fsi targets also, when -p option is specified - Add address translation api - getcfam prints "p: = " for fsi targets - getscom prints translated addresses and device tree path Amitay Isaacs (16): libpdbg: Convert printf to DEBUG statements main: Convert target_selection() to return a boolean util: Move parse_list() into a separate file path: Add device tree path based targeting main: Add an option for path based targetting main: Add explicit probing of selected targets main: Convert -p/-c/-t/-a/-l to path based targets main: Switch to path based target selection main: Fix probe() to print targets correctly tests: Add path based selection tests main: Do not use argv[0] for progname main: Update probe output to display device names libpdbg: Add an api for address translation main: Convert getcfam/putcfam to use path based targeting main: Convert getscom/putscom to use path based targeting main: Convert register functions to path based targeting Makefile.am | 7 +- libpdbg/fake.c | 12 +- libpdbg/libpdbg.h | 4 + libpdbg/target.c | 5 + src/cfam.c | 48 +-- src/main.c | 355 ++++++++++------------ src/path.c | 332 ++++++++++++++++++++ src/path.h | 103 +++++++ src/reg.c | 155 ++++++---- src/scom.c | 95 ++++-- src/util.c | 95 ++++++ src/util.h | 34 +++ tests/test_hw_bmc.sh | 9 +- tests/test_selection.sh | 634 +++++++++++++++++++-------------------- tests/test_selection2.sh | 559 ++++++++++++++++++++++++++++++++++ 15 files changed, 1807 insertions(+), 640 deletions(-) create mode 100644 src/path.c create mode 100644 src/path.h create mode 100644 src/util.c create mode 100644 src/util.h create mode 100755 tests/test_selection2.sh