diff options
Diffstat (limited to 'scripts/gdb/linux/clk.py')
-rw-r--r-- | scripts/gdb/linux/clk.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/scripts/gdb/linux/clk.py b/scripts/gdb/linux/clk.py index 6bf71976b55d..061aecfa294e 100644 --- a/scripts/gdb/linux/clk.py +++ b/scripts/gdb/linux/clk.py | |||
@@ -5,7 +5,7 @@ | |||
5 | import gdb | 5 | import gdb |
6 | import sys | 6 | import sys |
7 | 7 | ||
8 | from linux import utils, lists | 8 | from linux import utils, lists, constants |
9 | 9 | ||
10 | clk_core_type = utils.CachedType("struct clk_core") | 10 | clk_core_type = utils.CachedType("struct clk_core") |
11 | 11 | ||
@@ -16,27 +16,34 @@ def clk_core_for_each_child(hlist_head): | |||
16 | 16 | ||
17 | 17 | ||
18 | class LxClkSummary(gdb.Command): | 18 | class LxClkSummary(gdb.Command): |
19 | """Print Linux kernel log buffer.""" | 19 | """Print clk tree summary |
20 | |||
21 | Output is a subset of /sys/kernel/debug/clk/clk_summary | ||
22 | |||
23 | No calls are made during printing, instead a (c) if printed after values which | ||
24 | are cached and potentially out of date""" | ||
20 | 25 | ||
21 | def __init__(self): | 26 | def __init__(self): |
22 | super(LxClkSummary, self).__init__("lx-clk-summary", gdb.COMMAND_DATA) | 27 | super(LxClkSummary, self).__init__("lx-clk-summary", gdb.COMMAND_DATA) |
23 | 28 | ||
24 | def show_subtree(self, clk, level): | 29 | def show_subtree(self, clk, level): |
25 | gdb.write("%*s%-*s %7d %8d %8d\n" % ( | 30 | gdb.write("%*s%-*s %7d %8d %8d %11lu%s\n" % ( |
26 | level * 3 + 1, "", | 31 | level * 3 + 1, "", |
27 | 30 - level * 3, | 32 | 30 - level * 3, |
28 | clk['name'].string(), | 33 | clk['name'].string(), |
29 | clk['enable_count'], | 34 | clk['enable_count'], |
30 | clk['prepare_count'], | 35 | clk['prepare_count'], |
31 | clk['protect_count'])) | 36 | clk['protect_count'], |
37 | clk['rate'], | ||
38 | '(c)' if clk['flags'] & constants.LX_CLK_GET_RATE_NOCACHE else ' ')) | ||
32 | 39 | ||
33 | for child in clk_core_for_each_child(clk['children']): | 40 | for child in clk_core_for_each_child(clk['children']): |
34 | self.show_subtree(child, level + 1) | 41 | self.show_subtree(child, level + 1) |
35 | 42 | ||
36 | def invoke(self, arg, from_tty): | 43 | def invoke(self, arg, from_tty): |
37 | gdb.write(" enable prepare protect\n") | 44 | gdb.write(" enable prepare protect \n") |
38 | gdb.write(" clock count count count\n") | 45 | gdb.write(" clock count count count rate \n") |
39 | gdb.write("---------------------------------------------------------\n") | 46 | gdb.write("------------------------------------------------------------------------\n") |
40 | for clk in clk_core_for_each_child(gdb.parse_and_eval("clk_root_list")): | 47 | for clk in clk_core_for_each_child(gdb.parse_and_eval("clk_root_list")): |
41 | self.show_subtree(clk, 0) | 48 | self.show_subtree(clk, 0) |
42 | for clk in clk_core_for_each_child(gdb.parse_and_eval("clk_orphan_list")): | 49 | for clk in clk_core_for_each_child(gdb.parse_and_eval("clk_orphan_list")): |