[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 3/6] trace: [monitor] Use new event control inter
From: |
Lluís Vilanova |
Subject: |
[Qemu-devel] [PATCH v2 3/6] trace: [monitor] Use new event control interface |
Date: |
Mon, 06 Feb 2012 14:57:58 +0100 |
User-agent: |
StGit/0.15 |
Signed-off-by: Lluís Vilanova <address@hidden>
---
monitor.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/monitor.c b/monitor.c
index 5e099bd..010f659 100644
--- a/monitor.c
+++ b/monitor.c
@@ -617,10 +617,19 @@ 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) {
- monitor_printf(mon, "unknown event name \"%s\"\n", tp_name);
+ if (trace_event_is_pattern(tp_name)) {
+ TraceEvent *ev = NULL;
+ while ((ev = trace_event_pattern(tp_name, ev)) != NULL) {
+ trace_event_set_state_dynamic(ev, new_state);
+ }
+ } else {
+ TraceEvent *ev = trace_event_name(tp_name);
+ if (ev == NULL) {
+ monitor_printf(mon, "unknown event name \"%s\"\n", tp_name);
+ } else {
+ trace_event_set_state_dynamic(ev, new_state);
+ }
}
}
- [Qemu-devel] [PATCH v2 0/6] trace: Generic event state description, Lluís Vilanova, 2012/02/06
- [Qemu-devel] [PATCH v2 1/6] trace: Provide a generic tracing event descriptor, Lluís Vilanova, 2012/02/06
- [Qemu-devel] [PATCH v2 2/6] trace: Provide a detailed event control interface, Lluís Vilanova, 2012/02/06
- [Qemu-devel] [PATCH v2 3/6] trace: [monitor] Use new event control interface,
Lluís Vilanova <=
- [Qemu-devel] [PATCH v2 4/6] trace: [default] Use new event control interface, Lluís Vilanova, 2012/02/06
- [Qemu-devel] [PATCH v2 5/6] trace: [simple] Port to generic event information and new control interface, Lluís Vilanova, 2012/02/06
- [Qemu-devel] [PATCH v2 6/6] trace: [stderr] Port to generic event information and new control interface, Lluís Vilanova, 2012/02/06