[PATCH v5 23/69] accel/tcg: Remove 'info opcount' and @x-query-opcount

Philippe Mathieu-Daudé posted 69 patches 5 months, 2 weeks ago
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Cameron Esfahani <dirty@apple.com>, Roman Bolshakov <rbolshakov@ddn.com>, Phil Dennis-Jordan <phil@philjordan.eu>, Mads Ynddal <mads@ynddal.dk>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>, Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, Paul Durrant <paul@xen.org>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>, "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, "Dr. David Alan Gilbert" <dave@treblig.org>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>, Reinoud Zandijk <reinoud@netbsd.org>, Sunil Muthuswamy <sunilmut@microsoft.com>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, Michael Roth <michael.roth@amd.com>, Peter Xu <peterx@redhat.com>, David Hildenbrand <david@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Alexander Graf <agraf@csgraf.de>
There is a newer version of this series
[PATCH v5 23/69] accel/tcg: Remove 'info opcount' and @x-query-opcount
Posted by Philippe Mathieu-Daudé 5 months, 2 weeks ago
Since commit 1b65b4f54c7 ("accel/tcg: remove CONFIG_PROFILER",
released with QEMU v8.1.0) we get pointless output:

  (qemu) info opcount
  [TCG profiler not compiled]

Remove that unstable and unuseful command.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 qapi/machine.json          | 18 ------------------
 accel/tcg/monitor.c        | 21 ---------------------
 tests/qtest/qmp-cmd-test.c |  1 -
 hmp-commands-info.hx       | 14 --------------
 4 files changed, 54 deletions(-)

diff --git a/qapi/machine.json b/qapi/machine.json
index d5bbb5e367e..acf6610efa5 100644
--- a/qapi/machine.json
+++ b/qapi/machine.json
@@ -1764,24 +1764,6 @@
   'returns': 'HumanReadableText',
   'features': [ 'unstable' ] }
 
-##
-# @x-query-opcount:
-#
-# Query TCG opcode counters
-#
-# Features:
-#
-# @unstable: This command is meant for debugging.
-#
-# Returns: TCG opcode counters
-#
-# Since: 6.2
-##
-{ 'command': 'x-query-opcount',
-  'returns': 'HumanReadableText',
-  'if': 'CONFIG_TCG',
-  'features': [ 'unstable' ] }
-
 ##
 # @x-query-ramblock:
 #
diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c
index 1c182b6bfb5..7c686226b21 100644
--- a/accel/tcg/monitor.c
+++ b/accel/tcg/monitor.c
@@ -215,30 +215,9 @@ HumanReadableText *qmp_x_query_jit(Error **errp)
     return human_readable_text_from_str(buf);
 }
 
-static void tcg_dump_op_count(GString *buf)
-{
-    g_string_append_printf(buf, "[TCG profiler not compiled]\n");
-}
-
-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;
-    }
-
-    tcg_dump_op_count(buf);
-
-    return human_readable_text_from_str(buf);
-}
-
 static void hmp_tcg_register(void)
 {
     monitor_register_hmp_info_hrt("jit", qmp_x_query_jit);
-    monitor_register_hmp_info_hrt("opcount", qmp_x_query_opcount);
 }
 
 type_init(hmp_tcg_register);
diff --git a/tests/qtest/qmp-cmd-test.c b/tests/qtest/qmp-cmd-test.c
index 040d042810b..cf718761861 100644
--- a/tests/qtest/qmp-cmd-test.c
+++ b/tests/qtest/qmp-cmd-test.c
@@ -51,7 +51,6 @@ static int query_error_class(const char *cmd)
         { "x-query-usb", ERROR_CLASS_GENERIC_ERROR },
         /* Only valid with accel=tcg */
         { "x-query-jit", ERROR_CLASS_GENERIC_ERROR },
-        { "x-query-opcount", ERROR_CLASS_GENERIC_ERROR },
         { "xen-event-list", ERROR_CLASS_GENERIC_ERROR },
         { NULL, -1 }
     };
diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
index 639a450ee51..d7979222752 100644
--- a/hmp-commands-info.hx
+++ b/hmp-commands-info.hx
@@ -256,20 +256,6 @@ SRST
     Show dynamic compiler info.
 ERST
 
