linux-sg2042/scripts/gdb/linux
Leonard Crestez 778c1f5ccb scripts/gdb: add helpers to find and list devices
Add helper commands and functions for finding pointers to struct device
by enumerating linux device bus/class infrastructure.  This can be used
to fetch subsystem and driver-specific structs:

  (gdb) p *$container_of($lx_device_find_by_class_name("net", "eth0"), "struct net_device", "dev")
  (gdb) p *$container_of($lx_device_find_by_bus_name("i2c", "0-004b"), "struct i2c_client", "dev")
  (gdb) p *(struct imx_port*)$lx_device_find_by_class_name("tty", "ttymxc1")->parent->driver_data

Several generic "lx-device-list" functions are included to enumerate
devices by bus and class:

  (gdb) lx-device-list-bus usb
  (gdb) lx-device-list-class
  (gdb) lx-device-list-tree &platform_bus

Similar information is available in /sys but pointer values are
deliberately hidden.

Link: http://lkml.kernel.org/r/c948628041311cbf1b9b4cff3dda7d2073cb3eaa.1561492937.git.leonard.crestez@nxp.com
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Cc: Kieran Bingham <kbingham@kernel.org>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2019-07-16 19:23:24 -07:00
..
.gitignore scripts/gdb: add constants.py to .gitignore 2016-07-15 14:54:27 +09:00
Makefile kbuild: replace KBUILD_SRCTREE with boolean building_out_of_srctree 2019-07-11 00:05:09 +09:00
__init__.py scripts/gdb: add empty package initialization script 2015-02-28 09:57:51 -08:00
clk.py scripts/gdb: print cached rate in lx-clk-summary 2019-05-14 19:52:52 -07:00
config.py scripts/gdb: add kernel config dumping command 2019-05-14 19:52:51 -07:00
constants.py.in scripts/gdb: fix invocation when CONFIG_COMMON_CLK is not set 2019-06-01 15:51:31 -07:00
cpus.py scripts/gdb: silence pep8 checks 2019-05-14 19:52:52 -07:00
device.py scripts/gdb: add helpers to find and list devices 2019-07-16 19:23:24 -07:00
dmesg.py scripts/gdb: lx-dmesg: use explicit encoding=utf8 errors=replace 2017-07-12 16:26:01 -07:00
genpd.py scripts/gdb: add lx-genpd-summary command 2019-07-16 19:23:24 -07:00
lists.py scripts/gdb: clean up error handling in list helpers 2019-05-14 19:52:52 -07:00
modules.py scripts/gdb: support !CONFIG_MODULES gracefully 2016-05-23 17:04:14 -07:00
proc.py scripts/gdb: silence pep8 checks 2019-05-14 19:52:52 -07:00
rbtree.py scripts/gdb: add rb tree iterating utilities 2019-05-14 19:52:51 -07:00
symbols.py scripts/gdb: find vmlinux where it was before 2019-05-14 19:52:51 -07:00
tasks.py scripts/gdb: silence pep8 checks 2019-05-14 19:52:52 -07:00
timerlist.py scripts/gdb: add a timer list command 2019-05-14 19:52:52 -07:00
utils.py scripts/gdb: silence pep8 checks 2019-05-14 19:52:52 -07:00