summaryrefslogtreecommitdiff
path: root/trace/control.c
diff options
context:
space:
mode:
Diffstat (limited to 'trace/control.c')
-rw-r--r--trace/control.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/trace/control.c b/trace/control.c
index ccddda537f..d099f735d5 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -20,6 +20,7 @@
#include "qemu/log.h"
#endif
#include "qemu/error-report.h"
+#include "monitor/monitor.h"
int trace_events_enabled_count;
bool trace_events_dstate[TRACE_EVENT_COUNT];
@@ -132,7 +133,9 @@ void trace_enable_events(const char *line_buf)
{
if (is_help_option(line_buf)) {
trace_list_events();
- exit(0);
+ if (cur_mon == NULL) {
+ exit(0);
+ }
} else {
do_trace_enable_events(line_buf);
}