summaryrefslogtreecommitdiff
path: root/trace/simple.h
diff options
context:
space:
mode:
authorLluís <xscript@gmx.net>2011-08-31 20:30:57 +0200
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2011-09-01 10:34:53 +0100
commitedb47ec498a5c00607e8d428668d5141822a9eac (patch)
tree3e1e9edc6ddfae6e34c132f16ec04fe32eb5335d /trace/simple.h
parent09001ee7b27b9b5f049362efc427d03e2186a431 (diff)
downloadqemu-edb47ec498a5c00607e8d428668d5141822a9eac.tar.gz
trace: move backend-specific code into the trace/ directory
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Diffstat (limited to 'trace/simple.h')
-rw-r--r--trace/simple.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/trace/simple.h b/trace/simple.h
new file mode 100644
index 0000000000..77633ab68a
--- /dev/null
+++ b/trace/simple.h
@@ -0,0 +1,48 @@
+/*
+ * 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 TRACE_SIMPLE_H
+#define TRACE_SIMPLE_H
+
+#include <stdint.h>
+#include <stdbool.h>
+#include <stdio.h>
+
+#ifdef CONFIG_TRACE_SIMPLE
+typedef uint64_t TraceEventID;
+
+typedef struct {
+ const char *tp_name;
+ bool state;
+} TraceEvent;
+
+void trace0(TraceEventID event);
+void trace1(TraceEventID event, uint64_t x1);
+void trace2(TraceEventID event, uint64_t x1, uint64_t x2);
+void trace3(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3);
+void trace4(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4);
+void trace5(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5);
+void trace6(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5, uint64_t x6);
+void st_print_trace(FILE *stream, fprintf_function stream_printf);
+void st_print_trace_events(FILE *stream, fprintf_function stream_printf);
+bool st_change_trace_event_state(const char *tname, bool tstate);
+void st_print_trace_file_status(FILE *stream, fprintf_function stream_printf);
+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_TRACE_SIMPLE */
+
+#endif /* TRACE_SIMPLE_H */