On 10/28/21 17:54, Daniel P. Berrangé wrote: > 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. > > Signed-off-by: Daniel P. Berrangé <berra...@redhat.com> > --- > accel/tcg/cpu-exec.c | 14 ++++++++++++++ > accel/tcg/hmp.c | 7 +------ > accel/tcg/translate-all.c | 4 ++-- > include/exec/cpu-all.h | 2 +- > include/tcg/tcg.h | 2 +- > qapi/machine.json | 13 +++++++++++++ > tcg/tcg.c | 10 +++++----- > tests/qtest/qmp-cmd-test.c | 1 + > 8 files changed, 38 insertions(+), 15 deletions(-) > > diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c > index 4212645cb6..7a7e813207 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, "JIT information is only available with accel=tcg");
s/JIT/Opcode count/ ? Otherwise, Reviewed-by: Philippe Mathieu-Daudé <phi...@redhat.com> > + return NULL; > + } > + > + dump_opcount_info(buf); > + > + return human_readable_text_from_str(buf); > +}