2 # -*- coding: utf-8 -*-
5 Generate .h file for TCG code generation.
8 __author__
= "Lluís Vilanova <vilanova@ac.upc.edu>"
9 __copyright__
= "Copyright 2012-2014, Lluís Vilanova <vilanova@ac.upc.edu>"
10 __license__
= "GPL version 2 or (at your option) any later version"
12 __maintainer__
= "Stefan Hajnoczi"
13 __email__
= "stefanha@linux.vnet.ibm.com"
16 from tracetool
import out
19 def generate(events
, backend
):
20 out('/* This file is autogenerated by tracetool, do not edit. */',
21 '/* You must include this file after the inclusion of helper.h */',
23 '#ifndef TRACE__GENERATED_TCG_TRACERS_H',
24 '#define TRACE__GENERATED_TCG_TRACERS_H',
26 '#include <stdint.h>',
29 '#include "exec/helper-proto.h"',
34 # just keep one of them
35 if "tcg-trans" not in e
.properties
:
38 # get the original event definition
39 e
= e
.original
.original
41 out('static inline void %(name_tcg)s(%(args)s)',
43 name_tcg
=e
.api(e
.QEMU_TRACE_TCG
),
46 if "disable" not in e
.properties
:
47 out(' %(name_trans)s(%(argnames_trans)s);',
48 ' gen_helper_%(name_exec)s(%(argnames_exec)s);',
49 name_trans
=e
.event_trans
.api(e
.QEMU_TRACE
),
50 name_exec
=e
.event_exec
.api(e
.QEMU_TRACE
),
51 argnames_trans
=", ".join(e
.event_trans
.args
.names()),
52 argnames_exec
=", ".join(e
.event_exec
.args
.names()))
57 '#endif /* TRACE__GENERATED_TCG_TRACERS_H */')