mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]>
Cc: Jan Kiszka <[email protected]>
Cc: Jason Wessel <[email protected]>
Cc: Kieran Bingham <[email protected]>
Cc: Stephen Boyd <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
d1e9710b63
commit
988b268615
1 changed files with 23 additions and 0 deletions
|
|
@ -44,3 +44,26 @@ class LxClkSummary(gdb.Command):
|
|||
|
||||
|
||||
LxClkSummary()
|
||||
|
||||
|
||||
class LxClkCoreLookup(gdb.Function):
|
||||
"""Find struct clk_core by name"""
|
||||
|
||||
def __init__(self):
|
||||
super(LxClkCoreLookup, self).__init__("lx_clk_core_lookup")
|
||||
|
||||
def lookup_hlist(self, hlist_head, name):
|
||||
for child in clk_core_for_each_child(hlist_head):
|
||||
if child['name'].string() == name:
|
||||
return child
|
||||
result = self.lookup_hlist(child['children'], name)
|
||||
if result:
|
||||
return result
|
||||
|
||||
def invoke(self, name):
|
||||
name = name.string()
|
||||
return (self.lookup_hlist(gdb.parse_and_eval("clk_root_list"), name) or
|
||||
self.lookup_hlist(gdb.parse_and_eval("clk_orphan_list"), name))
|
||||
|
||||
|
||||
LxClkCoreLookup()
|
||||
|
|
|
|||
Loading…
Reference in a new issue