From nobody Wed Nov 5 14:26:06 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; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534872586559524.3344800612886; Tue, 21 Aug 2018 10:29:46 -0700 (PDT) Received: from localhost ([::1]:55077 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsATP-0002cx-Hw for importer@patchew.org; Tue, 21 Aug 2018 13:29:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsA4Y-0001x6-Ta for qemu-devel@nongnu.org; Tue, 21 Aug 2018 13:04:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsA4V-0006lg-6a for qemu-devel@nongnu.org; Tue, 21 Aug 2018 13:04:02 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:33788) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fsA4U-000645-6Y for qemu-devel@nongnu.org; Tue, 21 Aug 2018 13:03:58 -0400 Received: by mail-wr1-x42e.google.com with SMTP id v90-v6so13315892wrc.0 for ; Tue, 21 Aug 2018 10:03:31 -0700 (PDT) Received: from 640k.lan (dynamic-adsl-78-12-184-244.clienti.tiscali.it. [78.12.184.244]) by smtp.gmail.com with ESMTPSA id v6-v6sm2608955wmc.43.2018.08.21.10.03.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Aug 2018 10:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=06J51nv3KQBBdvxbm2k6wn9GGmgyDc2NxxrXvCm+c9U=; b=hiGJwz18znhgyEAQe1ceEcGhHvcP/+OTMhf02GzSHuEorcpC+jH6Y22k4arkO0glZD ZUu+n5BNWH2zY7RmT0hq0XF+Pho698Az+ZwN2XSK+jPKOckZvMhmkw2vphm9Fu29HEmI l5bdiS77FIQ/EwMLSNcC6E/vpxyX7ak3YMMyLNvaT6wErpAbfEvdI4JXh7ks7HLT+xpf aD3sojd3ldH3iCC+2LkyXerP32+s7nBs5dxD0vyTum1PXY7YV9p1Ewz6H0LPKcGx+Kn7 yMPEM5P0Qwr6kTnhPS/pXxLFAJwTq1Tcxw651oEQUZ/bzvY+3HxJwjdo8JmEEc6nPnNm jfnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=06J51nv3KQBBdvxbm2k6wn9GGmgyDc2NxxrXvCm+c9U=; b=Dd6dI83Bwour7t0SH1t/gxFn6KgJ9rg1vYAo8RJ5ros9dx2yJe30Py1h4ODZAaYm9o 6kPDYI9gG5fI6dO9VLMhUpSHUWYn7jh60qq48bPMhiCWtj4HPQyMBueQlNh7GlWC9oSP uZPdcB9hA7VtEyNvOqPdrLFo6U5yhsuUePrYtebSkItR68jBCtrdiQxy7tFvnAKH60py pM46kH0eTa3/yGKpAGoS5hFJt94SINTcipJ5KapTNATSd8vombQ8zsLlPpYaqemD7o1+ U4XZouZIr/ciEWoJp4wITwM/mRiw4IzmzP0d4oUGDwqP5Q2jdMzK5rkis6dNCGWj9WQc EgEQ== X-Gm-Message-State: AOUpUlGuBmo2A6uZZY7/pWA+cxHV5pmmZ8K9WLUZwKVunDuV9bd25cB7 aAcu+EFM/y4rz1EX6OmTZhzlkBfE X-Google-Smtp-Source: AA+uWPw61zxKUpTBbzqic4CPREROAkDuEFForuvyrhAS6GImTjLbbxgdC/G4dIwmTG0Bk2XykXs7Mg== X-Received: by 2002:a5d:6103:: with SMTP id v3-v6mr33376736wrt.265.1534871009857; Tue, 21 Aug 2018 10:03:29 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 21 Aug 2018 19:01:57 +0200 Message-Id: <1534870966-9287-26-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1534870966-9287-1-git-send-email-pbonzini@redhat.com> References: <1534870966-9287-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42e Subject: [Qemu-devel] [PULL 25/74] 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: "Emilio G. Cota" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Emilio G. Cota" 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 Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Emilio G. Cota Signed-off-by: Paolo Bonzini --- hmp-commands.hx | 15 +++++++++++++++ hmp.c | 24 ++++++++++++++++++++++++ hmp.h | 1 + 3 files changed, 40 insertions(+) diff --git a/hmp-commands.hx b/hmp-commands.hx index c1fc747..db0c681 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -644,6 +644,21 @@ sendkey ctrl-alt-f1 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 { .name =3D "system_reset", diff --git a/hmp.c b/hmp.c index 2aafb50..d94a47f 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.h b/hmp.h index 33354f1..5f1addc 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); --=20 1.8.3.1