qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Lluís <xscript@gmx.net>
To: qemu-devel@nongnu.org
Cc: stefanha@gmail.com, chouteau@adacore.com
Subject: [Qemu-devel] [PATCH v2 05/11] trace: [simple] minor code fixes on conditional compilation
Date: Wed, 06 Apr 2011 20:34:23 +0200	[thread overview]
Message-ID: <20110406183423.22854.30920.stgit@ginnungagap.bsc.es> (raw)
In-Reply-To: <20110406183341.22854.93929.stgit@ginnungagap.bsc.es>

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
 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 <stdbool.h>
 #include <stdio.h>
 
-#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.  */

  parent reply	other threads:[~2011-04-06 18:35 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-06 18:33 [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends Lluís
2011-04-06 18:33 ` [Qemu-devel] [PATCH v2 01/11] minor whitespace/indentation fixes Lluís
2011-04-23 14:19   ` Stefan Hajnoczi
2011-04-26 10:00     ` Markus Armbruster
2011-04-06 18:33 ` [Qemu-devel] [PATCH v2 02/11] docs/tracing.txt: minor documentation fixes Lluís
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 03/11] trace: [ust] fix generation of 'trace.c' on events without args Lluís
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 04/11] trace: [trace-events] fix print formats in some events Lluís
2011-04-06 18:34 ` Lluís [this message]
2011-04-23 14:20   ` [Qemu-devel] [PATCH v2 05/11] trace: [simple] minor code fixes on conditional compilation Stefan Hajnoczi
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 06/11] trace: generalize the "property" concept in the trace-events file Lluís
2011-04-23 14:22   ` Stefan Hajnoczi
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 07/11] trace-state: always use the "nop" backend on events with the "disable" keyword Lluís
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 08/11] trace-state: [simple] disable all trace points by default Lluís
2011-04-06 18:34 ` [Qemu-devel] [PATCH v2 09/11] trace-state: [simple] add "-trace events" argument to control initial state Lluís
2011-04-06 18:35 ` [Qemu-devel] [PATCH v2 10/11] trace-state: [stderr] add support for dynamically enabling/disabling events Lluís
2011-04-23 14:31   ` Stefan Hajnoczi
2011-04-24  6:24     ` Paolo Bonzini
2011-04-24  9:33       ` Stefan Hajnoczi
2011-04-25 10:27         ` Lluís
2011-04-25 18:10           ` Paolo Bonzini
2011-04-26 12:30             ` Fabien Chouteau
2011-04-26 12:38               ` Stefan Hajnoczi
2011-04-26 12:59                 ` Paolo Bonzini
2011-04-26 14:01                 ` Lluís
2011-04-06 18:35 ` [Qemu-devel] [PATCH v2 11/11] trace: enable all events Lluís
2011-04-23 14:45 ` [Qemu-devel] [RFC][PATCH v2 00/11] trace-state: make the behaviour of "disable" consistent across all backends Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110406183423.22854.30920.stgit@ginnungagap.bsc.es \
    --to=xscript@gmx.net \
    --cc=chouteau@adacore.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).