trace: print a warning if user tries to enable an unknown trace event
There was no warning if a bad trace event name was given to
'trace-event' command, thus the user could think that the command
was successful even if this was not the case.
Print a warning if the user tries to enable a trace event which is not
known.
Acked-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
diff --git a/monitor.c b/monitor.c
index fbb678d..260cc02 100644
--- a/monitor.c
+++ b/monitor.c
@@ -549,7 +549,11 @@
{
const char *tp_name = qdict_get_str(qdict, "name");
bool new_state = qdict_get_bool(qdict, "option");
- st_change_trace_event_state(tp_name, new_state);
+ int ret = st_change_trace_event_state(tp_name, new_state);
+
+ if (!ret) {
+ monitor_printf(mon, "unknown event name \"%s\"\n", tp_name);
+ }
}
static void do_trace_file(Monitor *mon, const QDict *qdict)