From nobody Wed Nov 5 09:27:47 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534483466200321.1530699797879; Thu, 16 Aug 2018 22:24:26 -0700 (PDT) Received: from localhost ([::1]:60010 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqXFJ-00062U-4M for importer@patchew.org; Fri, 17 Aug 2018 01:24:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqXA8-0000dC-Ov for qemu-devel@nongnu.org; Fri, 17 Aug 2018 01:19:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fqXA7-0005bg-Ik for qemu-devel@nongnu.org; Fri, 17 Aug 2018 01:19:04 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:33471) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fqXA6-0005Ys-Ko for qemu-devel@nongnu.org; Fri, 17 Aug 2018 01:19:03 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3C4C321EE9; Fri, 17 Aug 2018 01:18:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 17 Aug 2018 01:18:58 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id CF85610289; Fri, 17 Aug 2018 01:18:57 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=z6TwBIqv3+8NS0 +Yz1W7WJJExAmF1Wzv8D0whxaKSCY=; b=1y508dTWWBuxUJh6mmvNBG6TOLXfAz zYk543bBiyAEswntMJF789Kb5gWSn233wdd4ZrSP+gJKU4lHGgxE/RpxdSLKu3hB 8nZ2yXtHomSQMwwoprrhg7RDGRGPBirPpIL2q+avpG7F/5X3N2B8TDz6PsKYD5Ji u3oFhvw2RsoEg= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=z6TwBIqv3+8NS0+Yz1W7WJJExAmF1Wzv8D0whxaKSCY=; b=DDdnPIMw GASRw3A2rUqTmR9ry1qWzQyUYpm2sQ2mp7R1Ap/gdrH0aMla6ofmXqfP3wZLiDOQ 5S7mn+4XrRMBNmgALJUqg3YFlPFcdSutaFf1uDwD1CRzPvpJlUTewDlZngPWllRO TtBUB4HHvubercflxoM4JVMqLIKKvegbe6Kre5tXtw3VlKxVMOUnQTjBpt8if+Yy ZeiGoQNxv5aSZdc3gWBg2/cJ21iTKnTh5khHQSmGEbgLYn2gXED7vxDsBugmDkPu ACd4lJWAVhRh0++Yv4/hZA7IHjOvJt7xW1sl5n3aEwimjK1SDPRR57RpgDOP+u3Y 9v9OxsTEiyz+GQ== X-ME-Proxy: X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Fri, 17 Aug 2018 01:18:52 -0400 Message-Id: <20180817051853.23792-9-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180817051853.23792-1-cota@braap.org> References: <20180817051853.23792-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.25 Subject: [Qemu-devel] [PATCH 8/9] hmp-commands: add sync-profile 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: Fam Zheng , Peter Crosthwaite , Stefan Weil , "Dr. David Alan Gilbert" , Peter Xu , Markus Armbruster , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The command introduced here is just for developers. This means that: - the interface implemented here could change in the future - the command is only meant to be used from HMP, not from QMP Signed-off-by: Emilio G. Cota Reviewed-by: Dr. David Alan Gilbert --- hmp.h | 1 + hmp.c | 24 ++++++++++++++++++++++++ hmp-commands.hx | 15 +++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/hmp.h b/hmp.h index 33354f1bdd..5f1addcca2 100644 --- a/hmp.h +++ b/hmp.h @@ -42,6 +42,7 @@ void hmp_info_tpm(Monitor *mon, const QDict *qdict); void hmp_info_iothreads(Monitor *mon, const QDict *qdict); void hmp_quit(Monitor *mon, const QDict *qdict); void hmp_stop(Monitor *mon, const QDict *qdict); +void hmp_sync_profile(Monitor *mon, const QDict *qdict); void hmp_system_reset(Monitor *mon, const QDict *qdict); void hmp_system_powerdown(Monitor *mon, const QDict *qdict); void hmp_exit_preconfig(Monitor *mon, const QDict *qdict); diff --git a/hmp.c b/hmp.c index 2aafb50e8e..d94a47f7c7 100644 --- a/hmp.c +++ b/hmp.c @@ -1062,6 +1062,30 @@ void hmp_stop(Monitor *mon, const QDict *qdict) qmp_stop(NULL); } =20 +void hmp_sync_profile(Monitor *mon, const QDict *qdict) +{ + const char *op =3D qdict_get_try_str(qdict, "op"); + + if (op =3D=3D NULL) { + bool on =3D qsp_is_enabled(); + + monitor_printf(mon, "sync-profile is %s\n", on ? "on" : "off"); + return; + } + if (!strcmp(op, "on")) { + qsp_enable(); + } else if (!strcmp(op, "off")) { + qsp_disable(); + } else if (!strcmp(op, "reset")) { + qsp_reset(); + } else { + Error *err =3D NULL; + + error_setg(&err, QERR_INVALID_PARAMETER, op); + hmp_handle_error(mon, &err); + } +} + void hmp_system_reset(Monitor *mon, const QDict *qdict) { qmp_system_reset(NULL); diff --git a/hmp-commands.hx b/hmp-commands.hx index c1fc747403..db0c681f74 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -643,6 +643,21 @@ sendkey ctrl-alt-f1 =20 This command is useful to send keys that your graphical user interface intercepts at low level, such as @code{ctrl-alt-f1} in X Window. +ETEXI + { + .name =3D "sync-profile", + .args_type =3D "op:s?", + .params =3D "[on|off|reset]", + .help =3D "enable, disable or reset synchronization profilin= g. " + "With no arguments, prints whether profiling is on o= r off.", + .cmd =3D hmp_sync_profile, + }, + +STEXI +@item sync-profile [on|off|reset] +@findex sync-profile +Enable, disable or reset synchronization profiling. With no arguments, pri= nts +whether profiling is on or off. ETEXI =20 { --=20 2.17.1