diff options
author | Daniel P. Berrangé <berrange@redhat.com> | 2021-09-08 10:35:43 +0100 |
---|---|---|
committer | Daniel P. Berrangé <berrange@redhat.com> | 2021-11-02 15:57:20 +0000 |
commit | b6a7f3e0d28248861cf46f59521129b179e8748d (patch) | |
tree | aefe07c3e0be5d697fd4c754d0cd85d2699472c8 /accel/tcg | |
parent | 3a841ab53f165910224dc4bebabf1a8f1d04200c (diff) | |
download | qemu-b6a7f3e0d28248861cf46f59521129b179e8748d.zip qemu-b6a7f3e0d28248861cf46f59521129b179e8748d.tar.gz qemu-b6a7f3e0d28248861cf46f59521129b179e8748d.tar.bz2 |
qapi: introduce x-query-opcount QMP command
This is a counterpart to the HMP "info opcount" command. It is being
added with an "x-" prefix because this QMP command is intended as an
ad hoc debugging tool and will thus not be modelled in QAPI as fully
structured data, nor will it have long term guaranteed stability.
The existing HMP command is rewritten to call the QMP command.
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'accel/tcg')
-rw-r--r-- | accel/tcg/cpu-exec.c | 14 | ||||
-rw-r--r-- | accel/tcg/hmp.c | 7 | ||||
-rw-r--r-- | accel/tcg/translate-all.c | 4 |
3 files changed, 17 insertions, 8 deletions
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 4212645..c0620b4 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -1066,4 +1066,18 @@ HumanReadableText *qmp_x_query_jit(Error **errp) return human_readable_text_from_str(buf); } +HumanReadableText *qmp_x_query_opcount(Error **errp) +{ + g_autoptr(GString) buf = g_string_new(""); + + if (!tcg_enabled()) { + error_setg(errp, "Opcode count information is only available with accel=tcg"); + return NULL; + } + + dump_opcount_info(buf); + + return human_readable_text_from_str(buf); +} + #endif /* !CONFIG_USER_ONLY */ diff --git a/accel/tcg/hmp.c b/accel/tcg/hmp.c index 01c767a..d2ea352 100644 --- a/accel/tcg/hmp.c +++ b/accel/tcg/hmp.c @@ -6,15 +6,10 @@ #include "monitor/monitor.h" #include "sysemu/tcg.h" -static void hmp_info_opcount(Monitor *mon, const QDict *qdict) -{ - dump_opcount_info(); -} - static void hmp_tcg_register(void) { monitor_register_hmp_info_hrt("jit", qmp_x_query_jit); - monitor_register_hmp("opcount", true, hmp_info_opcount); + monitor_register_hmp_info_hrt("opcount", qmp_x_query_opcount); } type_init(hmp_tcg_register); diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 8f17a91..bd0bb81 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -2118,9 +2118,9 @@ void dump_exec_info(GString *buf) tcg_dump_info(buf); } -void dump_opcount_info(void) +void dump_opcount_info(GString *buf) { - tcg_dump_op_count(); + tcg_dump_op_count(buf); } #else /* CONFIG_USER_ONLY */ |