From patchwork Wed Apr 6 18:34:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?Q?Llu=C3=ADs?= X-Patchwork-Id: 90050 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3163EB6F0B for ; Thu, 7 Apr 2011 04:38:01 +1000 (EST) Received: from localhost ([127.0.0.1]:41250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7Xc6-0004cX-AQ for incoming@patchwork.ozlabs.org; Wed, 06 Apr 2011 14:37:58 -0400 Received: from [140.186.70.92] (port=42953 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7XZl-0004BI-3p for qemu-devel@nongnu.org; Wed, 06 Apr 2011 14:35:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7XZi-0001jE-D7 for qemu-devel@nongnu.org; Wed, 06 Apr 2011 14:35:32 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]:34685) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Q7XZh-0001ip-Lp for qemu-devel@nongnu.org; Wed, 06 Apr 2011 14:35:30 -0400 Received: (qmail invoked by alias); 06 Apr 2011 18:35:27 -0000 Received: from unknown (EHLO localhost) [84.88.53.92] by mail.gmx.net (mp066) with SMTP; 06 Apr 2011 20:35:27 +0200 X-Authenticated: #12333383 X-Provags-ID: V01U2FsdGVkX18K2vIuWtQKOlXmF24nEAXGN75LV1MUcf46SdK4Rl 3ut75OH/JloB4U To: qemu-devel@nongnu.org From: =?utf-8?b?TGx1w61z?= Date: Wed, 06 Apr 2011 20:34:23 +0200 Message-ID: <20110406183423.22854.30920.stgit@ginnungagap.bsc.es> In-Reply-To: <20110406183341.22854.93929.stgit@ginnungagap.bsc.es> References: <20110406183341.22854.93929.stgit@ginnungagap.bsc.es> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.165.64.22 Cc: stefanha@gmail.com, chouteau@adacore.com Subject: [Qemu-devel] [PATCH v2 05/11] trace: [simple] minor code fixes on conditional compilation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: LluĂ­s Vilanova --- monitor.c | 4 +--- qemu-config.c | 4 ++-- simpletrace.h | 7 ------- vl.c | 7 +++++-- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/monitor.c b/monitor.c index 2ba1362..377424e 100644 --- a/monitor.c +++ b/monitor.c @@ -57,9 +57,7 @@ #include "json-parser.h" #include "osdep.h" #include "exec-all.h" -#ifdef CONFIG_SIMPLE_TRACE #include "trace.h" -#endif #include "ui/qemu-spice.h" //#define DEBUG @@ -592,7 +590,7 @@ static void do_help_cmd(Monitor *mon, const QDict *qdict) help_cmd(mon, qdict_get_try_str(qdict, "name")); } -#ifdef CONFIG_SIMPLE_TRACE +#if defined(CONFIG_SIMPLE_TRACE) static void do_change_trace_event_state(Monitor *mon, const QDict *qdict) { const char *tp_name = qdict_get_str(qdict, "name"); diff --git a/qemu-config.c b/qemu-config.c index 323d3c2..8ba0804 100644 --- a/qemu-config.c +++ b/qemu-config.c @@ -297,7 +297,7 @@ static QemuOptsList qemu_mon_opts = { }, }; -#ifdef CONFIG_SIMPLE_TRACE +#if defined(CONFIG_SIMPLE_TRACE) static QemuOptsList qemu_trace_opts = { .name = "trace", .implied_opt_name = "trace", @@ -461,7 +461,7 @@ static QemuOptsList *vm_config_groups[32] = { &qemu_global_opts, &qemu_mon_opts, &qemu_cpudef_opts, -#ifdef CONFIG_SIMPLE_TRACE +#if defined(CONFIG_SIMPLE_TRACE) &qemu_trace_opts, #endif &qemu_option_rom_opts, diff --git a/simpletrace.h b/simpletrace.h index 8d893bd..196bbe7 100644 --- a/simpletrace.h +++ b/simpletrace.h @@ -15,7 +15,6 @@ #include #include -#ifdef CONFIG_SIMPLE_TRACE typedef uint64_t TraceEventID; typedef struct { @@ -38,11 +37,5 @@ void st_set_trace_file_enabled(bool enable); bool st_set_trace_file(const char *file); void st_flush_trace_buffer(void); bool st_init(const char *file); -#else -static inline bool st_init(const char *file) -{ - return true; -} -#endif /* !CONFIG_SIMPLE_TRACE */ #endif /* SIMPLETRACE_H */ diff --git a/vl.c b/vl.c index 8478cb8..5a9ea51 100644 --- a/vl.c +++ b/vl.c @@ -156,7 +156,6 @@ int main(int argc, char **argv) #include "slirp/libslirp.h" #include "trace.h" -#include "simpletrace.h" #include "qemu-queue.h" #include "cpus.h" #include "arch_init.h" @@ -1967,7 +1966,9 @@ int main(int argc, char **argv, char **envp) int show_vnc_port = 0; #endif int defconfig = 1; +#if defined(CONFIG_SIMPLE_TRACE) const char *trace_file = NULL; +#endif atexit(qemu_run_exit_notifiers); error_set_progname(argv[0]); @@ -2760,7 +2761,7 @@ int main(int argc, char **argv, char **envp) } xen_mode = XEN_ATTACH; break; -#ifdef CONFIG_SIMPLE_TRACE +#if defined(CONFIG_SIMPLE_TRACE) case QEMU_OPTION_trace: opts = qemu_opts_parse(qemu_find_opts("trace"), optarg, 0); if (opts) { @@ -2813,9 +2814,11 @@ int main(int argc, char **argv, char **envp) } loc_set_none(); +#if defined(CONFIG_SIMPLE_TRACE) if (!st_init(trace_file)) { fprintf(stderr, "warning: unable to initialize simple trace backend\n"); } +#endif /* If no data_dir is specified then try to find it relative to the executable path. */