hw/arm/virt-acpi-build: Add SPCR table
[qemu/ar7.git] / scripts / tracetool / format / tcg_h.py
blobf676b666222a2dfd5fb7b2f6fec0f886519f79aa
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
4 """
5 Generate .h file for TCG code generation.
6 """
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 */',
22 '',
23 '#ifndef TRACE__GENERATED_TCG_TRACERS_H',
24 '#define TRACE__GENERATED_TCG_TRACERS_H',
25 '',
26 '#include <stdint.h>',
27 '',
28 '#include "trace.h"',
29 '#include "exec/helper-proto.h"',
30 '',
33 for e in events:
34 # just keep one of them
35 if "tcg-trans" not in e.properties:
36 continue
38 # get the original event definition
39 e = e.original.original
41 out('static inline void %(name_tcg)s(%(args)s)',
42 '{',
43 name_tcg=e.api(e.QEMU_TRACE_TCG),
44 args=e.args)
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()))
54 out('}')
56 out('',
57 '#endif /* TRACE__GENERATED_TCG_TRACERS_H */')