From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=53805 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ObyAv-000791-FG for qemu-devel@nongnu.org; Thu, 22 Jul 2010 11:59:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ObyAq-0002Li-5J for qemu-devel@nongnu.org; Thu, 22 Jul 2010 11:59:08 -0400 Received: from mtagate5.uk.ibm.com ([194.196.100.165]:36910) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ObyAp-0002L8-So for qemu-devel@nongnu.org; Thu, 22 Jul 2010 11:59:04 -0400 Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate5.uk.ibm.com (8.13.1/8.13.1) with ESMTP id o6MFx2hr002324 for ; Thu, 22 Jul 2010 15:59:02 GMT Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o6MFx2vI1708064 for ; Thu, 22 Jul 2010 16:59:02 +0100 Received: from d06av01.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o6MFx1FT005906 for ; Thu, 22 Jul 2010 16:59:01 +0100 From: Stefan Hajnoczi Date: Thu, 22 Jul 2010 16:58:43 +0100 Message-Id: <1279814326-9422-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [Tracing] [PATCH 1/4] Move simple trace prototypes to header file List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi , Prerna Saxena 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 --- 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 +#include + +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 < - -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