61 lines
2.2 KiB
Diff
61 lines
2.2 KiB
Diff
|
|
From 0807b94d2cb88f1253d90f649604f0110b33f9b4 Mon Sep 17 00:00:00 2001
|
||
|
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||
|
|
Date: Tue, 3 Sep 2024 02:12:05 +0000
|
||
|
|
Subject: [PATCH] monitor/hmp: print trace as option in help for log command
|
||
|
|
mainline inclusion commit 3183bb3f441ba5b9da570f7f5f9abdc3313ba311 category:
|
||
|
|
bugfix
|
||
|
|
|
||
|
|
---------------------------------------------------------------
|
||
|
|
|
||
|
|
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>
|
||
|
|
Message-Id: <20220831213943.8155-1-dongli.zhang@oracle.com>
|
||
|
|
Reviewed-by: Markus Armbruster <armbru@redhat.com>
|
||
|
|
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
|
||
|
|
|
||
|
|
Signed-off-by: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||
|
|
---
|
||
|
|
monitor/hmp.c | 9 +++++++--
|
||
|
|
1 file changed, 7 insertions(+), 2 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/monitor/hmp.c b/monitor/hmp.c
|
||
|
|
index b20737e63c..9cbbe52812 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;
|
||
|
|
}
|
||
|
|
|
||
|
|
--
|
||
|
|
2.41.0.windows.1
|
||
|
|
|