Skip to content

Commit

Permalink
trace: [monitor] Use new event control interface
Browse files Browse the repository at this point in the history
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
Lluís Vilanova authored and stefanhaRH committed Mar 28, 2013
1 parent b1bae81 commit ca285c3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions monitor.c
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit ca285c3

Please sign in to comment.