Re: [PATCH 2/3] scripts/gdb: Initial clk support: lx-clk-summary

From: Stephen Boyd
Date: Mon Apr 22 2019 - 16:22:06 EST


Quoting Leonard Crestez (2019-04-22 01:26:57)
> +
> +
> +class LxClkSummary(gdb.Command):
> + """Print Linux kernel log buffer."""

This comment needs an update.

> +
> + def __init__(self):
> + super(LxClkSummary, self).__init__("lx-clk-summary", gdb.COMMAND_DATA)
> +
> + def show_subtree(self, clk, level):
> + gdb.write("%*s%-*s %7d %8d %8d\n" % (
> + level * 3 + 1, "",
> + 30 - level * 3,
> + clk['name'].string(),
> + clk['enable_count'],
> + clk['prepare_count'],
> + clk['protect_count']))

Would be nice to also print the rate, phase, etc. It's all pretty much
there already so it's just dumping data out. If it's a clk that has
CLK_GET_RATE_NOCACHE then I guess we have to print out '<unknown>'
because it relies on runtime code execution.

> +
> + for child in clk_core_for_each_child(clk['children']):
> + self.show_subtree(child, level + 1)