qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [Tracing] [PATCH 1/4] Move simple trace prototypes to heade


From: Stefan Hajnoczi
Subject: [Qemu-devel] [Tracing] [PATCH 1/4] Move simple trace prototypes to header file
Date: Thu, 22 Jul 2010 16:58:43 +0100

Simple trace prototypes should not be in the tracetool code generator.
It is easier to modify and debug the code if they are in a regular C
header file.

Signed-off-by: Stefan Hajnoczi <address@hidden>
---
This patch is against the tracing branch:
http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/tracing

 simpletrace.h |   37 +++++++++++++++++++++++++++++++++++++
 tracetool     |   22 +---------------------
 2 files changed, 38 insertions(+), 21 deletions(-)
 create mode 100644 simpletrace.h

diff --git a/simpletrace.h b/simpletrace.h
new file mode 100644
index 0000000..bec8d62
--- /dev/null
+++ b/simpletrace.h
@@ -0,0 +1,37 @@
+/*
+ * Simple trace backend
+ *
+ * Copyright IBM, Corp. 2010
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.  See
+ * the COPYING file in the top-level directory.
+ *
+ */
+
+#ifndef SIMPLETRACE_H
+#define SIMPLETRACE_H
+
+#include <stdbool.h>
+#include <stdio.h>
+
+typedef unsigned int TraceEventID;
+
+typedef struct {
+    const char *tp_name;
+    bool state;
+} TraceEvent;
+
+void trace0(TraceEventID event);
+void trace1(TraceEventID event, unsigned long x1);
+void trace2(TraceEventID event, unsigned long x1, unsigned long x2);
+void trace3(TraceEventID event, unsigned long x1, unsigned long x2, unsigned 
long x3);
+void trace4(TraceEventID event, unsigned long x1, unsigned long x2, unsigned 
long x3, unsigned long x4);
+void trace5(TraceEventID event, unsigned long x1, unsigned long x2, unsigned 
long x3, unsigned long x4, unsigned long x5);
+void st_print_trace(FILE *stream, int (*stream_printf)(FILE *stream, const 
char *fmt, ...));
+void st_print_trace_events(FILE *stream, int (*stream_printf)(FILE *stream, 
const char *fmt, ...));
+void st_print_trace_file_status(FILE *stream, int (*stream_printf)(FILE 
*stream, const char *fmt, ...));
+void st_flush_trace_buffer(void);
+void st_set_trace_file_enabled(bool enable);
+void change_trace_event_state(const char *tname, bool tstate);
+
+#endif /* SIMPLETRACE_H */
diff --git a/tracetool b/tracetool
index ac832af..4890e66 100755
--- a/tracetool
+++ b/tracetool
@@ -138,27 +138,7 @@ linetoc_end_nop()
 linetoh_begin_simple()
 {
     cat <<EOF
-#include <stdbool.h>
-
-typedef unsigned int TraceEventID;
-
-typedef struct {
-    const char *tp_name;
-    bool state;
-} TraceEvent;
-
-void trace0(TraceEventID event);
-void trace1(TraceEventID event, unsigned long x1);
-void trace2(TraceEventID event, unsigned long x1, unsigned long x2);
-void trace3(TraceEventID event, unsigned long x1, unsigned long x2, unsigned 
long x3);
-void trace4(TraceEventID event, unsigned long x1, unsigned long x2, unsigned 
long x3, unsigned long x4);
-void trace5(TraceEventID event, unsigned long x1, unsigned long x2, unsigned 
long x3, unsigned long x4, unsigned long x5);
-void st_print_trace(FILE *stream, int (*stream_printf)(FILE *stream, const 
char *fmt, ...));
-void st_print_trace_events(FILE *stream, int (*stream_printf)(FILE *stream, 
const char *fmt, ...));
-void st_print_trace_file_status(FILE *stream, int (*stream_printf)(FILE 
*stream, const char *fmt, ...));
-void st_flush_trace_buffer(void);
-void st_set_trace_file_enabled(bool enable);
-void change_trace_event_state(const char *tname, bool tstate);
+#include "simpletrace.h"
 EOF
 
     simple_event_num=0
-- 
1.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]