From nobody Sun Feb 8 19:52:03 2026 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.zoho.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; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1496623699207992.7845983798653; Sun, 4 Jun 2017 17:48:19 -0700 (PDT) Received: from localhost ([::1]:59129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHgBt-0002Wu-Pl for importer@patchew.org; Sun, 04 Jun 2017 20:48:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHgAu-0002Dt-S7 for qemu-devel@nongnu.org; Sun, 04 Jun 2017 20:47:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHgAp-0005o8-VY for qemu-devel@nongnu.org; Sun, 04 Jun 2017 20:47:16 -0400 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:33312) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dHgAp-0005l2-Ns for qemu-devel@nongnu.org; Sun, 04 Jun 2017 20:47:11 -0400 Received: by mail-pg0-x242.google.com with SMTP id s62so7877894pgc.0 for ; Sun, 04 Jun 2017 17:47:10 -0700 (PDT) Received: from surajjs1.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id f1sm45199177pgc.8.2017.06.04.17.47.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Jun 2017 17:47:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=BZWOtiQbhoDOOMLSYW29M4/upqF4KcS/d9wXupK+8cc=; b=hHR0miFpFH0ucdAXRQTYQomuusNvXk5OpPEOsVdzpYi8UmlmGgMPnegb0bHJ7iJ6WI LiOqBfHj5J3z6hwSfCDtc+t9FSsa26IYw/BoY9Pb6GSD3Pf3c7Nx7DsrphmRGvwb5Pqy MQ9YUg7B3qUJ63HUHMKLIKCzy6lfQ/c5razbWGnMv4khsHbAi/kxim0p1wvXaYJakBE8 mzuVubjeYwhTGsybhMss1mrvwCWhJsLOnXh2s9AadKI/m0qbVjhLg4nQDuAhte4XmnWH R9Uplh68ntyLQDDFWwIYLPM/fGCEim6WkReGqUNJyJd/JanZTWvctbDK0EOVHHPyz7mP eLiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=BZWOtiQbhoDOOMLSYW29M4/upqF4KcS/d9wXupK+8cc=; b=nd0bmWXGg5tpE5YwdzIrmwJyxZ0ggzbAIhKXCuko56IhnpjiwpB2W1/pHhMhnf3zhx ktzkPTn0zPL21KRJIAu7bF5UxYageZt2Hg+h2xs13B53wFAv0RkSB2iHVZLkBnJJDJ1b 0/sLlpTTnhZOUi1X/AFLoH0+8dYuMcinze+F2iLw+wWBKvcsSrZBiiRzwN6IdmoCAv7P n5x+PVWQ0YosgERAlfEUZKSfJOU1WSOTIBp6rxosmq4rx6/DYwrap//xofkgatWfIHy7 /pPqloS8m0Jdi65tZ2XUDm+pKmEKrNYv9HWKdMwszX/ffMoV/UIcvN+ckJ4vqTmwCu7j B/BQ== X-Gm-Message-State: AODbwcBhT1e1ToAbviqSMKvygyksxJAk2GPMX+i05Gf7A5iUGZnRyqSb wMgg23VCDpJwqN7Y X-Received: by 10.98.224.194 with SMTP id d63mr11657241pfm.174.1496623629015; Sun, 04 Jun 2017 17:47:09 -0700 (PDT) From: Suraj Jitindar Singh To: qemu-devel@nongnu.org Date: Mon, 5 Jun 2017 10:47:01 +1000 Message-Id: <20170605004701.31891-1-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.9.4 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::242 Subject: [Qemu-devel] [PATCH] monitor: Add -a (all) option to info registers 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, Suraj Jitindar Singh , armbru@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The info registers command in the qemu monitor is used to dump register values. Currently this command uses the monitor cpu (which can be set by the user) as the cpu for whose registers will be dumped. Sometimes it is useful to see the registers for all cpus and currently this requires setting the monitor cpu and the re-running the command for each cpu in the system. I would be nice if there was an easier way to do this. Add the "-a" option to the info registers command to dump the register values for all cpus. Signed-off-by: Suraj Jitindar Singh --- hmp-commands-info.hx | 6 +++--- monitor.c | 20 +++++++++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index ae16901..ba98e58 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -100,9 +100,9 @@ ETEXI =20 { .name =3D "registers", - .args_type =3D "", - .params =3D "", - .help =3D "show the cpu registers", + .args_type =3D "cpustate_all:-a", + .params =3D "[-a]", + .help =3D "show the cpu registers (-a: all - show register i= nfo for all cpus)", .cmd =3D hmp_info_registers, }, =20 diff --git a/monitor.c b/monitor.c index baa73c9..5875f88 100644 --- a/monitor.c +++ b/monitor.c @@ -1078,13 +1078,23 @@ int monitor_get_cpu_index(void) =20 static void hmp_info_registers(Monitor *mon, const QDict *qdict) { - CPUState *cs =3D mon_get_cpu(); + bool all_cpus =3D qdict_get_try_bool(qdict, "cpustate_all", false); + CPUState *cs; =20 - if (!cs) { - monitor_printf(mon, "No CPU available\n"); - return; + if (all_cpus) { + CPU_FOREACH(cs) { + cpu_dump_state(cs, (FILE *)mon, monitor_fprintf, CPU_DUMP_FPU); + } + } else { + cs =3D mon_get_cpu(); + + if (!cs) { + monitor_printf(mon, "No CPU available\n"); + return; + } + + cpu_dump_state(cs, (FILE *)mon, monitor_fprintf, CPU_DUMP_FPU); } - cpu_dump_state(cs, (FILE *)mon, monitor_fprintf, CPU_DUMP_FPU); } =20 static void hmp_info_jit(Monitor *mon, const QDict *qdict) --=20 2.9.4