xref: /openbmc/qemu/accel/tcg/monitor.c (revision 1861993f1fc13e42afed6a618c45a5a95a1457ea)
1 /*
2  * SPDX-License-Identifier: LGPL-2.1-or-later
3  *
4  *  QEMU TCG monitor
5  *
6  *  Copyright (c) 2003-2005 Fabrice Bellard
7  */
8 
9 #include "qemu/osdep.h"
10 #include "qapi/error.h"
11 #include "qapi/type-helpers.h"
12 #include "qapi/qapi-commands-machine.h"
13 #include "monitor/monitor.h"
14 #include "system/tcg.h"
15 #include "internal-common.h"
16 
17 HumanReadableText *qmp_x_query_jit(Error **errp)
18 {
19     g_autoptr(GString) buf = g_string_new("");
20 
21     if (!tcg_enabled()) {
22         error_setg(errp, "JIT information is only available with accel=tcg");
23         return NULL;
24     }
25 
26     tcg_dump_stats(buf);
27 
28     return human_readable_text_from_str(buf);
29 }
30 
31 static void hmp_tcg_register(void)
32 {
33     monitor_register_hmp_info_hrt("jit", qmp_x_query_jit);
34 }
35 
36 type_init(hmp_tcg_register);
37