From nobody Mon Nov 10 09:49:26 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; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1555529254; cv=none; d=zoho.com; s=zohoarc; b=GeL8nQBvFFJojUX+liGgmWOzr9uEEA71iiMcziwpbPm/uQ2eCwNv63B/1FFDjk1kp9XsKfM1P3SPp5/N1hHCtvL7eOyrCsIJSdRBw/ezPDIez26lYM7FVs6hBUhLl2v2yhJEldpDl/KsljsjMo2a193uKWsud9cNhclOXPxA2xk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1555529254; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=P9guxvk26IoowyG7nbqNqCBvg/dHzJ4YEZnFb7a4XtM=; b=RGJXTgh+gb3x1WRtELKS8FnjbTnpjsOq+xE86nP8odtPGtFHmR3N5m3oWQHMBfUP2T30IBPY1c8wsR8iKqym5m1A2Qv0drhYoC3E7j/zregtXkfOZuQi8kRnOrYWFEXvzp7fzGzyyUMv/H/TgtZg8dn5kGgsfNVqKdmCSBXJzjE= 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; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155552925482977.71110570067685; Wed, 17 Apr 2019 12:27:34 -0700 (PDT) Received: from localhost ([127.0.0.1]:58426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGqDT-00075e-MS for importer@patchew.org; Wed, 17 Apr 2019 15:27:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGq4U-0008R0-Jn for qemu-devel@nongnu.org; Wed, 17 Apr 2019 15:18:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hGq4R-0008Rk-BX for qemu-devel@nongnu.org; Wed, 17 Apr 2019 15:18:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52648) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hGq4P-0008Nd-En for qemu-devel@nongnu.org; Wed, 17 Apr 2019 15:18:10 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B306A3078ABD for ; Wed, 17 Apr 2019 19:18:08 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-116.ams2.redhat.com [10.36.116.116]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7D81C5D71E; Wed, 17 Apr 2019 19:18:08 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 7E86E1132B38; Wed, 17 Apr 2019 21:18:05 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 17 Apr 2019 21:17:53 +0200 Message-Id: <20190417191805.28198-6-armbru@redhat.com> In-Reply-To: <20190417191805.28198-1-armbru@redhat.com> References: <20190417191805.28198-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 17 Apr 2019 19:18:08 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 05/17] tcg: Simplify how dump_drift_info() prints 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: dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" dump_drift_info() takes an fprintf()-like callback and a FILE * to pass to it. Its only caller hmp_info_jit() passes monitor_fprintf() and a Monitor * cast to FILE *. monitor_fprintf() casts it right back, and is otherwise identical to monitor_printf(). The type-punning is ugly. Drop the callback, and call qemu_printf() instead. Signed-off-by: Markus Armbruster Reviewed-by: Dr. David Alan Gilbert --- cpus.c | 15 +++++++++------ include/sysemu/cpus.h | 2 +- monitor.c | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/cpus.c b/cpus.c index e83f72b48b..684aa9679a 100644 --- a/cpus.c +++ b/cpus.c @@ -31,6 +31,7 @@ #include "qapi/qapi-events-run-state.h" #include "qapi/qmp/qerror.h" #include "qemu/error-report.h" +#include "qemu/qemu-print.h" #include "sysemu/sysemu.h" #include "sysemu/block-backend.h" #include "exec/gdbstub.h" @@ -2454,19 +2455,21 @@ void qmp_inject_nmi(Error **errp) nmi_monitor_handle(monitor_get_cpu_index(), errp); } =20 -void dump_drift_info(FILE *f, fprintf_function cpu_fprintf) +void dump_drift_info(void) { if (!use_icount) { return; } =20 - cpu_fprintf(f, "Host - Guest clock %"PRIi64" ms\n", + qemu_printf("Host - Guest clock %"PRIi64" ms\n", (cpu_get_clock() - cpu_get_icount())/SCALE_MS); if (icount_align_option) { - cpu_fprintf(f, "Max guest delay %"PRIi64" ms\n", -max_delay/SC= ALE_MS); - cpu_fprintf(f, "Max guest advance %"PRIi64" ms\n", max_advance/S= CALE_MS); + qemu_printf("Max guest delay %"PRIi64" ms\n", + -max_delay / SCALE_MS); + qemu_printf("Max guest advance %"PRIi64" ms\n", + max_advance / SCALE_MS); } else { - cpu_fprintf(f, "Max guest delay NA\n"); - cpu_fprintf(f, "Max guest advance NA\n"); + qemu_printf("Max guest delay NA\n"); + qemu_printf("Max guest advance NA\n"); } } diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h index eea0010b53..ef13a120cc 100644 --- a/include/sysemu/cpus.h +++ b/include/sysemu/cpus.h @@ -19,7 +19,7 @@ extern int icount_align_option; /* drift information for info jit command */ extern int64_t max_delay; extern int64_t max_advance; -void dump_drift_info(FILE *f, fprintf_function cpu_fprintf); +void dump_drift_info(void); =20 /* Unblock cpu */ void qemu_cpu_kick_self(void); diff --git a/monitor.c b/monitor.c index 24e4d49d11..7573689585 100644 --- a/monitor.c +++ b/monitor.c @@ -1319,7 +1319,7 @@ static void hmp_info_jit(Monitor *mon, const QDict *q= dict) } =20 dump_exec_info(); - dump_drift_info((FILE *)mon, monitor_fprintf); + dump_drift_info(); } =20 static void hmp_info_opcount(Monitor *mon, const QDict *qdict) --=20 2.17.2