2012-04-04 02:47:50 +08:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
"""
|
|
|
|
Generate .h file.
|
|
|
|
"""
|
|
|
|
|
|
|
|
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
|
|
|
|
__copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>"
|
|
|
|
__license__ = "GPL version 2 or (at your option) any later version"
|
|
|
|
|
|
|
|
__maintainer__ = "Stefan Hajnoczi"
|
|
|
|
__email__ = "stefanha@linux.vnet.ibm.com"
|
|
|
|
|
|
|
|
|
|
|
|
from tracetool import out
|
|
|
|
|
|
|
|
|
|
|
|
def begin(events):
|
|
|
|
out('/* This file is autogenerated by tracetool, do not edit. */',
|
|
|
|
'',
|
2012-12-15 03:13:09 +08:00
|
|
|
'#ifndef TRACE__GENERATED_TRACERS_H',
|
|
|
|
'#define TRACE__GENERATED_TRACERS_H',
|
2012-04-04 02:47:50 +08:00
|
|
|
'',
|
|
|
|
'#include "qemu-common.h"')
|
|
|
|
|
|
|
|
def end(events):
|
2013-03-05 21:47:32 +08:00
|
|
|
out('#endif /* TRACE__GENERATED_TRACERS_H */')
|
2012-04-04 02:47:50 +08:00
|
|
|
|
|
|
|
def nop(events):
|
|
|
|
for e in events:
|
|
|
|
out('',
|
|
|
|
'static inline void trace_%(name)s(%(args)s)',
|
|
|
|
'{',
|
|
|
|
'}',
|
|
|
|
name = e.name,
|
|
|
|
args = e.args,
|
|
|
|
)
|