From edb47ec498a5c00607e8d428668d5141822a9eac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Llu=C3=ADs?= <xscript@gmx.net>
Date: Wed, 31 Aug 2011 20:30:57 +0200
Subject: [PATCH] trace: move backend-specific code into the trace/ directory
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: LluĂ­s Vilanova <vilanova@ac.upc.edu>
---
 Makefile                        | 1 +
 Makefile.objs                   | 6 ++++--
 scripts/tracetool               | 2 +-
 simpletrace.c => trace/simple.c | 0
 simpletrace.h => trace/simple.h | 6 +++---
 vl.c                            | 2 +-
 6 files changed, 10 insertions(+), 7 deletions(-)
 rename simpletrace.c => trace/simple.c (100%)
 rename simpletrace.h => trace/simple.h (95%)

diff --git a/Makefile b/Makefile
index 86068498e9..13be25a382 100644
--- a/Makefile
+++ b/Makefile
@@ -209,6 +209,7 @@ clean:
 	rm -Rf .libs
 	rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d block/*.o block/*.d net/*.o net/*.d fsdev/*.o fsdev/*.d ui/*.o ui/*.d qapi/*.o qapi/*.d qga/*.o qga/*.d
 	rm -f qemu-img-cmds.h
+	rm -f trace/*.o trace/*.d
 	rm -f trace.c trace.h trace.c-timestamp trace.h-timestamp
 	rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp
 	rm -f trace-dtrace.h trace-dtrace.h-timestamp
diff --git a/Makefile.objs b/Makefile.objs
index 833158b1b6..4f8b0ed689 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -372,16 +372,18 @@ trace-dtrace.lo: trace-dtrace.dtrace
 	$(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC dtrace -o $@ -G -s $<, "  lt GEN trace-dtrace.o")
 endif
 
-simpletrace.o: simpletrace.c $(GENERATED_HEADERS)
+trace/simple.o: trace/simple.c $(GENERATED_HEADERS)
 
 trace-obj-$(CONFIG_TRACE_DTRACE) += trace-dtrace.o
 ifneq ($(TRACE_BACKEND),dtrace)
 trace-obj-y = trace.o
 endif
 
-trace-obj-$(CONFIG_TRACE_SIMPLE) += simpletrace.o
+trace-nested-$(CONFIG_TRACE_SIMPLE) += simple.o
 trace-obj-$(CONFIG_TRACE_SIMPLE) += qemu-timer-common.o
 
+trace-obj-y += $(addprefix trace/, $(trace-nested-y))
+
 ######################################################################
 # smartcard
 
diff --git a/scripts/tracetool b/scripts/tracetool
index 2155a57df2..9ed4fae70f 100755
--- a/scripts/tracetool
+++ b/scripts/tracetool
@@ -158,7 +158,7 @@ linetoc_end_nop()
 linetoh_begin_simple()
 {
     cat <<EOF
-#include "simpletrace.h"
+#include "trace/simple.h"
 EOF
 
     simple_event_num=0
diff --git a/simpletrace.c b/trace/simple.c
similarity index 100%
rename from simpletrace.c
rename to trace/simple.c
diff --git a/simpletrace.h b/trace/simple.h
similarity index 95%
rename from simpletrace.h
rename to trace/simple.h
index 507dd878d7..77633ab68a 100644
--- a/simpletrace.h
+++ b/trace/simple.h
@@ -8,8 +8,8 @@
  *
  */
 
-#ifndef SIMPLETRACE_H
-#define SIMPLETRACE_H
+#ifndef TRACE_SIMPLE_H
+#define TRACE_SIMPLE_H
 
 #include <stdint.h>
 #include <stdbool.h>
@@ -45,4 +45,4 @@ static inline bool st_init(const char *file)
 }
 #endif /* !CONFIG_TRACE_SIMPLE */
 
-#endif /* SIMPLETRACE_H */
+#endif /* TRACE_SIMPLE_H */
diff --git a/vl.c b/vl.c
index 8c7aaaa192..145d7384d8 100644
--- a/vl.c
+++ b/vl.c
@@ -156,7 +156,7 @@ int main(int argc, char **argv)
 #include "slirp/libslirp.h"
 
 #include "trace.h"
-#include "simpletrace.h"
+#include "trace/simple.h"
 #include "qemu-queue.h"
 #include "cpus.h"
 #include "arch_init.h"