trace: print a warning if user tries to enable an unknown trace event

There was no warning if a bad trace event name was given to
'trace-event' command, thus the user could think that the command
was successful even if this was not the case.

Print a warning if the user tries to enable a trace event which is not
known.

Acked-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2010-10-13 19:14:29 +00:00
parent 2abf314ddd
commit f871d6893a
3 changed files with 9 additions and 3 deletions

View file

@ -246,12 +246,14 @@ static TraceEvent* find_trace_event_by_name(const char *tname)
return NULL; /* indicates end of list reached without a match */
}
void st_change_trace_event_state(const char *tname, bool tstate)
bool st_change_trace_event_state(const char *tname, bool tstate)
{
TraceEvent *tp;
tp = find_trace_event_by_name(tname);
if (tp) {
tp->state = tstate;
return true;
}
return false;
}