From: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>,
Prerna Saxena <prerna@linux.vnet.ibm.com>
Subject: [Qemu-devel] [Tracing] [PATCH 1/4] Move simple trace prototypes to header file
Date: Thu, 22 Jul 2010 16:58:43 +0100 [thread overview]
Message-ID: <1279814326-9422-1-git-send-email-stefanha@linux.vnet.ibm.com> (raw)
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 <stefanha@linux.vnet.ibm.com>
---
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
next reply other threads:[~2010-07-22 15:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-22 15:58 Stefan Hajnoczi [this message]
2010-07-22 15:58 ` [Qemu-devel] [Tracing] [PATCH 2/4] Add copyright and doc comments to simpletrace.py Stefan Hajnoczi
2010-07-22 15:58 ` [Qemu-devel] [Tracing] [PATCH 3/4] Add a header to the trace file format Stefan Hajnoczi
2010-07-22 15:58 ` [Qemu-devel] [Tracing] [PATCH 4/4] Disable posix_aio_process_queue by default 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=1279814326-9422-1-git-send-email-stefanha@linux.vnet.ibm.com \
--to=stefanha@linux.vnet.ibm.com \
--cc=prerna@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/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).