mirror of
https://github.com/qemu/qemu.git
synced 2026-05-21 07:37:14 +00:00
tracing: excise the tcg related from tracetool
Now we have no TCG trace events and no longer handle them in the code we can remove the handling from the tracetool to generate them. vcpu tracing is still available although the existing syscall event is an exercise in redundancy (plugins and -strace can also get the information). Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Cc: Luis Vilanova <vilanova@imperial.ac.uk> Cc: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20220204204335.1689602-21-alex.bennee@linaro.org>
This commit is contained in:
@@ -87,8 +87,6 @@ ALLOWED_TYPES = [
|
||||
"ssize_t",
|
||||
"uintptr_t",
|
||||
"ptrdiff_t",
|
||||
# Magic substitution is done by tracetool
|
||||
"TCGv",
|
||||
]
|
||||
|
||||
def validate_type(name):
|
||||
@@ -232,7 +230,7 @@ class Event(object):
|
||||
"(?:(?:(?P<fmt_trans>\".+),)?\s*(?P<fmt>\".+))?"
|
||||
"\s*")
|
||||
|
||||
_VALID_PROPS = set(["disable", "tcg", "tcg-trans", "tcg-exec", "vcpu"])
|
||||
_VALID_PROPS = set(["disable", "vcpu"])
|
||||
|
||||
def __init__(self, name, props, fmt, args, lineno, filename, orig=None,
|
||||
event_trans=None, event_exec=None):
|
||||
@@ -321,15 +319,6 @@ class Event(object):
|
||||
fmt = [fmt_trans, fmt]
|
||||
args = Arguments.build(groups["args"])
|
||||
|
||||
if "tcg-trans" in props:
|
||||
raise ValueError("Invalid property 'tcg-trans'")
|
||||
if "tcg-exec" in props:
|
||||
raise ValueError("Invalid property 'tcg-exec'")
|
||||
if "tcg" not in props and not isinstance(fmt, str):
|
||||
raise ValueError("Only events with 'tcg' property can have two format strings")
|
||||
if "tcg" in props and isinstance(fmt, str):
|
||||
raise ValueError("Events with 'tcg' property must have two format strings")
|
||||
|
||||
event = Event(name, props, fmt, args, lineno, filename)
|
||||
|
||||
# add implicit arguments when using the 'vcpu' property
|
||||
@@ -409,33 +398,7 @@ def read_events(fobj, fname):
|
||||
e.args = (arg0,) + e.args[1:]
|
||||
raise
|
||||
|
||||
# transform TCG-enabled events
|
||||
if "tcg" not in event.properties:
|
||||
events.append(event)
|
||||
else:
|
||||
event_trans = event.copy()
|
||||
event_trans.name += "_trans"
|
||||
event_trans.properties += ["tcg-trans"]
|
||||
event_trans.fmt = event.fmt[0]
|
||||
# ignore TCG arguments
|
||||
args_trans = []
|
||||
for atrans, aorig in zip(
|
||||
event_trans.transform(tracetool.transform.TCG_2_HOST).args,
|
||||
event.args):
|
||||
if atrans == aorig:
|
||||
args_trans.append(atrans)
|
||||
event_trans.args = Arguments(args_trans)
|
||||
|
||||
event_exec = event.copy()
|
||||
event_exec.name += "_exec"
|
||||
event_exec.properties += ["tcg-exec"]
|
||||
event_exec.fmt = event.fmt[1]
|
||||
event_exec.args = event_exec.args.transform(tracetool.transform.TCG_2_HOST)
|
||||
|
||||
new_event = [event_trans, event_exec]
|
||||
event.event_trans, event.event_exec = new_event
|
||||
|
||||
events.extend(new_event)
|
||||
events.append(event)
|
||||
|
||||
return events
|
||||
|
||||
|
||||
Reference in New Issue
Block a user