From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: "Emilio G. Cota" <cota@braap.org>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
Peter Crosthwaite <crosthwaite.peter@gmail.com>,
Richard Henderson <rth@twiddle.net>, Stefan Weil <sw@weilnetz.de>,
Markus Armbruster <armbru@redhat.com>,
Peter Xu <peterx@redhat.com>, Fam Zheng <famz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 8/9] hmp-commands: add sync-profile
Date: Fri, 17 Aug 2018 11:48:34 +0100 [thread overview]
Message-ID: <20180817104833.GC2459@work-vm> (raw)
In-Reply-To: <20180817051853.23792-9-cota@braap.org>
* Emilio G. Cota (cota@braap.org) wrote:
> The command introduced here is just for developers. This means that:
>
> - the interface implemented here could change in the future
> - the command is only meant to be used from HMP, not from QMP
>
> Signed-off-by: Emilio G. Cota <cota@braap.org>
> ---
> hmp.h | 1 +
> hmp.c | 24 ++++++++++++++++++++++++
> hmp-commands.hx | 15 +++++++++++++++
> 3 files changed, 40 insertions(+)
>
> diff --git a/hmp.h b/hmp.h
> index 33354f1bdd..5f1addcca2 100644
> --- a/hmp.h
> +++ b/hmp.h
> @@ -42,6 +42,7 @@ void hmp_info_tpm(Monitor *mon, const QDict *qdict);
> void hmp_info_iothreads(Monitor *mon, const QDict *qdict);
> void hmp_quit(Monitor *mon, const QDict *qdict);
> void hmp_stop(Monitor *mon, const QDict *qdict);
> +void hmp_sync_profile(Monitor *mon, const QDict *qdict);
> void hmp_system_reset(Monitor *mon, const QDict *qdict);
> void hmp_system_powerdown(Monitor *mon, const QDict *qdict);
> void hmp_exit_preconfig(Monitor *mon, const QDict *qdict);
> diff --git a/hmp.c b/hmp.c
> index 2aafb50e8e..d94a47f7c7 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -1062,6 +1062,30 @@ void hmp_stop(Monitor *mon, const QDict *qdict)
> qmp_stop(NULL);
> }
>
> +void hmp_sync_profile(Monitor *mon, const QDict *qdict)
> +{
> + const char *op = qdict_get_try_str(qdict, "op");
> +
> + if (op == NULL) {
> + bool on = qsp_is_enabled();
> +
> + monitor_printf(mon, "sync-profile is %s\n", on ? "on" : "off");
> + return;
> + }
> + if (!strcmp(op, "on")) {
> + qsp_enable();
> + } else if (!strcmp(op, "off")) {
> + qsp_disable();
> + } else if (!strcmp(op, "reset")) {
> + qsp_reset();
> + } else {
> + Error *err = NULL;
> +
> + error_setg(&err, QERR_INVALID_PARAMETER, op);
> + hmp_handle_error(mon, &err);
> + }
> +}
> +
> void hmp_system_reset(Monitor *mon, const QDict *qdict)
> {
> qmp_system_reset(NULL);
> diff --git a/hmp-commands.hx b/hmp-commands.hx
> index c1fc747403..db0c681f74 100644
> --- a/hmp-commands.hx
> +++ b/hmp-commands.hx
> @@ -643,6 +643,21 @@ sendkey ctrl-alt-f1
>
> This command is useful to send keys that your graphical user interface
> intercepts at low level, such as @code{ctrl-alt-f1} in X Window.
> +ETEXI
> + {
> + .name = "sync-profile",
> + .args_type = "op:s?",
> + .params = "[on|off|reset]",
> + .help = "enable, disable or reset synchronization profiling. "
> + "With no arguments, prints whether profiling is on or off.",
> + .cmd = hmp_sync_profile,
> + },
That's OK; it'a little odd way to do it (I'd have expected a couple of
booleans instead of the string); but it's OK, so
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> +STEXI
> +@item sync-profile [on|off|reset]
> +@findex sync-profile
> +Enable, disable or reset synchronization profiling. With no arguments, prints
> +whether profiling is on or off.
> ETEXI
>
> {
> --
> 2.17.1
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
next prev parent reply other threads:[~2018-08-17 10:48 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-17 5:18 [Qemu-devel] [PATCH v2 0/9] synchronization profiler Emilio G. Cota
2018-08-17 5:18 ` [Qemu-devel] [PATCH 1/9] qsp: QEMU's Synchronization Profiler Emilio G. Cota
2018-08-21 14:06 ` Paolo Bonzini
2018-08-17 5:18 ` [Qemu-devel] [PATCH 2/9] qsp: add sort_by option to qsp_report Emilio G. Cota
2018-08-17 5:18 ` [Qemu-devel] [PATCH 3/9] qsp: add qsp_reset Emilio G. Cota
2018-08-17 5:18 ` [Qemu-devel] [PATCH 4/9] qsp: support call site coalescing Emilio G. Cota
2018-08-17 5:18 ` [Qemu-devel] [PATCH 5/9] qsp: track BQL callers explicitly Emilio G. Cota
2018-08-17 5:18 ` [Qemu-devel] [PATCH 6/9] tests/atomic_add-bench: add -p to enable sync profiler Emilio G. Cota
2018-08-17 5:18 ` [Qemu-devel] [PATCH 7/9] vl: add -enable-sync-profile Emilio G. Cota
2018-08-17 5:18 ` [Qemu-devel] [PATCH 8/9] hmp-commands: add sync-profile Emilio G. Cota
2018-08-17 10:48 ` Dr. David Alan Gilbert [this message]
2018-08-17 5:18 ` [Qemu-devel] [PATCH 9/9] hmp-commands-info: " Emilio G. Cota
2018-08-17 10:52 ` Dr. David Alan Gilbert
2018-08-17 16:05 ` Emilio G. Cota
2018-08-17 10:38 ` [Qemu-devel] [PATCH v2 0/9] synchronization profiler Paolo Bonzini
2018-08-18 6:14 ` Emilio G. Cota
2018-08-18 2:03 ` no-reply
2018-08-18 2:12 ` no-reply
[not found] ` <153455848651.26347.421862919623233041@502c9da6d61e>
2018-08-18 6:45 ` Fam Zheng
2018-08-18 17:43 ` Emilio G. Cota
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180817104833.GC2459@work-vm \
--to=dgilbert@redhat.com \
--cc=armbru@redhat.com \
--cc=cota@braap.org \
--cc=crosthwaite.peter@gmail.com \
--cc=famz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=sw@weilnetz.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).