[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [Qemu-devel] [PATCH v5 3/9] qdev-monitor: print the devic
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-arm] [Qemu-devel] [PATCH v5 3/9] qdev-monitor: print the device's clock with info qtree |
Date: |
Wed, 3 Oct 2018 00:42:31 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
Hi Damien,
On 10/2/18 4:24 PM, Damien Hedde wrote:
> This prints the clocks attached to a DeviceState when using "info qtree"
> monitor
> command. For every clock, it displays the direction, the name and if the
> clock is forwarded. For input clock, it displays also the frequency.
What would also be really useful (during development mostly)
is a "info clktree" monitor command.
>
> This is based on the original work of Frederic Konrad.
>
> Signed-off-by: Damien Hedde <address@hidden>
> ---
> qdev-monitor.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/qdev-monitor.c b/qdev-monitor.c
> index 61e0300991..8c39a3a65b 100644
> --- a/qdev-monitor.c
> +++ b/qdev-monitor.c
> @@ -682,6 +682,7 @@ static void qdev_print(Monitor *mon, DeviceState *dev,
> int indent)
> ObjectClass *class;
> BusState *child;
> NamedGPIOList *ngl;
> + NamedClockList *clk;
>
> qdev_printf("dev: %s, id \"%s\"\n", object_get_typename(OBJECT(dev)),
> dev->id ? dev->id : "");
> @@ -696,6 +697,17 @@ static void qdev_print(Monitor *mon, DeviceState *dev,
> int indent)
> ngl->num_out);
> }
> }
> + QLIST_FOREACH(clk, &dev->clocks, node) {
> + if (clk->out) {
> + qdev_printf("clock-out%s \"%s\"\n",
> + clk->forward ? " (fw)" : "",
> + clk->name);
> + } else {
> + qdev_printf("clock-in%s \"%s\" freq=%" PRIu64 "Hz\n",
IMHO 'freq_hz=%" PRIu64 "\n"' is easier to read.
However if we plan to add/use a qemu_strtohz() similar to
qemu_strtosz_metric(), that would be fine.
> + clk->forward ? " (fw)" : "",
> + clk->name, clock_get_frequency(clk->in));
> + }
> + }
> class = object_get_class(OBJECT(dev));
> do {
> qdev_print_props(mon, dev, DEVICE_CLASS(class)->props, indent);
>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
- [Qemu-arm] [PATCH v5 6/9] hw/misc/zynq_slcr: use standard register definition, (continued)
- [Qemu-arm] [PATCH v5 6/9] hw/misc/zynq_slcr: use standard register definition, Damien Hedde, 2018/10/02
- [Qemu-arm] [PATCH v5 2/9] qdev: add clock input&output support to devices., Damien Hedde, 2018/10/02
- [Qemu-arm] [PATCH v5 5/9] docs/clocks: add device's clock documentation, Damien Hedde, 2018/10/02
- [Qemu-arm] [PATCH v5 4/9] qdev-clock: introduce an init array to ease the device construction, Damien Hedde, 2018/10/02
- [Qemu-arm] [PATCH v5 3/9] qdev-monitor: print the device's clock with info qtree, Damien Hedde, 2018/10/02
- Re: [Qemu-arm] [Qemu-devel] [PATCH v5 3/9] qdev-monitor: print the device's clock with info qtree,
Philippe Mathieu-Daudé <=
- [Qemu-arm] [PATCH v5 7/9] hw/misc/zynq_slcr: add clock generation for uarts, Damien Hedde, 2018/10/02
- [Qemu-arm] [PATCH v5 1/9] hw/core/clock-port: introduce clock port objects, Damien Hedde, 2018/10/02
- Re: [Qemu-arm] [Qemu-devel] [PATCH v5 0/9] Clock framework API., Philippe Mathieu-Daudé, 2018/10/04