| 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 "monitor/hmp.h" |
| 15 | #include "system/tcg.h" |
| 16 | #include "tcg/tcg.h" |
| 17 | #include "internal-common.h" |
| 18 | |
| 19 | HumanReadableText *qmp_x_query_jit(Error **errp) |
| 20 | { |
| 21 | g_autoptr(GString) buf = g_string_new(""); |
| 22 | |
| 23 | if (!tcg_enabled()) { |
| 24 | error_setg(errp, "JIT information is only available with accel=tcg"); |
| 25 | return NULL; |
| 26 | } |
| 27 | |
| 28 | tcg_dump_stats(buf); |
| 29 | |
| 30 | return human_readable_text_from_str(buf); |
| 31 | } |
| 32 | |
| 33 | #ifdef CONFIG_HMP |
| 34 | static void hmp_tcg_register(void) |
| 35 | { |
| 36 | monitor_register_hmp_info_hrt("jit", qmp_x_query_jit); |
| 37 | } |
| 38 | |
| 39 | type_init(hmp_tcg_register); |
| 40 | #endif |