Add qemu 2.4.0
[kvmfornfv.git] / qemu / scripts / tracetool / format / h.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3
4 """
5 trace/generated-tracers.h
6 """
7
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"
11
12 __maintainer__ = "Stefan Hajnoczi"
13 __email__      = "stefanha@linux.vnet.ibm.com"
14
15
16 from tracetool import out
17
18
19 def generate(events, backend):
20     out('/* This file is autogenerated by tracetool, do not edit. */',
21         '',
22         '#ifndef TRACE__GENERATED_TRACERS_H',
23         '#define TRACE__GENERATED_TRACERS_H',
24         '',
25         '#include "qemu-common.h"',
26         '')
27
28     backend.generate_begin(events)
29
30     for e in events:
31         out('',
32             'static inline void %(api)s(%(args)s)',
33             '{',
34             api=e.api(),
35             args=e.args)
36
37         if "disable" not in e.properties:
38             backend.generate(e)
39
40         out('}')
41
42     backend.generate_end(events)
43
44     out('#endif /* TRACE__GENERATED_TRACERS_H */')