diff mbox series

[v3,07/10] accel/tcg: Report one-insn-per-tb in 'info jit', not 'info status'

Message ID 20230417164041.684562-8-peter.maydell@linaro.org
State New
Headers show
Series Deprecate/rename singlestep command line option, monitor interfaces | expand

Commit Message

Peter Maydell April 17, 2023, 4:40 p.m. UTC
Currently we report whether the TCG accelerator is in
'one-insn-per-tb' mode in the 'info status' output.  This is a pretty
minor piece of TCG specific information, and we want to deprecate the
'singlestep' field of the associated QMP command.  Move the
'one-insn-per-tb' reporting to 'info jit'.

We don't need a deprecate-and-drop period for this because the
HMP interface has no stability guarantees.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
The new 'accelerator settings' subsection of the output
currently only has one item, but it would be a place to put
other stuff, eg if we wanted to mention whether split-wx is
enabled.
---
 accel/tcg/monitor.c         | 14 ++++++++++++++
 softmmu/runstate-hmp-cmds.c |  5 ++---
 2 files changed, 16 insertions(+), 3 deletions(-)

Comments

Philippe Mathieu-Daudé April 20, 2023, 9:02 a.m. UTC | #1
On 17/4/23 18:40, Peter Maydell wrote:
> Currently we report whether the TCG accelerator is in
> 'one-insn-per-tb' mode in the 'info status' output.  This is a pretty
> minor piece of TCG specific information, and we want to deprecate the
> 'singlestep' field of the associated QMP command.  Move the
> 'one-insn-per-tb' reporting to 'info jit'.
> 
> We don't need a deprecate-and-drop period for this because the
> HMP interface has no stability guarantees.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> The new 'accelerator settings' subsection of the output
> currently only has one item, but it would be a place to put
> other stuff, eg if we wanted to mention whether split-wx is
> enabled.

Ideally we should have a AccelClass::qmp_query_info() handler
optionally implemented by accelerators, and a single HMP 'info accel'
which convert the QMP handler result to human text.

This is a start :)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

> ---
>   accel/tcg/monitor.c         | 14 ++++++++++++++
>   softmmu/runstate-hmp-cmds.c |  5 ++---
>   2 files changed, 16 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c
index 1450e160e95..92fce580f11 100644
--- a/accel/tcg/monitor.c
+++ b/accel/tcg/monitor.c
@@ -7,6 +7,7 @@ 
  */
 
 #include "qemu/osdep.h"
+#include "qemu/accel.h"
 #include "qapi/error.h"
 #include "qapi/type-helpers.h"
 #include "qapi/qapi-commands-machine.h"
@@ -36,6 +37,18 @@  static void dump_drift_info(GString *buf)
     }
 }
 
+static void dump_accel_info(GString *buf)
+{
+    AccelState *accel = current_accel();
+    bool one_insn_per_tb = object_property_get_bool(OBJECT(accel),
+                                                    "one-insn-per-tb",
+                                                    &error_fatal);
+
+    g_string_append_printf(buf, "Accelerator settings:\n");
+    g_string_append_printf(buf, "one-insn-per-tb: %s\n\n",
+                           one_insn_per_tb ? "on" : "off");
+}
+
 HumanReadableText *qmp_x_query_jit(Error **errp)
 {
     g_autoptr(GString) buf = g_string_new("");
@@ -45,6 +58,7 @@  HumanReadableText *qmp_x_query_jit(Error **errp)
         return NULL;
     }
 
+    dump_accel_info(buf);
     dump_exec_info(buf);
     dump_drift_info(buf);
 
diff --git a/softmmu/runstate-hmp-cmds.c b/softmmu/runstate-hmp-cmds.c
index 127521a483a..a477838dc5a 100644
--- a/softmmu/runstate-hmp-cmds.c
+++ b/softmmu/runstate-hmp-cmds.c
@@ -28,9 +28,8 @@  void hmp_info_status(Monitor *mon, const QDict *qdict)
 
     info = qmp_query_status(NULL);
 
-    monitor_printf(mon, "VM status: %s%s",
-                   info->running ? "running" : "paused",
-                   info->singlestep ? " (single step mode)" : "");
+    monitor_printf(mon, "VM status: %s",
+                   info->running ? "running" : "paused");
 
     if (!info->running && info->status != RUN_STATE_PAUSED) {
         monitor_printf(mon, " (%s)", RunState_str(info->status));