trace: avoid conditional code compilation during option parsing

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>
This commit is contained in:
Lluís 2011-08-31 20:31:03 +02:00 committed by Stefan Hajnoczi
parent edb47ec498
commit e4858974ec
9 changed files with 72 additions and 26 deletions

21
trace/default.c Normal file
View file

@ -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;
}