From patchwork Mon Sep 17 08:40:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Hedde X-Patchwork-Id: 10602217 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 D4F9F6CB for ; Mon, 17 Sep 2018 08:44:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C44AD295CA for ; Mon, 17 Sep 2018 08:44:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B860129651; Mon, 17 Sep 2018 08:44:40 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 574F8295CA for ; Mon, 17 Sep 2018 08:44:40 +0000 (UTC) Received: from localhost ([::1]:34439 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1p95-0000Hh-M4 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 17 Sep 2018 04:44:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1p5x-0006AL-Kv for qemu-devel@nongnu.org; Mon, 17 Sep 2018 04:41:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g1p5w-0005cR-Ew for qemu-devel@nongnu.org; Mon, 17 Sep 2018 04:41:25 -0400 Received: from greensocs.com ([193.104.36.180]:51713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1p5o-0005TK-Vj; Mon, 17 Sep 2018 04:41:17 -0400 Received: from localhost (localhost [127.0.0.1]) by greensocs.com (Postfix) with ESMTP id 0BF4E521AB4; Mon, 17 Sep 2018 10:41:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=greensocs.com; s=mail; t=1537173670; bh=AnN1kydemsdQzi0SUDrl/dMsn9qI3l7wu7DbVb6OtSs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=R9XNEVBZ7JcpgF64SEUTZdM2bInyKKrtiOaDLrkdhT/gRGQ/ReU4kp0rTns31EcKx cSp47tQyYcdQX3QVNcl2b+M/Sip5yEWCPzbBYSn0rzWlpTJWDAiJTJJ0mNcZEnGVz8 QI5LCopDIFtxFrJGYozYQwRtGG7o1+Sva3nBzczs= 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=qzUPl1XI; dkim=pass (1024-bit key) header.d=greensocs.com header.b=SHxOE7MZ 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 5IJjXSQbtzCO; Mon, 17 Sep 2018 10:41:09 +0200 (CEST) Received: by greensocs.com (Postfix, from userid 998) id 00647443480; Mon, 17 Sep 2018 10:41:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=greensocs.com; s=mail; t=1537173669; bh=AnN1kydemsdQzi0SUDrl/dMsn9qI3l7wu7DbVb6OtSs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qzUPl1XIxbycVvBLcuzwH1EViyeO0cZgZr4GcN3ijmamggwf6c3zRygFlxqzF93oR sunXuvry41ZClLVQCo986WGJGGSeS+cvcUuj4qvli/qvcZyyQWPt/WDrHalw47iszB /+Cn0xAGrGeJ8rG/sj+5j65y5BRDZlu7J5exEioI= 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 64C77443483; Mon, 17 Sep 2018 10:41:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=greensocs.com; s=mail; t=1537173668; bh=AnN1kydemsdQzi0SUDrl/dMsn9qI3l7wu7DbVb6OtSs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SHxOE7MZcSfH0eQZ6qdFEEcFhsYgFrWWGccl3OIiZpqjDTVo7k208YPUi9bB2MXKn hmZJWe+beJDFybCDewoOT3E2j9vBJneOC2d+CgF9A0u/FWOprWa+cZQmPkCML7ghFd ne0lb38SE8yPqqu0VpiqBzy/28LnFZ7yQEWzkgjM= From: damien.hedde@greensocs.com To: qemu-devel@nongnu.org Date: Mon, 17 Sep 2018 10:40:09 +0200 Message-Id: <20180917084016.12750-4-damien.hedde@greensocs.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180917084016.12750-1-damien.hedde@greensocs.com> References: <20180917084016.12750-1-damien.hedde@greensocs.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 193.104.36.180 Subject: [Qemu-devel] [PATCH v4 03/10] 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, luc.michel@greensocs.com, fred.konrad@greensocs.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: 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. This is based on the original work of Frederic Konrad. Signed-off-by: Damien Hedde --- qdev-monitor.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qdev-monitor.c b/qdev-monitor.c index 61e0300991..c6f07a49d2 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,11 @@ static void qdev_print(Monitor *mon, DeviceState *dev, int indent) ngl->num_out); } } + QLIST_FOREACH(clk, &dev->clocks, node) { + qdev_printf("clock-%s \"%s\"%s\n", + clk->out ? "out" : "in", clk->name, + clk->forward ? " FW" : ""); + } class = object_get_class(OBJECT(dev)); do { qdev_print_props(mon, dev, DEVICE_CLASS(class)->props, indent);