diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-08-15 16:37:17 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-08-15 16:37:17 +0100 |
commit | 5c6b3c50cca2106e5fbcbc6efa94c2f8b9d29fd8 (patch) | |
tree | 130b8de581b48b1bf1862b4f5f1e8001955cc47e /scripts/tracetool/format/tcg_helper_h.py | |
parent | f2fb1da9412ae7b4cb512cfbd86c0185f191e2f9 (diff) | |
parent | 4ac4458076e1aaf3b01a6361154117df20e22215 (diff) | |
download | qemu-5c6b3c50cca2106e5fbcbc6efa94c2f8b9d29fd8.tar.gz |
Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
Tracing pull request
* remotes/stefanha/tags/tracing-pull-request:
virtio-rng: add some trace events
trace: add some tcg tracing support
trace: teach lttng backend to use format strings
trace: [tcg] Include TCG-tracing header on all targets
trace: [tcg] Include event definitions in "trace.h"
trace: [tcg] Generate TCG tracing routines
trace: [tcg] Include TCG-tracing helpers
trace: [tcg] Define TCG tracing helper routine wrappers
trace: [tcg] Define TCG tracing helper routines
trace: [tcg] Declare TCG tracing helper routines
trace: [tcg] Add 'tcg' event property
trace: [tcg] Argument type transformation machinery
trace: [tcg] Argument type transformation rules
trace: [tcg] Add documentation
trace: install simpletrace SystemTap tapset
simpletrace: add simpletrace.py --no-header option
trace: add tracetool simpletrace_stap format
trace: extract stap_escape() function for reuse
Conflicts:
Makefile.objs
Diffstat (limited to 'scripts/tracetool/format/tcg_helper_h.py')
-rw-r--r-- | scripts/tracetool/format/tcg_helper_h.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/scripts/tracetool/format/tcg_helper_h.py b/scripts/tracetool/format/tcg_helper_h.py new file mode 100644 index 0000000000..a8ba7ba8e3 --- /dev/null +++ b/scripts/tracetool/format/tcg_helper_h.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +Generate trace/generated-helpers.h. +""" + +__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.transform import * + + +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 + + # tracetool.generate always transforms types to host + e_args = e.original.args + + # TCG helper proxy declaration + fmt = "DEF_HELPER_FLAGS_%(argc)d(%(name)s, %(flags)svoid%(types)s)" + 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, + ) |