[Pdbg] [PATCH v4 00/16] Device tree path based targeting

Amitay Isaacs amitay at ozlabs.org
Fri Nov 16 12:14:15 AEDT 2018


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<index>: <addr> = <value>" for fsi targets
  - getscom prints translated addresses and device tree path

V4 changes:
  - Drop unnecessary marking of targets in for probe()

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               | 338 +++++++++------------
 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, 1789 insertions(+), 641 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

-- 
2.19.1



More information about the Pdbg mailing list