diff options
Diffstat (limited to 'scripts/gdb/linux/clk.py')
-rw-r--r-- | scripts/gdb/linux/clk.py | 23 |
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 | ||
46 | LxClkSummary() | 46 | LxClkSummary() |
47 | |||
48 | |||
49 | class 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 | |||
69 | LxClkCoreLookup() | ||