qdev-monitor: print the device's clock with info qtree
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.
This is based on the original work of Frederic Konrad.
Here follows a sample of `info qtree` output on xilinx_zynq machine
after linux boot with only one uart clocked:
> bus: main-system-bus
> type System
> [...]
> dev: cadence_uart, id ""
> gpio-out "sysbus-irq" 1
> clock-in "refclk" freq_hz=0.
000000e+00
> chardev = ""
> mmio
00000000e0001000/
0000000000001000
> dev: cadence_uart, id ""
> gpio-out "sysbus-irq" 1
> clock-in "refclk" freq_hz=1.
375661e+07
> chardev = "serial0"
> mmio
00000000e0000000/
0000000000001000
> [...]
> dev: xilinx,zynq_slcr, id ""
> clock-out "uart1_ref_clk" freq_hz=0.
000000e+00
> clock-out "uart0_ref_clk" freq_hz=1.
375661e+07
> clock-in "ps_clk" freq_hz=3.
333333e+07
> mmio
00000000f8000000/
0000000000001000
Signed-off-by: Damien Hedde <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Reviewed-by: Edgar E. Iglesias <[email protected]>
Message-id:
20200406135251[email protected]
Signed-off-by: Peter Maydell <[email protected]>