Skip to content

Commit

Permalink
tracing: excise the tcg related from tracetool
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
stsquad committed Feb 9, 2022
1 parent d201cf7 commit 126d412
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 350 deletions.
2 changes: 0 additions & 2 deletions include/exec/helper-gen.h
Expand Up @@ -79,8 +79,6 @@ static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) \
}

#include "helper.h"
#include "trace/generated-helpers.h"
#include "trace/generated-helpers-wrappers.h"
#include "accel/tcg/tcg-runtime.h"
#include "accel/tcg/plugin-helpers.h"

Expand Down
4 changes: 0 additions & 4 deletions meson.build
Expand Up @@ -2357,19 +2357,15 @@ tracetool_depends = files(
'scripts/tracetool/backend/simple.py',
'scripts/tracetool/backend/syslog.py',
'scripts/tracetool/backend/ust.py',
'scripts/tracetool/format/tcg_h.py',
'scripts/tracetool/format/ust_events_c.py',
'scripts/tracetool/format/ust_events_h.py',
'scripts/tracetool/format/__init__.py',
'scripts/tracetool/format/d.py',
'scripts/tracetool/format/tcg_helper_c.py',
'scripts/tracetool/format/simpletrace_stap.py',
'scripts/tracetool/format/c.py',
'scripts/tracetool/format/h.py',
'scripts/tracetool/format/tcg_helper_h.py',
'scripts/tracetool/format/log_stap.py',
'scripts/tracetool/format/stap.py',
'scripts/tracetool/format/tcg_helper_wrapper_h.py',
'scripts/tracetool/__init__.py',
'scripts/tracetool/transform.py',
'scripts/tracetool/vcpu.py'
Expand Down
41 changes: 2 additions & 39 deletions scripts/tracetool/__init__.py
Expand Up @@ -87,8 +87,6 @@ def out(*lines, **kwargs):
"ssize_t",
"uintptr_t",
"ptrdiff_t",
# Magic substitution is done by tracetool
"TCGv",
]

def validate_type(name):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -321,15 +319,6 @@ def build(line_str, lineno, filename):
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
Expand Down Expand Up @@ -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

Expand Down
83 changes: 0 additions & 83 deletions scripts/tracetool/format/tcg_h.py

This file was deleted.

79 changes: 0 additions & 79 deletions scripts/tracetool/format/tcg_helper_c.py

This file was deleted.

48 changes: 0 additions & 48 deletions scripts/tracetool/format/tcg_helper_h.py

This file was deleted.

70 changes: 0 additions & 70 deletions scripts/tracetool/format/tcg_helper_wrapper_h.py

This file was deleted.

0 comments on commit 126d412

Please sign in to comment.