summaryrefslogtreecommitdiffstats
path: root/qemu/scripts/tracetool/format
diff options
context:
space:
mode:
Diffstat (limited to 'qemu/scripts/tracetool/format')
-rw-r--r--qemu/scripts/tracetool/format/__init__.py85
-rw-r--r--qemu/scripts/tracetool/format/c.py28
-rw-r--r--qemu/scripts/tracetool/format/d.py54
-rw-r--r--qemu/scripts/tracetool/format/events_c.py37
-rw-r--r--qemu/scripts/tracetool/format/events_h.py50
-rw-r--r--qemu/scripts/tracetool/format/h.py44
-rw-r--r--qemu/scripts/tracetool/format/simpletrace_stap.py71
-rw-r--r--qemu/scripts/tracetool/format/stap.py61
-rw-r--r--qemu/scripts/tracetool/format/tcg_h.py66
-rw-r--r--qemu/scripts/tracetool/format/tcg_helper_c.py74
-rw-r--r--qemu/scripts/tracetool/format/tcg_helper_h.py49
-rw-r--r--qemu/scripts/tracetool/format/tcg_helper_wrapper_h.py71
-rw-r--r--qemu/scripts/tracetool/format/ust_events_c.py35
-rw-r--r--qemu/scripts/tracetool/format/ust_events_h.py100
14 files changed, 0 insertions, 825 deletions
diff --git a/qemu/scripts/tracetool/format/__init__.py b/qemu/scripts/tracetool/format/__init__.py
deleted file mode 100644
index 812570ff6..000000000
--- a/qemu/scripts/tracetool/format/__init__.py
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""
-Format management.
-
-
-Creating new formats
---------------------
-
-A new format named 'foo-bar' corresponds to Python module
-'tracetool/format/foo_bar.py'.
-
-A format module should provide a docstring, whose first non-empty line will be
-considered its short description.
-
-All formats must generate their contents through the 'tracetool.out' routine.
-
-
-Format functions
-----------------
-
-======== ==================================================================
-Function Description
-======== ==================================================================
-generate Called to generate a format-specific file.
-======== ==================================================================
-
-"""
-
-__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
-__copyright__ = "Copyright 2012-2014, 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"
-
-
-import os
-
-import tracetool
-
-
-def get_list():
- """Get a list of (name, description) pairs."""
- res = []
- modnames = []
- for filename in os.listdir(tracetool.format.__path__[0]):
- if filename.endswith('.py') and filename != '__init__.py':
- modnames.append(filename.rsplit('.', 1)[0])
- for modname in sorted(modnames):
- module = tracetool.try_import("tracetool.format." + modname)
-
- # just in case; should never fail unless non-module files are put there
- if not module[0]:
- continue
- module = module[1]
-
- doc = module.__doc__
- if doc is None:
- doc = ""
- doc = doc.strip().split("\n")[0]
-
- name = modname.replace("_", "-")
- res.append((name, doc))
- return res
-
-
-def exists(name):
- """Return whether the given format exists."""
- if len(name) == 0:
- return False
- name = name.replace("-", "_")
- return tracetool.try_import("tracetool.format." + name)[1]
-
-
-def generate(events, format, backend):
- if not exists(format):
- raise ValueError("unknown format: %s" % format)
- format = format.replace("-", "_")
- func = tracetool.try_import("tracetool.format." + format,
- "generate")[1]
- if func is None:
- raise AttributeError("format has no 'generate': %s" % format)
- func(events, backend)
diff --git a/qemu/scripts/tracetool/format/c.py b/qemu/scripts/tracetool/format/c.py
deleted file mode 100644
index 699598fb0..000000000
--- a/qemu/scripts/tracetool/format/c.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""
-trace/generated-tracers.c
-"""
-
-__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
-__copyright__ = "Copyright 2012-2014, 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 generate(events, backend):
- events = [e for e in events
- if "disable" not in e.properties]
-
- out('/* This file is autogenerated by tracetool, do not edit. */',
- '')
- backend.generate_begin(events)
- for event in events:
- backend.generate(event)
- backend.generate_end(events)
diff --git a/qemu/scripts/tracetool/format/d.py b/qemu/scripts/tracetool/format/d.py
deleted file mode 100644
index c77d5b7ab..000000000
--- a/qemu/scripts/tracetool/format/d.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""
-trace/generated-tracers.dtrace (DTrace only).
-"""
-
-__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
-__copyright__ = "Copyright 2012-2014, 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
-
-
-# Reserved keywords from
-# https://wikis.oracle.com/display/DTrace/Types,+Operators+and+Expressions
-RESERVED_WORDS = (
- 'auto', 'goto', 'sizeof', 'break', 'if', 'static', 'case', 'import',
- 'string', 'char', 'inline', 'stringof', 'const', 'int', 'struct',
- 'continue', 'long', 'switch', 'counter', 'offsetof', 'this',
- 'default', 'probe', 'translator', 'do', 'provider', 'typedef',
- 'double', 'register', 'union', 'else', 'restrict', 'unsigned',
- 'enum', 'return', 'void', 'extern', 'self', 'volatile', 'float',
- 'short', 'while', 'for', 'signed', 'xlate',
-)
-
-
-def generate(events, backend):
- events = [e for e in events
- if "disable" not in e.properties]
-
- out('/* This file is autogenerated by tracetool, do not edit. */'
- '',
- 'provider qemu {')
-
- for e in events:
- args = []
- for type_, name in e.args:
- if name in RESERVED_WORDS:
- name += '_'
- args.append(type_ + ' ' + name)
-
- # Define prototype for probe arguments
- out('',
- 'probe %(name)s(%(args)s);',
- name=e.name,
- args=','.join(args))
-
- out('',
- '};')
diff --git a/qemu/scripts/tracetool/format/events_c.py b/qemu/scripts/tracetool/format/events_c.py
deleted file mode 100644
index 1cc6a49a7..000000000
--- a/qemu/scripts/tracetool/format/events_c.py
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""
-trace/generated-events.c
-"""
-
-__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
-__copyright__ = "Copyright 2012-2014, 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 generate(events, backend):
- out('/* This file is autogenerated by tracetool, do not edit. */',
- '',
- '#include "qemu/osdep.h"',
- '#include "trace.h"',
- '#include "trace/generated-events.h"',
- '#include "trace/control.h"',
- '')
-
- out('TraceEvent trace_events[TRACE_EVENT_COUNT] = {')
-
- for e in events:
- out(' { .id = %(id)s, .name = \"%(name)s\", .sstate = %(sstate)s },',
- id = "TRACE_" + e.name.upper(),
- name = e.name,
- sstate = "TRACE_%s_ENABLED" % e.name.upper())
-
- out('};',
- '')
diff --git a/qemu/scripts/tracetool/format/events_h.py b/qemu/scripts/tracetool/format/events_h.py
deleted file mode 100644
index 4529263e0..000000000
--- a/qemu/scripts/tracetool/format/events_h.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""
-trace/generated-events.h
-"""
-
-__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
-__copyright__ = "Copyright 2012-2016, 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 generate(events, backend):
- out('/* This file is autogenerated by tracetool, do not edit. */',
- '',
- '#ifndef TRACE__GENERATED_EVENTS_H',
- '#define TRACE__GENERATED_EVENTS_H',
- '')
-
- # event identifiers
- out('typedef enum {')
-
- for e in events:
- out(' TRACE_%s,' % e.name.upper())
-
- out(' TRACE_EVENT_COUNT',
- '} TraceEventID;')
-
- # static state
- for e in events:
- if 'disable' in e.properties:
- enabled = 0
- else:
- enabled = 1
- if "tcg-trans" in e.properties:
- # a single define for the two "sub-events"
- out('#define TRACE_%(name)s_ENABLED %(enabled)d',
- name=e.original.name.upper(),
- enabled=enabled)
- out('#define TRACE_%s_ENABLED %d' % (e.name.upper(), enabled))
-
- out('#include "trace/event-internal.h"',
- '',
- '#endif /* TRACE__GENERATED_EVENTS_H */')
diff --git a/qemu/scripts/tracetool/format/h.py b/qemu/scripts/tracetool/format/h.py
deleted file mode 100644
index 083540621..000000000
--- a/qemu/scripts/tracetool/format/h.py
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""
-trace/generated-tracers.h
-"""
-
-__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
-__copyright__ = "Copyright 2012-2016, 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 generate(events, backend):
- out('/* This file is autogenerated by tracetool, do not edit. */',
- '',
- '#ifndef TRACE__GENERATED_TRACERS_H',
- '#define TRACE__GENERATED_TRACERS_H',
- '',
- '#include "qemu-common.h"',
- '')
-
- backend.generate_begin(events)
-
- for e in events:
- out('',
- 'static inline void %(api)s(%(args)s)',
- '{',
- api=e.api(),
- args=e.args)
-
- if "disable" not in e.properties:
- backend.generate(e)
-
- out('}')
-
- backend.generate_end(events)
-
- out('#endif /* TRACE__GENERATED_TRACERS_H */')
diff --git a/qemu/scripts/tracetool/format/simpletrace_stap.py b/qemu/scripts/tracetool/format/simpletrace_stap.py
deleted file mode 100644
index 7e44bc181..000000000
--- a/qemu/scripts/tracetool/format/simpletrace_stap.py
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""
-Generate .stp file that outputs simpletrace binary traces (DTrace with SystemTAP only).
-"""
-
-__author__ = "Stefan Hajnoczi <redhat.com>"
-__copyright__ = "Copyright (C) 2014, Red Hat, Inc."
-__license__ = "GPL version 2 or (at your option) any later version"
-
-__maintainer__ = "Stefan Hajnoczi"
-__email__ = "stefanha@redhat.com"
-
-
-from tracetool import out
-from tracetool.backend.dtrace import binary, probeprefix
-from tracetool.backend.simple import is_string
-from tracetool.format.stap import stap_escape
-
-
-def generate(events, backend):
- out('/* This file is autogenerated by tracetool, do not edit. */',
- '')
-
- for event_id, e in enumerate(events):
- if 'disable' in e.properties:
- continue
-
- out('probe %(probeprefix)s.simpletrace.%(name)s = %(probeprefix)s.%(name)s ?',
- '{',
- probeprefix=probeprefix(),
- name=e.name)
-
- # Calculate record size
- sizes = ['24'] # sizeof(TraceRecord)
- for type_, name in e.args:
- name = stap_escape(name)
- if is_string(type_):
- out(' try {',
- ' arg%(name)s_str = %(name)s ? user_string_n(%(name)s, 512) : "<null>"',
- ' } catch {}',
- ' arg%(name)s_len = strlen(arg%(name)s_str)',
- name=name)
- sizes.append('4 + arg%s_len' % name)
- else:
- sizes.append('8')
- sizestr = ' + '.join(sizes)
-
- # Generate format string and value pairs for record header and arguments
- fields = [('8b', str(event_id)),
- ('8b', 'gettimeofday_ns()'),
- ('4b', sizestr),
- ('4b', 'pid()')]
- for type_, name in e.args:
- name = stap_escape(name)
- if is_string(type_):
- fields.extend([('4b', 'arg%s_len' % name),
- ('.*s', 'arg%s_len, arg%s_str' % (name, name))])
- else:
- fields.append(('8b', name))
-
- # Emit the entire record in a single SystemTap printf()
- fmt_str = '%'.join(fmt for fmt, _ in fields)
- arg_str = ', '.join(arg for _, arg in fields)
- out(' printf("%%%(fmt_str)s", %(arg_str)s)',
- fmt_str=fmt_str, arg_str=arg_str)
-
- out('}')
-
- out()
diff --git a/qemu/scripts/tracetool/format/stap.py b/qemu/scripts/tracetool/format/stap.py
deleted file mode 100644
index 9e780f1b0..000000000
--- a/qemu/scripts/tracetool/format/stap.py
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""
-Generate .stp file (DTrace with SystemTAP only).
-"""
-
-__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
-__copyright__ = "Copyright 2012-2014, 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
-from tracetool.backend.dtrace import binary, probeprefix
-
-
-# Technically 'self' is not used by systemtap yet, but
-# they recommended we keep it in the reserved list anyway
-RESERVED_WORDS = (
- 'break', 'catch', 'continue', 'delete', 'else', 'for',
- 'foreach', 'function', 'global', 'if', 'in', 'limit',
- 'long', 'next', 'probe', 'return', 'self', 'string',
- 'try', 'while'
- )
-
-
-def stap_escape(identifier):
- # Append underscore to reserved keywords
- if identifier in RESERVED_WORDS:
- return identifier + '_'
- return identifier
-
-
-def generate(events, backend):
- events = [e for e in events
- if "disable" not in e.properties]
-
- out('/* This file is autogenerated by tracetool, do not edit. */',
- '')
-
- for e in events:
- # Define prototype for probe arguments
- out('probe %(probeprefix)s.%(name)s = process("%(binary)s").mark("%(name)s")',
- '{',
- probeprefix=probeprefix(),
- name=e.name,
- binary=binary())
-
- i = 1
- if len(e.args) > 0:
- for name in e.args.names():
- name = stap_escape(name)
- out(' %s = $arg%d;' % (name, i))
- i += 1
-
- out('}')
-
- out()
diff --git a/qemu/scripts/tracetool/format/tcg_h.py b/qemu/scripts/tracetool/format/tcg_h.py
deleted file mode 100644
index e2331f251..000000000
--- a/qemu/scripts/tracetool/format/tcg_h.py
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""
-Generate .h file for TCG code generation.
-"""
-
-__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
-__copyright__ = "Copyright 2012-2016, 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, Arguments
-import tracetool.vcpu
-
-
-def vcpu_transform_args(args):
- assert len(args) == 1
- return Arguments([
- args,
- # NOTE: this name must be kept in sync with the one in "tcg_h"
- # NOTE: Current helper code uses TCGv_env (CPUArchState*)
- ("TCGv_env", "__tcg_" + args.names()[0]),
- ])
-
-
-def generate(events, backend):
- out('/* This file is autogenerated by tracetool, do not edit. */',
- '/* You must include this file after the inclusion of helper.h */',
- '',
- '#ifndef TRACE__GENERATED_TCG_TRACERS_H',
- '#define TRACE__GENERATED_TCG_TRACERS_H',
- '',
- '#include "trace.h"',
- '#include "exec/helper-proto.h"',
- '',
- )
-
- for e in events:
- # just keep one of them
- if "tcg-trans" not in e.properties:
- continue
-
- out('static inline void %(name_tcg)s(%(args)s)',
- '{',
- name_tcg=e.original.api(e.QEMU_TRACE_TCG),
- args=tracetool.vcpu.transform_args("tcg_h", e.original))
-
- if "disable" not in e.properties:
- args_trans = e.original.event_trans.args
- args_exec = tracetool.vcpu.transform_args(
- "tcg_helper_c", e.original.event_exec, "wrapper")
- out(' %(name_trans)s(%(argnames_trans)s);',
- ' gen_helper_%(name_exec)s(%(argnames_exec)s);',
- name_trans=e.original.event_trans.api(e.QEMU_TRACE),
- name_exec=e.original.event_exec.api(e.QEMU_TRACE),
- argnames_trans=", ".join(args_trans.names()),
- argnames_exec=", ".join(args_exec.names()))
-
- out('}')
-
- out('',
- '#endif /* TRACE__GENERATED_TCG_TRACERS_H */')
diff --git a/qemu/scripts/tracetool/format/tcg_helper_c.py b/qemu/scripts/tracetool/format/tcg_helper_c.py
deleted file mode 100644
index a089b0bf0..000000000
--- a/qemu/scripts/tracetool/format/tcg_helper_c.py
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""
-Generate trace/generated-helpers.c.
-"""
-
-__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
-__copyright__ = "Copyright 2012-2016, 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 Arguments, out
-from tracetool.transform import *
-import tracetool.vcpu
-
-
-def vcpu_transform_args(args, mode):
- assert len(args) == 1
- # NOTE: this name must be kept in sync with the one in "tcg_h"
- args = Arguments([(args.types()[0], "__tcg_" + args.names()[0])])
- if mode == "code":
- return Arguments([
- # Does cast from helper requirements to tracing types
- ("CPUState *", "ENV_GET_CPU(%s)" % args.names()[0]),
- ])
- else:
- args = Arguments([
- # NOTE: Current helper code uses TCGv_env (CPUArchState*)
- ("CPUArchState *", args.names()[0]),
- ])
- if mode == "header":
- return args
- elif mode == "wrapper":
- return args.transform(HOST_2_TCG)
- else:
- assert False
-
-
-def generate(events, backend):
- events = [e for e in events
- if "disable" not in e.properties]
-
- out('/* This file is autogenerated by tracetool, do not edit. */',
- '',
- '#include "qemu/osdep.h"',
- '#include "qemu-common.h"',
- '#include "trace.h"',
- '#include "exec/helper-proto.h"',
- '',
- )
-
- for e in events:
- if "tcg-exec" not in e.properties:
- continue
-
- e_args_api = tracetool.vcpu.transform_args(
- "tcg_helper_c", e.original, "header").transform(
- HOST_2_TCG_COMPAT, TCG_2_TCG_HELPER_DEF)
- e_args_call = tracetool.vcpu.transform_args(
- "tcg_helper_c", e, "code")
-
- out('void %(name_tcg)s(%(args_api)s)',
- '{',
- ' %(name)s(%(args_call)s);',
- '}',
- name_tcg="helper_%s_proxy" % e.api(),
- name=e.api(),
- args_api=e_args_api,
- args_call=", ".join(e_args_call.casted()),
- )
diff --git a/qemu/scripts/tracetool/format/tcg_helper_h.py b/qemu/scripts/tracetool/format/tcg_helper_h.py
deleted file mode 100644
index dc76c15eb..000000000
--- a/qemu/scripts/tracetool/format/tcg_helper_h.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""
-Generate trace/generated-helpers.h.
-"""
-
-__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
-__copyright__ = "Copyright 2012-2016, 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
-from tracetool.transform import *
-import tracetool.vcpu
-
-
-def generate(events, backend):
- events = [e for e in events
- if "disable" not in e.properties]
-
- out('/* This file is autogenerated by tracetool, do not edit. */',
- '',
- )
-
- for e in events:
- if "tcg-exec" not in e.properties:
- continue
-
- # TCG helper proxy declaration
- fmt = "DEF_HELPER_FLAGS_%(argc)d(%(name)s, %(flags)svoid%(types)s)"
- e_args = tracetool.vcpu.transform_args("tcg_helper_c", e.original, "header")
- args = e_args.transform(HOST_2_TCG_COMPAT, HOST_2_TCG,
- TCG_2_TCG_HELPER_DECL)
- types = ", ".join(args.types())
- if types != "":
- types = ", " + types
-
- flags = "TCG_CALL_NO_RWG, "
-
- out(fmt,
- flags=flags,
- argc=len(args),
- name=e.api() + "_proxy",
- types=types,
- )
diff --git a/qemu/scripts/tracetool/format/tcg_helper_wrapper_h.py b/qemu/scripts/tracetool/format/tcg_helper_wrapper_h.py
deleted file mode 100644
index 020f4422a..000000000
--- a/qemu/scripts/tracetool/format/tcg_helper_wrapper_h.py
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""
-Generate trace/generated-helpers-wrappers.h.
-"""
-
-__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
-__copyright__ = "Copyright 2012-2016, 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
-from tracetool.transform import *
-import tracetool.vcpu
-
-
-def generate(events, backend):
- events = [e for e in events
- if "disable" not in e.properties]
-
- out('/* This file is autogenerated by tracetool, do not edit. */',
- '',
- '#define tcg_temp_new_nop(v) (v)',
- '#define tcg_temp_free_nop(v)',
- '',
- )
-
- for e in events:
- if "tcg-exec" not in e.properties:
- continue
-
- # tracetool.generate always transforms types to host
- e_args = tracetool.vcpu.transform_args("tcg_helper_c", e.original, "wrapper")
-
- # mixed-type to TCG helper bridge
- args_tcg_compat = e_args.transform(HOST_2_TCG_COMPAT)
-
- code_new = [
- "%(tcg_type)s __%(name)s = %(tcg_func)s(%(name)s);" %
- {"tcg_type": transform_type(type_, HOST_2_TCG),
- "tcg_func": transform_type(type_, HOST_2_TCG_TMP_NEW),
- "name": name}
- for (type_, name) in args_tcg_compat
- ]
-
- code_free = [
- "%(tcg_func)s(__%(name)s);" %
- {"tcg_func": transform_type(type_, HOST_2_TCG_TMP_FREE),
- "name": name}
- for (type_, name) in args_tcg_compat
- ]
-
- gen_name = "gen_helper_" + e.api()
-
- out('static inline void %(name)s(%(args)s)',
- '{',
- ' %(code_new)s',
- ' %(proxy_name)s(%(tmp_names)s);',
- ' %(code_free)s',
- '}',
- name=gen_name,
- args=e_args,
- proxy_name=gen_name + "_proxy",
- code_new="\n ".join(code_new),
- code_free="\n ".join(code_free),
- tmp_names=", ".join(["__%s" % name for _, name in e_args]),
- )
diff --git a/qemu/scripts/tracetool/format/ust_events_c.py b/qemu/scripts/tracetool/format/ust_events_c.py
deleted file mode 100644
index 9967c7a82..000000000
--- a/qemu/scripts/tracetool/format/ust_events_c.py
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""
-trace/generated-ust.c
-"""
-
-__author__ = "Mohamad Gebai <mohamad.gebai@polymtl.ca>"
-__copyright__ = "Copyright 2012, Mohamad Gebai <mohamad.gebai@polymtl.ca>"
-__license__ = "GPL version 2 or (at your option) any later version"
-
-__maintainer__ = "Stefan Hajnoczi"
-__email__ = "stefanha@redhat.com"
-
-
-from tracetool import out
-
-
-def generate(events, backend):
- events = [e for e in events
- if "disabled" not in e.properties]
-
- out('/* This file is autogenerated by tracetool, do not edit. */',
- '',
- '#include "qemu/osdep.h"',
- '',
- '#define TRACEPOINT_DEFINE',
- '#define TRACEPOINT_CREATE_PROBES',
- '',
- '/* If gcc version 4.7 or older is used, LTTng ust gives a warning when compiling with',
- ' -Wredundant-decls.',
- ' */',
- '#pragma GCC diagnostic ignored "-Wredundant-decls"',
- '',
- '#include "generated-ust-provider.h"')
diff --git a/qemu/scripts/tracetool/format/ust_events_h.py b/qemu/scripts/tracetool/format/ust_events_h.py
deleted file mode 100644
index 3e8a7cdf1..000000000
--- a/qemu/scripts/tracetool/format/ust_events_h.py
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""
-trace/generated-ust-provider.h
-"""
-
-__author__ = "Mohamad Gebai <mohamad.gebai@polymtl.ca>"
-__copyright__ = "Copyright 2012, Mohamad Gebai <mohamad.gebai@polymtl.ca>"
-__license__ = "GPL version 2 or (at your option) any later version"
-
-__maintainer__ = "Stefan Hajnoczi"
-__email__ = "stefanha@redhat.com"
-
-
-from tracetool import out
-
-
-def generate(events, backend):
- events = [e for e in events
- if "disabled" not in e.properties]
-
- out('/* This file is autogenerated by tracetool, do not edit. */',
- '',
- '#undef TRACEPOINT_PROVIDER',
- '#define TRACEPOINT_PROVIDER qemu',
- '',
- '#undef TRACEPOINT_INCLUDE_FILE',
- '#define TRACEPOINT_INCLUDE_FILE ./generated-ust-provider.h',
- '',
- '#if !defined (TRACE__GENERATED_UST_H) || defined(TRACEPOINT_HEADER_MULTI_READ)',
- '#define TRACE__GENERATED_UST_H',
- '',
- '#include "qemu-common.h"',
- '#include <lttng/tracepoint.h>',
- '',
- '/*',
- ' * LTTng ust 2.0 does not allow you to use TP_ARGS(void) for tracepoints',
- ' * requiring no arguments. We define these macros introduced in more recent'
- ' * versions of LTTng ust as a workaround',
- ' */',
- '#ifndef _TP_EXPROTO1',
- '#define _TP_EXPROTO1(a) void',
- '#endif',
- '#ifndef _TP_EXDATA_PROTO1',
- '#define _TP_EXDATA_PROTO1(a) void *__tp_data',
- '#endif',
- '#ifndef _TP_EXDATA_VAR1',
- '#define _TP_EXDATA_VAR1(a) __tp_data',
- '#endif',
- '#ifndef _TP_EXVAR1',
- '#define _TP_EXVAR1(a)',
- '#endif',
- '')
-
- for e in events:
- if len(e.args) > 0:
- out('TRACEPOINT_EVENT(',
- ' qemu,',
- ' %(name)s,',
- ' TP_ARGS(%(args)s),',
- ' TP_FIELDS(',
- name=e.name,
- args=", ".join(", ".join(i) for i in e.args))
-
- types = e.args.types()
- names = e.args.names()
- fmts = e.formats()
- for t,n,f in zip(types, names, fmts):
- if ('char *' in t) or ('char*' in t):
- out(' ctf_string(' + n + ', ' + n + ')')
- elif ("%p" in f) or ("x" in f) or ("PRIx" in f):
- out(' ctf_integer_hex('+ t + ', ' + n + ', ' + n + ')')
- elif ("ptr" in t) or ("*" in t):
- out(' ctf_integer_hex('+ t + ', ' + n + ', ' + n + ')')
- elif ('int' in t) or ('long' in t) or ('unsigned' in t) or ('size_t' in t):
- out(' ctf_integer(' + t + ', ' + n + ', ' + n + ')')
- elif ('double' in t) or ('float' in t):
- out(' ctf_float(' + t + ', ' + n + ', ' + n + ')')
- elif ('void *' in t) or ('void*' in t):
- out(' ctf_integer_hex(unsigned long, ' + n + ', ' + n + ')')
-
- out(' )',
- ')',
- '')
-
- else:
- out('TRACEPOINT_EVENT(',
- ' qemu,',
- ' %(name)s,',
- ' TP_ARGS(void),',
- ' TP_FIELDS()',
- ')',
- '',
- name=e.name)
-
- out('#endif /* TRACE__GENERATED_UST_H */',
- '',
- '/* This part must be outside ifdef protection */',
- '#include <lttng/tracepoint-event.h>')