]>
git.proxmox.com Git - mirror_qemu.git/blob - scripts/tracetool/format/events_c.py
2 # -*- coding: utf-8 -*-
5 Generate .c for event description.
8 __author__
= "Lluís Vilanova <vilanova@ac.upc.edu>"
9 __copyright__
= "Copyright 2012, 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
20 out('/* This file is autogenerated by tracetool, do not edit. */',
23 '#include "trace/generated-events.h"',
24 '#include "trace/control.h"',
28 out('TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
31 out(' { .id = %(id)s, .name = \"%(name)s\", .sstate = %(sstate)s, .dstate = 0 },',
32 id = "TRACE_" + e
.name
.upper(),
34 sstate
= "TRACE_%s_ENABLED" % e
.name
.upper(),