diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-11-18 15:05:36 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-11-18 15:05:36 +0000 |
commit | b1b1e81fb51965bb53be3d58d3dd9b3b3aa17242 (patch) | |
tree | ce7f2c51e2798d2177b9d617561fbd154312e7b3 | |
parent | 1ab8f867ef2ef0aa259e0e0d1040d67350af1bec (diff) | |
parent | 776ec96f790e2c943c13313d8ecab4713b47ab65 (diff) |
Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging
# gpg: Signature made Tue 18 Nov 2014 15:04:14 GMT using RSA key ID 81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>"
* remotes/stefanha/tags/tracing-pull-request:
Tracing: Fix simpletrace.py error on tcg enabled binary traces
Tracing docs fix configure option and description
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | docs/tracing.txt | 6 | ||||
-rw-r--r-- | scripts/tracetool/__init__.py | 67 |
2 files changed, 36 insertions, 37 deletions
diff --git a/docs/tracing.txt b/docs/tracing.txt index 7d38926394..7117c5e7d6 100644 --- a/docs/tracing.txt +++ b/docs/tracing.txt @@ -139,12 +139,12 @@ events are not tightly coupled to a specific trace backend, such as LTTng or SystemTap. Support for trace backends can be added by extending the "tracetool" script. -The trace backend is chosen at configure time and only one trace backend can -be built into the binary: +The trace backends are chosen at configure time: - ./configure --trace-backends=simple + ./configure --enable-trace-backends=simple For a list of supported trace backends, try ./configure --help or see below. +If multiple backends are enabled, the trace is sent to them all. The following subsections describe the supported trace backends. diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index 3d5743f93e..181675f00e 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -253,14 +253,44 @@ class Event(object): def _read_events(fobj): - res = [] + events = [] for line in fobj: if not line.strip(): continue if line.lstrip().startswith('#'): continue - res.append(Event.build(line)) - return res + + event = Event.build(line) + + # 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] + 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_trans = event_trans.copy() + + event_exec = event.copy() + event_exec.name += "_exec" + event_exec.properties += ["tcg-exec"] + event_exec.fmt = event.fmt[1] + event_exec = event_exec.transform(tracetool.transform.TCG_2_HOST) + + new_event = [event_trans, event_exec] + event.event_trans, event.event_exec = new_event + + events.extend(new_event) + + return events class TracetoolError (Exception): @@ -333,35 +363,4 @@ def generate(fevents, format, backends, events = _read_events(fevents) - # transform TCG-enabled events - new_events = [] - for event in events: - if "tcg" not in event.properties: - new_events.append(event) - else: - event_trans = event.copy() - event_trans.name += "_trans" - event_trans.properties += ["tcg-trans"] - event_trans.fmt = event.fmt[0] - 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_trans = event_trans.copy() - - event_exec = event.copy() - event_exec.name += "_exec" - event_exec.properties += ["tcg-exec"] - event_exec.fmt = event.fmt[1] - event_exec = event_exec.transform(tracetool.transform.TCG_2_HOST) - - new_event = [event_trans, event_exec] - event.event_trans, event.event_exec = new_event - - new_events.extend(new_event) - events = new_events - tracetool.format.generate(events, format, backend) |