mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
trace: separate trace event control and query routines from the simple backend
Generalize the 'st_print_trace_events' and 'st_change_trace_event_state' into backend-specific 'trace_print_events' and 'trace_event_set_state' (respectively) in the "trace/control.h" file. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
This commit is contained in:
parent
49926043c1
commit
fc76410539
6 changed files with 40 additions and 17 deletions
|
|
@ -303,7 +303,12 @@ void st_print_trace(FILE *stream, int (*stream_printf)(FILE *stream, const char
|
|||
}
|
||||
}
|
||||
|
||||
void st_print_trace_events(FILE *stream, int (*stream_printf)(FILE *stream, const char *fmt, ...))
|
||||
void st_flush_trace_buffer(void)
|
||||
{
|
||||
flush_trace_file(true);
|
||||
}
|
||||
|
||||
void trace_print_events(FILE *stream, fprintf_function stream_printf)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
|
|
@ -313,24 +318,19 @@ void st_print_trace_events(FILE *stream, int (*stream_printf)(FILE *stream, cons
|
|||
}
|
||||
}
|
||||
|
||||
bool st_change_trace_event_state(const char *name, bool enabled)
|
||||
bool trace_event_set_state(const char *name, bool state)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < NR_TRACE_EVENTS; i++) {
|
||||
if (!strcmp(trace_list[i].tp_name, name)) {
|
||||
trace_list[i].state = enabled;
|
||||
trace_list[i].state = state;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void st_flush_trace_buffer(void)
|
||||
{
|
||||
flush_trace_file(true);
|
||||
}
|
||||
|
||||
bool trace_backend_init(const char *file)
|
||||
{
|
||||
pthread_t thread;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue