From nobody Wed Nov 5 16:15:30 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.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 149690054186934.69856813116803; Wed, 7 Jun 2017 22:42:21 -0700 (PDT) Received: from localhost ([::1]:47578 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIqD6-0002Sa-Go for importer@patchew.org; Thu, 08 Jun 2017 01:42:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIqCO-0002AM-R4 for qemu-devel@nongnu.org; Thu, 08 Jun 2017 01:41:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIqCK-0002mm-Sb for qemu-devel@nongnu.org; Thu, 08 Jun 2017 01:41:36 -0400 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:34040) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dIqCK-0002mi-Ma for qemu-devel@nongnu.org; Thu, 08 Jun 2017 01:41:32 -0400 Received: by mail-pg0-x241.google.com with SMTP id v14so3472814pgn.1 for ; Wed, 07 Jun 2017 22:41:32 -0700 (PDT) Received: from surajjs1.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id 189sm9650543pgi.66.2017.06.07.22.41.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jun 2017 22:41:31 -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=dx7PPPzstYy3nRPnYLIP7TgsZzdFx0zdRUH/TV0j/ZI=; b=PlSwoOvMS1CghdwiyPA6wArxatYIbOvenzkN+7P6MolEjCmxgY6q6mkXIgkOnLg+PD 9jJbk0c9DWu2iyUN3VvzTOq3gwQxuFm+UZdBxmMxyEzVOj4VXlJPr6tmChcVEZKvCLS0 7NJUi/IN3pmAae1Kbfn/9T70+mo5WuDxEQsa4NrYCVvZOgq+vMmPeP9TkwZHwfuUT7Lf NkYtREOAi1sQ3rjRz37Q6/DFA998kPRPBFY4aNXRf1T2fOqwfLwKJl8UDBZUmW0s6OSE mLvN/oIJjZQ5H5bA2PRHvn8Yp2JPmrEW6s3g2uUbzmXwND6PZzjDeYSOCbkeH9Wfuwl/ shzQ== 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=dx7PPPzstYy3nRPnYLIP7TgsZzdFx0zdRUH/TV0j/ZI=; b=nf6f4YsuT1p3+TKIuRK25S/hVldUPZ+/KnogqQY7G8pRADlYwgPhesQkTwtsUIlhvs KoXe43szy4GDuVsuqXJGotpJ6qF1yo79vDib7dwUBqWroDNeBdZOXNUXrpqtnLrbIMjT iN7BrejrJKPYRpkvIZMCxyNDpimRD47+JztMkrYwFzxUPjaUhblXgpVgYeiuJUcqssF8 hQUSznSmu0cTiykzH6XeKyG9Rxrtr7M4uRbeZnMtxE7ILmMED28vo+B1sb9wBL7md26r KQGFTHaBPbaW5hrrvEWpfeGbT/5NqSg6sb0RKFRgnWjICCFwl1wPGsbXbgfu9Muiw236 8jJQ== X-Gm-Message-State: AODbwcB9AmAUqN3WkyaATLXFwS5Nb76fd7yHkz6DuZNGJjFJ2MJpo5No vqfv+lA26zu3VSBO X-Received: by 10.84.129.132 with SMTP id b4mr22104284plb.0.1496900491613; Wed, 07 Jun 2017 22:41:31 -0700 (PDT) From: Suraj Jitindar Singh To: qemu-devel@nongnu.org Date: Thu, 8 Jun 2017 15:41:16 +1000 Message-Id: <20170608054116.17203-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::241 Subject: [Qemu-devel] [PATCH V2] 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 Reviewed-by: Dr. David Alan Gilbert --- Change Log: V1 -> V2: - Add CPU number to beginning of register dump --- hmp-commands-info.hx | 6 +++--- monitor.c | 21 ++++++++++++++++----- 2 files changed, 19 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..1629ad1 100644 --- a/monitor.c +++ b/monitor.c @@ -1078,13 +1078,24 @@ 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) { + monitor_printf(mon, "\nCPU#%d\n", cs->cpu_index); + 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