[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v10 4/7] trace: [monitor] Use new event control inte
From: |
Lluís Vilanova |
Subject: |
[Qemu-devel] [PATCH v10 4/7] trace: [monitor] Use new event control interface |
Date: |
Fri, 25 Jan 2013 17:34:08 +0100 |
User-agent: |
StGit/0.16 |
Signed-off-by: Lluís Vilanova <address@hidden>
---
monitor.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/monitor.c b/monitor.c
index 9cf419b..dda7cf2 100644
--- a/monitor.c
+++ b/monitor.c
@@ -735,9 +735,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);
}
}
- [Qemu-devel] [PATCH v10 0/7] trace: Generic event state description, Lluís Vilanova, 2013/01/25
- [Qemu-devel] [PATCH v10 2/7] trace: Provide a generic tracing event descriptor, Lluís Vilanova, 2013/01/25
- [Qemu-devel] [PATCH v10 1/7] trace: [tracetool] Explicitly identify public backends, Lluís Vilanova, 2013/01/25
- [Qemu-devel] [PATCH v10 3/7] trace: Provide a detailed event control interface, Lluís Vilanova, 2013/01/25
- [Qemu-devel] [PATCH v10 4/7] trace: [monitor] Use new event control interface,
Lluís Vilanova <=
- [Qemu-devel] [PATCH v10 7/7] trace: [stderr] Port to generic event information and new control interface, Lluís Vilanova, 2013/01/25
- [Qemu-devel] [PATCH v10 6/7] trace: [simple] Port to generic event information and new control interface, Lluís Vilanova, 2013/01/25
- [Qemu-devel] [PATCH v10 5/7] trace: [default] Port to generic event information and new control interface, Lluís Vilanova, 2013/01/25