From patchwork Tue Oct 2 14:24:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Damien Hedde X-Patchwork-Id: 10623795 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A2484174E for ; Tue, 2 Oct 2018 14:44:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FC90201BC for ; Tue, 2 Oct 2018 14:44:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 845DD201CB; Tue, 2 Oct 2018 14:44:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0BEE8201BC for ; Tue, 2 Oct 2018 14:44:12 +0000 (UTC) Received: from localhost ([::1]:44055 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7LuF-00042s-KX for patchwork-qemu-devel@patchwork.kernel.org; Tue, 02 Oct 2018 10:44:11 -0400 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 Received: from greensocs.com ([193.104.36.180]:53815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7Ld9-0004Ky-E2; Tue, 02 Oct 2018 10:26:31 -0400 Received: from localhost (localhost [127.0.0.1]) by greensocs.com (Postfix) with ESMTP id 328B8442AEC; Tue, 2 Oct 2018 16:26:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=greensocs.com; s=mail; t=1538490366; bh=FABDGza8O8IXXcL2AXTXajpC14NFz8iYXb5Sqj8mK8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=I2mDQ/VPJeKkVbDyj/oHDbhy0Q54iQeSsTKfc4f2zaPtAOBAc5ryPZTsgPwOxRb81 EbfYhwCjmPYB+YjVtS66gjRe0mCRwuJUhCYrf32h4WyrrlxHqQBEyyti7r3/oCOAVK m1yFDbiyU++tqXknBcd4LCRk1oNueRobQO/kQ7A8= X-Virus-Scanned: amavisd-new at greensocs.com Authentication-Results: gs-01.greensocs.com (amavisd-new); dkim=pass (1024-bit key) header.d=greensocs.com header.b=GyuUaZGz; dkim=pass (1024-bit key) header.d=greensocs.com header.b=GyuUaZGz Received: from greensocs.com ([127.0.0.1]) by localhost (gs-01.greensocs.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DmLwSbXdySxe; Tue, 2 Oct 2018 16:26:05 +0200 (CEST) Received: by greensocs.com (Postfix, from userid 998) id 28BED442AF9; Tue, 2 Oct 2018 16:26:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=greensocs.com; s=mail; t=1538490365; bh=FABDGza8O8IXXcL2AXTXajpC14NFz8iYXb5Sqj8mK8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GyuUaZGzGGN5LtxLmojGJCqLPAXqnePxt5aa0MMAFF0tCKGYstoeGtiBNnzbO7o7Y l/28kGlQIld7E/QTOLkao2t6n4PsTP3WXUW3mI8d++GAbHvE2sk8qc2UIocqJ/lhoX 091KDL4KsZUg1MkIU4yCW1+SSGJ2HgSIUnWBoHgQ= Received: from kouign-amann.hive.antfield.fr (antfield.tima.u-ga.fr [147.171.129.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: damien.hedde@greensocs.com) by greensocs.com (Postfix) with ESMTPSA id B6AC7442AF8; Tue, 2 Oct 2018 16:26:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=greensocs.com; s=mail; t=1538490365; bh=FABDGza8O8IXXcL2AXTXajpC14NFz8iYXb5Sqj8mK8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GyuUaZGzGGN5LtxLmojGJCqLPAXqnePxt5aa0MMAFF0tCKGYstoeGtiBNnzbO7o7Y l/28kGlQIld7E/QTOLkao2t6n4PsTP3WXUW3mI8d++GAbHvE2sk8qc2UIocqJ/lhoX 091KDL4KsZUg1MkIU4yCW1+SSGJ2HgSIUnWBoHgQ= From: Damien Hedde To: qemu-devel@nongnu.org Date: Tue, 2 Oct 2018 16:24:37 +0200 Message-Id: <20181002142443.30976-4-damien.hedde@greensocs.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181002142443.30976-1-damien.hedde@greensocs.com> References: <20181002142443.30976-1-damien.hedde@greensocs.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 193.104.36.180 Subject: [Qemu-devel] [PATCH v5 3/9] qdev-monitor: print the device's clock with info qtree X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, alistair@alistair23.me, mark.burton@greensocs.com, saipava@xilinx.com, qemu-arm@nongnu.org, Damien Hedde , pbonzini@redhat.com, konrad@adacore.com, luc.michel@greensocs.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- 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", + 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);