Skip to content

Commit

Permalink
accel/tcg: Report one-insn-per-tb in 'info jit', not 'info status'
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20230417164041.684562-8-peter.maydell@linaro.org
  • Loading branch information
pm215 committed May 2, 2023
1 parent be69037 commit 3d0370b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
14 changes: 14 additions & 0 deletions accel/tcg/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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("");
Expand All @@ -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);

Expand Down
5 changes: 2 additions & 3 deletions softmmu/runstate-hmp-cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 3d0370b

Please sign in to comment.