2 # -*- coding: utf-8 -*-
5 trace/generated-events.h
8 __author__
= "Lluís Vilanova <vilanova@ac.upc.edu>"
9 __copyright__
= "Copyright 2012-2016, 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. */',
22 '#ifndef TRACE__GENERATED_EVENTS_H',
23 '#define TRACE__GENERATED_EVENTS_H',
30 out(' TRACE_%s,' % e
.name
.upper())
32 out(' TRACE_EVENT_COUNT',
35 # per-vCPU event identifiers
39 if "vcpu" in e
.properties
:
40 out(' TRACE_VCPU_%s,' % e
.name
.upper())
42 out(' TRACE_VCPU_EVENT_COUNT',
43 '} TraceEventVCPUID;')
47 if 'disable' in e
.properties
:
51 if "tcg-exec" in e
.properties
:
52 # a single define for the two "sub-events"
53 out('#define TRACE_%(name)s_ENABLED %(enabled)d',
54 name
=e
.original
.name
.upper(),
56 out('#define TRACE_%s_ENABLED %d' % (e
.name
.upper(), enabled
))
58 out('#include "trace/event-internal.h"',
60 '#endif /* TRACE__GENERATED_EVENTS_H */')