Browse Source
A default implementation for backend-specific routines is provided in "trace/default.c", which backends can override by setting "trace_default=no" in "configure". Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>stable-1.0
committed by
Stefan Hajnoczi
9 changed files with 72 additions and 26 deletions
@ -0,0 +1,24 @@ |
|||
/*
|
|||
* Interface for configuring and controlling the state of tracing events. |
|||
* |
|||
* Copyright (C) 2011 Lluís Vilanova <vilanova@ac.upc.edu> |
|||
* |
|||
* This work is licensed under the terms of the GNU GPL, version 2. See |
|||
* the COPYING file in the top-level directory. |
|||
*/ |
|||
|
|||
#ifndef TRACE_CONTROL_H |
|||
#define TRACE_CONTROL_H |
|||
|
|||
#include <stdbool.h> |
|||
|
|||
|
|||
/** Initialize the tracing backend.
|
|||
* |
|||
* @file Name of trace output file; may be NULL. |
|||
* Corresponds to commandline option "-trace file=...". |
|||
* @return Whether the backend could be successfully initialized. |
|||
*/ |
|||
bool trace_backend_init(const char *file); |
|||
|
|||
#endif /* TRACE_CONTROL_H */ |
|||
@ -0,0 +1,21 @@ |
|||
/*
|
|||
* Default implementation for backend initialization from commandline. |
|||
* |
|||
* Copyright (C) 2011 Lluís Vilanova <vilanova@ac.upc.edu> |
|||
* |
|||
* This work is licensed under the terms of the GNU GPL, version 2. See |
|||
* the COPYING file in the top-level directory. |
|||
*/ |
|||
|
|||
#include "trace/control.h" |
|||
|
|||
|
|||
bool trace_backend_init(const char *file) |
|||
{ |
|||
if (file) { |
|||
fprintf(stderr, "error: -trace file=...: " |
|||
"option not supported by the selected tracing backend\n"); |
|||
return false; |
|||
} |
|||
return true; |
|||
} |
|||
Loading…
Reference in new issue