From nobody Wed Nov 12 03:45:33 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1567601565; cv=none; d=zoho.com; s=zohoarc; b=CCwsQr7Sp05TyK29RW10M+ylJKXPHawOxiNQzwyMfG0sx+FWVFU8qJbRquA8U8Mn4x/dRAW2TszNUZOHAjCipJfyp/ZcAFi/PjOOIm14oC59Z/EfvaxpUwoIEXZWg9DyTiF6RMr7yPGXV8Ea9uNXt5Kk+eWurr2IhGef6nMSUk0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567601565; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=VJ4WddnZqt6DiP2aBroZGBcVdbR4+jNSA7hOukb011c=; b=iRy50mhBJrJmrjQZutoU1PfrSktvmqGbpjZUDCTiJi5ODbWj2V0Mk7ryhAgpXuJqTQ7eoywnqqORL5Lt+P62NtOjnbXV1gFMKq45KoE/AJJ5rMO3YpsGY/+eZA1gRTY3opv5IU8kNoYm5Qvd2sL9aW4ya8ix7QvapJkMj30kh7k= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1567601565362634.444358381339; Wed, 4 Sep 2019 05:52:45 -0700 (PDT) Received: from localhost ([::1]:57414 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5Um9-00027N-US for importer@patchew.org; Wed, 04 Sep 2019 08:52:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47849) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5Rqr-0004r1-PC for qemu-devel@nongnu.org; Wed, 04 Sep 2019 05:45:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i5Rqq-00004y-6m for qemu-devel@nongnu.org; Wed, 04 Sep 2019 05:45:21 -0400 Received: from beetle.greensocs.com ([5.135.226.135]:40562) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i5Rqm-0008Pn-Pr; Wed, 04 Sep 2019 05:45:16 -0400 Received: from crumble.bar.greensocs.com (crumble.bar.greensocs.com [172.16.11.102]) by beetle.greensocs.com (Postfix) with ESMTPS id 8837596F57; Wed, 4 Sep 2019 09:38:52 +0000 (UTC) From: damien.hedde@greensocs.con To: qemu-devel@nongnu.org Date: Wed, 4 Sep 2019 11:38:38 +0200 Message-Id: <20190904093843.8765-5-damien.hedde@greensocs.con> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190904093843.8765-1-damien.hedde@greensocs.con> References: <20190904093843.8765-1-damien.hedde@greensocs.con> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 5.135.226.135 X-Mailman-Approved-At: Wed, 04 Sep 2019 08:47:47 -0400 Subject: [Qemu-devel] [PATCH v6 4/9] qdev-monitor: print the device's clock with info qtree X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Damien Hedde , peter.maydell@linaro.org, berrange@redhat.com, ehabkost@redhat.com, alistair@alistair23.me, mark.burton@greensocs.com, pbonzini@redhat.com, qemu-arm@nongnu.org, marcandre.lureau@redhat.com, edgar.iglesias@gmail.com, philmd@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Damien Hedde This prints the clocks attached to a DeviceState when using "info qtree" mo= nitor 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- qdev-monitor.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/qdev-monitor.c b/qdev-monitor.c index a0003bf2a9..d5b8be956b 100644 --- a/qdev-monitor.c +++ b/qdev-monitor.c @@ -19,6 +19,7 @@ =20 #include "qemu/osdep.h" #include "hw/sysbus.h" +#include "hw/clock.h" #include "monitor/monitor.h" #include "monitor/qdev.h" #include "sysemu/arch_init.h" @@ -689,6 +690,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 : ""); @@ -703,6 +705,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_hz=3D%" PRIu64"\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.22.0