From: Markus Armbruster <armbru@redhat.com>
To: Dongli Zhang <dongli.zhang@oracle.com>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org,
dgilbert@redhat.com, armbru@redhat.com, joe.jin@oracle.com
Subject: Re: [PATCH v3 1/1] monitor/hmp: print trace as option in help for log command
Date: Fri, 02 Sep 2022 14:24:30 +0200 [thread overview]
Message-ID: <87h71qrmkh.fsf@pond.sub.org> (raw)
In-Reply-To: <20220831213943.8155-1-dongli.zhang@oracle.com> (Dongli Zhang's message of "Wed, 31 Aug 2022 14:39:43 -0700")
Dongli Zhang <dongli.zhang@oracle.com> writes:
> The below is printed when printing help information in qemu-system-x86_64
> command line, and when CONFIG_TRACE_LOG is enabled:
>
> ----------------------------
> $ qemu-system-x86_64 -d help
> ... ...
> trace:PATTERN enable trace events
>
> Use "-d trace:help" to get a list of trace events.
> ----------------------------
>
> However, the options of "trace:PATTERN" are only printed by
> "qemu-system-x86_64 -d help", but missing in hmp "help log" command.
>
> Fixes: c84ea00dc2 ("log: add "-d trace:PATTERN"")
> Cc: Joe Jin <joe.jin@oracle.com>
> Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
> ---
> Changed since v1:
> - change format for "none" as well.
> Changed since v2:
> - use "log trace:help" in help message.
> - add more clarification in commit message.
> - add 'Fixes' tag.
> ---
> monitor/hmp.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/monitor/hmp.c b/monitor/hmp.c
> index 15ca04735c..a3375d0341 100644
> --- a/monitor/hmp.c
> +++ b/monitor/hmp.c
> @@ -285,10 +285,15 @@ void help_cmd(Monitor *mon, const char *name)
> if (!strcmp(name, "log")) {
> const QEMULogItem *item;
> monitor_printf(mon, "Log items (comma separated):\n");
> - monitor_printf(mon, "%-10s %s\n", "none", "remove all logs");
> + monitor_printf(mon, "%-15s %s\n", "none", "remove all logs");
> for (item = qemu_log_items; item->mask != 0; item++) {
> - monitor_printf(mon, "%-10s %s\n", item->name, item->help);
> + monitor_printf(mon, "%-15s %s\n", item->name, item->help);
> }
> +#ifdef CONFIG_TRACE_LOG
> + monitor_printf(mon, "trace:PATTERN enable trace events\n");
> + monitor_printf(mon, "\nUse \"log trace:help\" to get a list of "
> + "trace events.\n\n");
> +#endif
> return;
> }
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Not this patch's fault:
1. "-d help" terminates with exit status 1, "-d trace:help" with 0. The
former is wrong.
2. HMP "log trace:help" prints to stdout instead of the current monitor.
3. Output of HMP "log trace:help" sometimes is truncated for me.
4. Output of "log trace:help" and "info trace-events" is unwieldy.
Sorted output could be a bit less unwieldy.
5. Could "log trace:help" and "info trace-events" share code?
next prev parent reply other threads:[~2022-09-02 12:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-31 21:39 [PATCH v3 1/1] monitor/hmp: print trace as option in help for log command Dongli Zhang
2022-09-02 12:24 ` Markus Armbruster [this message]
2022-09-17 21:44 ` Philippe Mathieu-Daudé
2022-09-17 21:44 ` Philippe Mathieu-Daudé via
2022-09-19 6:49 ` Dongli Zhang
2022-09-21 15:11 ` Markus Armbruster
2022-09-15 11:20 ` Dr. David Alan Gilbert
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=87h71qrmkh.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=dgilbert@redhat.com \
--cc=dongli.zhang@oracle.com \
--cc=joe.jin@oracle.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.