]>
git.proxmox.com Git - mirror_qemu.git/blob - scripts/tracetool/format/events_c.py
2d97fa310a340f30c6f879fd758b7d1f182d8d68
2 # -*- coding: utf-8 -*-
5 trace/generated-events.c
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. */',
23 '#include "trace/generated-events.h"',
24 '#include "trace/control.h"',
27 out('TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
30 out(' { .id = %(id)s, .name = \"%(name)s\", .sstate = %(sstate)s, .dstate = 0 },',
31 id = "TRACE_" + e
.name
.upper(),
33 sstate
= "TRACE_%s_ENABLED" % e
.name
.upper())