From 26f7227bfe9a9abee3fe5190cbfc35dd876e06d9 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Sat, 22 May 2010 19:24:51 +0100 Subject: trace: Add simple built-in tracing backend This patch adds a simple tracer which produces binary trace files. To try out the simple backend: $ ./configure --trace-backend=simple $ make After running QEMU you can pretty-print the trace: $ ./simpletrace.py trace-events trace.log The output of simpletrace.py looks like this: qemu_realloc 0.699 ptr=0x24363f0 size=0x3 newptr=0x24363f0 qemu_free 0.768 ptr=0x24363f0 ^ ^---- timestamp delta (us) |____ trace event name Signed-off-by: Stefan Hajnoczi trace: Make trace record fields 64-bit Explicitly use 64-bit fields in trace records so that timestamps and magic numbers work for 32-bit host builds. Includes fixes from Prerna Saxena . Signed-off-by: Prerna Saxena Signed-off-by: Stefan Hajnoczi --- simpletrace.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 simpletrace.h (limited to 'simpletrace.h') diff --git a/simpletrace.h b/simpletrace.h new file mode 100644 index 0000000..7d0661b --- /dev/null +++ b/simpletrace.h @@ -0,0 +1,26 @@ +/* + * 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 + +typedef uint64_t TraceEventID; + +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); + +#endif /* SIMPLETRACE_H */ -- cgit v1.1