-#if defined(CONFIG_TCG)
-    {
-        .name       = "opcount",
-        .args_type  = "",
-        .params     = "",
-        .help       = "show dynamic compiler opcode counters",
-    },
-#endif
-
-SRST
-  ``info opcount``
-    Show dynamic compiler opcode counters
-ERST
-
     {
         .name       = "sync-profile",
         .args_type  = "mean:-m,no_coalesce:-n,max:i?",
-- 
2.49.0


Re: [PATCH v5 23/69] accel/tcg: Remove 'info opcount' and @x-query-opcount
Posted by Richard Henderson 5 months, 2 weeks ago
On 7/3/25 04:54, Philippe Mathieu-Daudé wrote:
> Since commit 1b65b4f54c7 ("accel/tcg: remove CONFIG_PROFILER",
> released with QEMU v8.1.0) we get pointless output:
> 
>    (qemu) info opcount
>    [TCG profiler not compiled]
> 
> Remove that unstable and unuseful command.
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   qapi/machine.json          | 18 ------------------
>   accel/tcg/monitor.c        | 21 ---------------------
>   tests/qtest/qmp-cmd-test.c |  1 -
>   hmp-commands-info.hx       | 14 --------------
>   4 files changed, 54 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~

Re: [PATCH v5 23/69] accel/tcg: Remove 'info opcount' and @x-query-opcount
Posted by Dr. David Alan Gilbert 5 months, 2 weeks ago
* Philippe Mathieu-Daudé (philmd@linaro.org) wrote:
> Since commit 1b65b4f54c7 ("accel/tcg: remove CONFIG_PROFILER",
> released with QEMU v8.1.0) we get pointless output:
> 
>   (qemu) info opcount
>   [TCG profiler not compiled]
> 
> Remove that unstable and unuseful command.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

For HMP
Acked-by: Dr. David Alan Gilbert <dave@treblig.org>

> ---
>  qapi/machine.json          | 18 ------------------
>  accel/tcg/monitor.c        | 21 ---------------------
>  tests/qtest/qmp-cmd-test.c |  1 -
>  hmp-commands-info.hx       | 14 --------------
>  4 files changed, 54 deletions(-)
> 
> diff --git a/qapi/machine.json b/qapi/machine.json
> index d5bbb5e367e..acf6610efa5 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -1764,24 +1764,6 @@
>    'returns': 'HumanReadableText',
>    'features': [ 'unstable' ] }
>  
> -##
> -# @x-query-opcount:
> -#
> -# Query TCG opcode counters
> -#
> -# Features:
> -#
> -# @unstable: This command is meant for debugging.
> -#
> -# Returns: TCG opcode counters
> -#
> -# Since: 6.2
> -##
> -{ 'command': 'x-query-opcount',
> -  'returns': 'HumanReadableText',
> -  'if': 'CONFIG_TCG',
> -  'features': [ 'unstable' ] }
> -
>  ##
>  # @x-query-ramblock:
>  #
> diff --git a/accel/tcg/monitor.c b/accel/tcg/monitor.c
> index 1c182b6bfb5..7c686226b21 100644
> --- a/accel/tcg/monitor.c
> +++ b/accel/tcg/monitor.c
> @@ -215,30 +215,9 @@ HumanReadableText *qmp_x_query_jit(Error **errp)
>      return human_readable_text_from_str(buf);
>  }
>  
> -static void tcg_dump_op_count(GString *buf)
> -{
> -    g_string_append_printf(buf, "[TCG profiler not compiled]\n");
> -}
> -
> -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;
> -    }
> -
> -    tcg_dump_op_count(buf);
> -
> -    return human_readable_text_from_str(buf);
> -}
> -
>  static void hmp_tcg_register(void)
>  {
>      monitor_register_hmp_info_hrt("jit", qmp_x_query_jit);
> -    monitor_register_hmp_info_hrt("opcount", qmp_x_query_opcount);
>  }
>  
>  type_init(hmp_tcg_register);
> diff --git a/tests/qtest/qmp-cmd-test.c b/tests/qtest/qmp-cmd-test.c
> index 040d042810b..cf718761861 100644
> --- a/tests/qtest/qmp-cmd-test.c
> +++ b/tests/qtest/qmp-cmd-test.c
> @@ -51,7 +51,6 @@ static int query_error_class(const char *cmd)
>          { "x-query-usb", ERROR_CLASS_GENERIC_ERROR },
>          /* Only valid with accel=tcg */
>          { "x-query-jit", ERROR_CLASS_GENERIC_ERROR },
> -        { "x-query-opcount", ERROR_CLASS_GENERIC_ERROR },
>          { "xen-event-list", ERROR_CLASS_GENERIC_ERROR },
>          { NULL, -1 }
>      };
> diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
> index 639a450ee51..d7979222752 100644
> --- a/hmp-commands-info.hx
> +++ b/hmp-commands-info.hx
> @@ -256,20 +256,6 @@ SRST
>      Show dynamic compiler info.
>  ERST
>  
> -#if defined(CONFIG_TCG)
> -    {
> -        .name       = "opcount",
> -        .args_type  = "",
> -        .params     = "",
> -        .help       = "show dynamic compiler opcode counters",
> -    },
> -#endif
> -
> -SRST
> -  ``info opcount``
> -    Show dynamic compiler opcode counters
> -ERST
> -
>      {
>          .name       = "sync-profile",
>          .args_type  = "mean:-m,no_coalesce:-n,max:i?",
> -- 
> 2.49.0
> 
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/