aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/gdb/linux/clk.py
diff options
context:
space:
mode:
authorLeonard Crestez <leonard.crestez@nxp.com>2019-05-14 18:46:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-05-14 22:52:52 -0400
commit988b2686159759401a4549d0fc30ff9a8758391a (patch)
tree4f5b16aea3f51fdf257e5b4d3bf00e039d6cf3df /scripts/gdb/linux/clk.py
parentd1e9710b63d87209e1a14d6e6d8cf1431d8daa31 (diff)
scripts/gdb: add $lx_clk_core_lookup function
Finding an individual clk_core requires walking the tree which can be quite complicated so add a helper for easy access. (gdb) print *(struct clk_scu*)$lx_clk_core_lookup("uart0_clk")->hw Link: http://lkml.kernel.org/r/Message-ID: Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com> Cc: Jan Kiszka <jan.kiszka@siemens.com> Cc: Jason Wessel <jason.wessel@windriver.com> Cc: Kieran Bingham <kbingham@kernel.org> Cc: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/gdb/linux/clk.py')
-rw-r--r--scripts/gdb/linux/clk.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/gdb/linux/clk.py b/scripts/gdb/linux/clk.py
index a9129d865c5d..6bf71976b55d 100644
--- a/scripts/gdb/linux/clk.py
+++ b/scripts/gdb/linux/clk.py
@@ -44,3 +44,26 @@ class LxClkSummary(gdb.Command):
44 44
45 45
46LxClkSummary() 46LxClkSummary()
47
48
49class LxClkCoreLookup(gdb.Function):
50 """Find struct clk_core by name"""
51
52 def __init__(self):
53 super(LxClkCoreLookup, self).__init__("lx_clk_core_lookup")
54
55 def lookup_hlist(self, hlist_head, name):
56 for child in clk_core_for_each_child(hlist_head):
57 if child['name'].string() == name:
58 return child
59 result = self.lookup_hlist(child['children'], name)
60 if result:
61 return result
62
63 def invoke(self, name):
64 name = name.string()
65 return (self.lookup_hlist(gdb.parse_and_eval("clk_root_list"), name) or
66 self.lookup_hlist(gdb.parse_and_eval("clk_orphan_list"), name))
67
68
69LxClkCoreLookup()