trace: add "-trace events" argument to control initial state

The "-trace events" argument can be used to provide a file with a list of trace
event names that will be enabled prior to starting execution, thus providing
early tracing.

This saves the user from manually toggling event states through the monitor
interface or whichever backend-specific interface.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
This commit is contained in:
Lluís 2011-08-31 20:31:31 +02:00 committed by Stefan Hajnoczi
parent 31965ae27b
commit 23d15e860b
9 changed files with 92 additions and 13 deletions

View file

@ -331,7 +331,7 @@ bool trace_event_set_state(const char *name, bool state)
return false;
}
bool trace_backend_init(const char *file)
bool trace_backend_init(const char *events, const char *file)
{
pthread_t thread;
pthread_attr_t attr;
@ -350,6 +350,7 @@ bool trace_backend_init(const char *file)
fprintf(stderr, "warning: unable to initialize simple trace backend\n");
} else {
atexit(st_flush_trace_buffer);
trace_backend_init_events(events);
st_set_trace_file(file);
}