From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7Lmw-0005FG-7W for qemu-devel@nongnu.org; Tue, 02 Oct 2018 10:36:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g7LdC-0004QB-IL for qemu-devel@nongnu.org; Tue, 02 Oct 2018 10:26:35 -0400 From: Damien Hedde Date: Tue, 2 Oct 2018 16:24:37 +0200 Message-Id: <20181002142443.30976-4-damien.hedde@greensocs.com> In-Reply-To: <20181002142443.30976-1-damien.hedde@greensocs.com> References: <20181002142443.30976-1-damien.hedde@greensocs.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v5 3/9] qdev-monitor: print the device's clock with info qtree List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, pbonzini@redhat.com, peter.maydell@linaro.org, alistair@alistair23.me, saipava@xilinx.com, mark.burton@greensocs.com, luc.michel@greensocs.com, konrad@adacore.com, edgar.iglesias@xilinx.com, Damien Hedde 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. Signed-off-by: Damien Hedde --- 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; =20 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 *de= v, 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=3D%" PRIu64 "Hz\n", + clk->forward ? " (fw)" : "", + clk->name, clock_get_frequency(clk->in)); + } + } class =3D object_get_class(OBJECT(dev)); do { qdev_print_props(mon, dev, DEVICE_CLASS(class)->props, indent); --=20 2.19.0