The patch titled Subject: scripts/gdb: add $lx_clk_core_lookup function has been added to the -mm tree. Its filename is scripts-gdb-add-lx_clk_core_lookup-function.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/scripts-gdb-add-lx_clk_core_lookup-function.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/scripts-gdb-add-lx_clk_core_lookup-function.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Leonard Crestez <leonard.crestez@xxxxxxx> Subject: 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@xxxxxxx> Cc: Jan Kiszka <jan.kiszka@xxxxxxxxxxx> Cc: Jason Wessel <jason.wessel@xxxxxxxxxxxxx> Cc: Kieran Bingham <kbingham@xxxxxxxxxx> Cc: Stephen Boyd <swboyd@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- scripts/gdb/linux/clk.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) --- a/scripts/gdb/linux/clk.py~scripts-gdb-add-lx_clk_core_lookup-function +++ a/scripts/gdb/linux/clk.py @@ -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() _ Patches currently in -mm which might be from leonard.crestez@xxxxxxx are scripts-gdb-add-hlist-utilities.patch scripts-gdb-initial-clk-support-lx-clk-summary.patch scripts-gdb-add-lx_clk_core_lookup-function.patch