aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorLluís Vilanova <vilanova@ac.upc.edu>2013-03-05 14:47:43 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2013-03-28 14:19:57 +0100
commitca285c3fca7c3d2b77b133e82f7a3592ccc7f5d3 (patch)
tree786d22824ac8d0f79294dae45c18eaf84ec296da /monitor.c
parentb1bae816c4c0743e37ee9e797a503610c34e3073 (diff)
trace: [monitor] Use new event control interface
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/monitor.c b/monitor.c
index 5dfae2a172..4ec1db980c 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);
}
}