qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/3] monitor: show sync profiling info with 'inf


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 2/3] monitor: show sync profiling info with 'info sync'
Date: Tue, 14 Aug 2018 18:03:32 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

"Emilio G. Cota" <address@hidden> writes:

> Signed-off-by: Emilio G. Cota <address@hidden>
> ---
>  monitor.c            |  7 +++++++
>  hmp-commands-info.hx | 16 ++++++++++++++++
>  2 files changed, 23 insertions(+)
>
> diff --git a/monitor.c b/monitor.c
> index 77861e96af..66d8d85b97 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -1454,6 +1454,13 @@ static void hmp_info_opcount(Monitor *mon, const QDict 
> *qdict)
>  }
>  #endif
>  
> +static void hmp_info_sync(Monitor *mon, const QDict *qdict)
> +{
> +    int64_t max = qdict_get_try_int(qdict, "max", 10);
> +
> +    qsp_report((FILE *)mon, monitor_fprintf, max);
> +}
> +
>  static void hmp_info_history(Monitor *mon, const QDict *qdict)
>  {
>      int i;
> diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
> index 70639f656a..56a3249bad 100644
> --- a/hmp-commands-info.hx
> +++ b/hmp-commands-info.hx
> @@ -297,6 +297,22 @@ STEXI
>  @item info opcount
>  @findex info opcount
>  Show dynamic compiler opcode counters
> +ETEXI
> +
> +    {
> +        .name       = "sync",

I think "info sync-profile" would be clearer.

> +        .args_type  = "max:i?",
> +        .params     = "[max]",
> +        .help       = "show sync profiling info for "
> +                   "up to max entries (default: 10). "
> +                   "Entries are sorted by wait time.",
> +        .cmd        = hmp_info_sync,
> +    },
> +
> +STEXI
> address@hidden info sync
> address@hidden sync
> +Show sync profiling info.
>  ETEXI
>  
>      {

Please explain briefly why you think this command is not going to be
useful in QMP.  Recommend to do that right in your commit message.  For
instance, you could argue that the information provided is useful only
to developers, and developers are just fine with getting it from HMP
"info sync".

However, if we expect developers to further process the data, providing
it as JSON (via QMP) makes sense, because is saves them the trouble of
parsing your (undocumented) HMP output format.

If we decide we want to provide the functionality in QMP, I can help you
with the necessary code changes.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]