aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2023-03-06 10:20:04 +0000
committerPeter Maydell <peter.maydell@linaro.org>2023-03-06 10:20:04 +0000
commitf003dd8d81f7d88f4b1f8802309eaa76f6eb223a (patch)
tree4ec616098c8525977d7e6a5ecca180ac8952cbf0 /scripts
parent2946e1af2704bf6584f57d4e3aec49d1d5f3ecc0 (diff)
parentb6611d8d5c265c138a4a0cc36a2c02d84a768976 (diff)
downloadqemu-f003dd8d81f7d88f4b1f8802309eaa76f6eb223a.zip
qemu-f003dd8d81f7d88f4b1f8802309eaa76f6eb223a.tar.gz
qemu-f003dd8d81f7d88f4b1f8802309eaa76f6eb223a.tar.bz2
Merge tag 'pull-tcg-20230305' of https://gitlab.com/rth7680/qemu into staging
tcg: Merge two sequential labels accel/tcg: Retain prot flags from tlb_fill accel/tcg: Honor TLB_DISCARD_WRITE in atomic_mmu_lookup accel/tcg: Honor TLB_WATCHPOINTS in atomic_mmu_lookup target/sparc: Use tlb_set_page_full include/qemu/cpuid: Introduce xgetbv_low tcg/i386: Mark Win64 call-saved vector regs as reserved tcg: Decode the operand to INDEX_op_mb in dumps Portion of the target/ patchset which eliminates use of tcg_temp_free* Portion of the target/ patchset which eliminates use of tcg_const* # -----BEGIN PGP SIGNATURE----- # # iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmQFNegdHHJpY2hhcmQu # aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV9WsQf+Ljs3WA5lvMPlpaSn # Li35ay/A1f2cU6FYspl81su4/c7Ft9Q8rkPF4K1n1rwuvqR91G25WTQIrw8NFPXZ # VU9GNGQc1qIVYO/hAH3fvgDmPxUF+tJDgT/BTNc1ldy6/v7QM3GWcEy8+O3H9S+K # uj6vIuWke0ukq6ZGmSAZnXEaJFq3HU26mcP4KxDxfIUcezMtDVp6QevqzVxM65aa # pUDh3qtsLGOxIYwthvu6avMQXORBhSB75awCuYH4QPJRpr3ahigcGsCr2gdVAQ8p # R7BbpUUdK5Huos971oouJrt5FwwbVgGEx78eF27sl0H8QMoNhsfyn6PcN8nPENLJ # MZYd+w== # =8goQ # -----END PGP SIGNATURE----- # gpg: Signature made Mon 06 Mar 2023 00:38:00 GMT # gpg: using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F # gpg: issuer "richard.henderson@linaro.org" # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full] # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A 05C0 64DF 38E8 AF7E 215F * tag 'pull-tcg-20230305' of https://gitlab.com/rth7680/qemu: (84 commits) target/xtensa: Avoid tcg_const_i32 target/xtensa: Split constant in bit shift target/xtensa: Use tcg_gen_subfi_i32 in translate_sll target/xtensa: Avoid tcg_const_i32 in translate_l32r target/xtensa: Tidy translate_clamps target/xtensa: Tidy translate_bb target/sparc: Avoid tcg_const_{tl,i32} target/s390x: Split out gen_ri2 target/riscv: Avoid tcg_const_* target/microblaze: Avoid tcg_const_* throughout target/i386: Simplify POPF target/hexagon/idef-parser: Use gen_constant for gen_extend_tcg_width_op target/hexagon/idef-parser: Use gen_tmp for gen_rvalue_pred target/hexagon/idef-parser: Use gen_tmp for gen_pred_assign target/hexagon/idef-parser: Use gen_tmp for LPCFG target/hexagon: Use tcg_constant_* for gen_constant_from_imm docs/devel/tcg-ops: Drop recommendation to free temps tracing: remove transform.py include/exec/gen-icount: Drop tcg_temp_free in gen_tb_start target/tricore: Drop tcg_temp_free ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/tracetool/__init__.py23
-rw-r--r--scripts/tracetool/transform.py168
2 files changed, 0 insertions, 191 deletions
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index 5393c7f..33cf85e 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -18,7 +18,6 @@ import weakref
import tracetool.format
import tracetool.backend
-import tracetool.transform
def error_write(*lines):
@@ -190,18 +189,6 @@ class Arguments:
"""List of argument names casted to their type."""
return ["(%s)%s" % (type_, name) for type_, name in self._args]
- def transform(self, *trans):
- """Return a new Arguments instance with transformed types.
-
- The types in the resulting Arguments instance are transformed according
- to tracetool.transform.transform_type.
- """
- res = []
- for type_, name in self._args:
- res.append((tracetool.transform.transform_type(type_, *trans),
- name))
- return Arguments(res)
-
class Event(object):
"""Event description.
@@ -358,16 +345,6 @@ class Event(object):
fmt = Event.QEMU_TRACE
return fmt % {"name": self.name, "NAME": self.name.upper()}
- def transform(self, *trans):
- """Return a new Event with transformed Arguments."""
- return Event(self.name,
- list(self.properties),
- self.fmt,
- self.args.transform(*trans),
- self.lineno,
- self.filename,
- self)
-
def read_events(fobj, fname):
"""Generate the output for the given (format, backends) pair.
diff --git a/scripts/tracetool/transform.py b/scripts/tracetool/transform.py
deleted file mode 100644
index ea8b277..0000000
--- a/scripts/tracetool/transform.py
+++ /dev/null
@@ -1,168 +0,0 @@
-# -*- coding: utf-8 -*-
-
-"""
-Type-transformation rules.
-"""
-
-__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@redhat.com"
-
-
-def _transform_type(type_, trans):
- if isinstance(trans, str):
- return trans
- elif isinstance(trans, dict):
- if type_ in trans:
- return _transform_type(type_, trans[type_])
- elif None in trans:
- return _transform_type(type_, trans[None])
- else:
- return type_
- elif callable(trans):
- return trans(type_)
- else:
- raise ValueError("Invalid type transformation rule: %s" % trans)
-
-
-def transform_type(type_, *trans):
- """Return a new type transformed according to the given rules.
-
- Applies each of the transformation rules in trans in order.
-
- If an element of trans is a string, return it.
-
- If an element of trans is a function, call it with type_ as its only
- argument.
-
- If an element of trans is a dict, search type_ in its keys. If type_ is
- a key, use the value as a transformation rule for type_. Otherwise, if
- None is a key use the value as a transformation rule for type_.
-
- Otherwise, return type_.
-
- Parameters
- ----------
- type_ : str
- Type to transform.
- trans : list of function or dict
- Type transformation rules.
- """
- if len(trans) == 0:
- raise ValueError
- res = type_
- for t in trans:
- res = _transform_type(res, t)
- return res
-
-
-##################################################
-# tcg -> host
-
-def _tcg_2_host(type_):
- if type_ == "TCGv":
- # force a fixed-size type (target-independent)
- return "uint64_t"
- else:
- return type_
-
-TCG_2_HOST = {
- "TCGv_i32": "uint32_t",
- "TCGv_i64": "uint64_t",
- "TCGv_ptr": "void *",
- None: _tcg_2_host,
- }
-
-
-##################################################
-# host -> host compatible with tcg sizes
-
-HOST_2_TCG_COMPAT = {
- "uint8_t": "uint32_t",
- "uint16_t": "uint32_t",
- }
-
-
-##################################################
-# host/tcg -> tcg
-
-def _host_2_tcg(type_):
- if type_.startswith("TCGv"):
- return type_
- raise ValueError("Don't know how to translate '%s' into a TCG type\n" % type_)
-
-HOST_2_TCG = {
- "uint32_t": "TCGv_i32",
- "uint64_t": "TCGv_i64",
- "void *" : "TCGv_ptr",
- "CPUArchState *": "TCGv_env",
- None: _host_2_tcg,
- }
-
-
-##################################################
-# tcg -> tcg helper definition
-
-def _tcg_2_helper_def(type_):
- if type_ == "TCGv":
- return "target_ulong"
- else:
- return type_
-
-TCG_2_TCG_HELPER_DEF = {
- "TCGv_i32": "uint32_t",
- "TCGv_i64": "uint64_t",
- "TCGv_ptr": "void *",
- None: _tcg_2_helper_def,
- }
-
-
-##################################################
-# tcg -> tcg helper declaration
-
-def _tcg_2_tcg_helper_decl_error(type_):
- raise ValueError("Don't know how to translate type '%s' into a TCG helper declaration type\n" % type_)
-
-TCG_2_TCG_HELPER_DECL = {
- "TCGv" : "tl",
- "TCGv_ptr": "ptr",
- "TCGv_i32": "i32",
- "TCGv_i64": "i64",
- "TCGv_env": "env",
- None: _tcg_2_tcg_helper_decl_error,
- }
-
-
-##################################################
-# host/tcg -> tcg temporal constant allocation
-
-def _host_2_tcg_tmp_new(type_):
- if type_.startswith("TCGv"):
- return "tcg_temp_new_nop"
- raise ValueError("Don't know how to translate type '%s' into a TCG temporal allocation" % type_)
-
-HOST_2_TCG_TMP_NEW = {
- "uint32_t": "tcg_const_i32",
- "uint64_t": "tcg_const_i64",
- "void *" : "tcg_const_ptr",
- None: _host_2_tcg_tmp_new,
- }
-
-
-##################################################
-# host/tcg -> tcg temporal constant deallocation
-
-def _host_2_tcg_tmp_free(type_):
- if type_.startswith("TCGv"):
- return "tcg_temp_free_nop"
- raise ValueError("Don't know how to translate type '%s' into a TCG temporal deallocation" % type_)
-
-HOST_2_TCG_TMP_FREE = {
- "uint32_t": "tcg_temp_free_i32",
- "uint64_t": "tcg_temp_free_i64",
- "void *" : "tcg_temp_free_ptr",
- None: _host_2_tcg_tmp_free,
- }