[Pdbg] [PATCH v2 00/15] Device tree path based targeting

Amitay Isaacs amitay at ozlabs.org
Fri Nov 9 18:09:56 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.

    -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:


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 (*)]

Amitay Isaacs (15):
  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
  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 +-
 src/cfam.c               |  60 ++--
 src/main.c               | 353 +++++++++-------------
 src/path.c               | 332 ++++++++++++++++++++
 src/path.h               | 109 +++++++
 src/reg.c                | 151 ++++++----
 src/scom.c               |  87 ++++--
 src/util.c               |  95 ++++++
 src/util.h               |  34 +++
 tests/test_hw_bmc.sh     |   6 +-
 tests/test_selection.sh  | 634 +++++++++++++++++++--------------------
 tests/test_selection2.sh | 559 ++++++++++++++++++++++++++++++++++
 13 files changed, 1800 insertions(+), 639 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


More information about the Pdbg mailing list