[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 04/11] trace: [monitor] Use new event control interf
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH 04/11] trace: [monitor] Use new event control interface |
Date: |
Thu, 28 Mar 2013 14:25:45 +0100 |
From: Lluís Vilanova <address@hidden>
Signed-off-by: Lluís Vilanova <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
monitor.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/monitor.c b/monitor.c
index 5dfae2a..4ec1db9 100644
--- a/monitor.c
+++ b/monitor.c
@@ -761,9 +761,18 @@ static void do_trace_event_set_state(Monitor *mon, const
QDict *qdict)
{
const char *tp_name = qdict_get_str(qdict, "name");
bool new_state = qdict_get_bool(qdict, "option");
- int ret = trace_event_set_state(tp_name, new_state);
- if (!ret) {
+ bool found = false;
+ TraceEvent *ev = NULL;
+ while ((ev = trace_event_pattern(tp_name, ev)) != NULL) {
+ found = true;
+ if (!trace_event_get_state_static(ev)) {
+ monitor_printf(mon, "event \"%s\" is not traceable\n", tp_name);
+ } else {
+ trace_event_set_state_dynamic(ev, new_state);
+ }
+ }
+ if (!trace_event_is_pattern(tp_name) && !found) {
monitor_printf(mon, "unknown event name \"%s\"\n", tp_name);
}
}
--
1.8.1.4
- [Qemu-devel] [PULL 00/11] Tracing patches, Stefan Hajnoczi, 2013/03/28
- [Qemu-devel] [PATCH 03/11] trace: Provide a detailed event control interface, Stefan Hajnoczi, 2013/03/28
- [Qemu-devel] [PATCH 05/11] trace: [default] Port to generic event information and new control interface, Stefan Hajnoczi, 2013/03/28
- [Qemu-devel] [PATCH 06/11] trace: [simple] Port to generic event information and new control interface, Stefan Hajnoczi, 2013/03/28
- [Qemu-devel] [PATCH 07/11] trace: [stderr] Port to generic event information and new control interface, Stefan Hajnoczi, 2013/03/28
- [Qemu-devel] [PATCH 11/11] vl: add runstate_set tracepoint, Stefan Hajnoczi, 2013/03/28
- [Qemu-devel] [PATCH 01/11] trace: [tracetool] Explicitly identify public backends, Stefan Hajnoczi, 2013/03/28
- [Qemu-devel] [PATCH 08/11] trace: rebuild generated-events.o when configuration changes, Stefan Hajnoczi, 2013/03/28
- [Qemu-devel] [PATCH 10/11] .gitignore: rename trace/generated-tracers.dtrace, Stefan Hajnoczi, 2013/03/28
- [Qemu-devel] [PATCH 09/11] .gitignore: add trace/generated-events.[ch], Stefan Hajnoczi, 2013/03/28
- [Qemu-devel] [PATCH 04/11] trace: [monitor] Use new event control interface,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 02/11] trace: Provide a generic tracing event descriptor, Stefan Hajnoczi, 2013/03/28