mirror of https://gitee.com/openkylin/qemu.git
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1 iQEcBAABAgAGBQJUa1/uAAoJEJykq7OBq3PIcokIAJorNG+l0M3mbOkCyK2DdrLf 6UltWLIDKqxiKubI/2mj0ESjspo803AGQEpUMbT8Ptyq3HMQegZ0io3T5q+v63+q HIsYmXjcorkfvmJTQGT6FePz+uuo+lkZn1AM001Yexadn3K1OraLI7D4m6WqbAT3 bagAwv6CvwCp35UHG7eCtOCj5XIZXatxJr4Sq+flFYr1KCHGzPz0KHsVA+Gu7MIs VeSnp6kq9NF/bPAmJjJCKSqjUCruShcyXeB+FVeiAeHHCcupCHQQy2dH0MgxK1uj 19OLbBidpvK2+K+SJ5p/rGVKbtm9LHsWXQpIn3YnTuSY39lNQAJ5NZFspzJdjO8= =5Csa -----END PGP SIGNATURE----- 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>
This commit is contained in:
commit
b1b1e81fb5
|
@ -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"
|
SystemTap. Support for trace backends can be added by extending the "tracetool"
|
||||||
script.
|
script.
|
||||||
|
|
||||||
The trace backend is chosen at configure time and only one trace backend can
|
The trace backends are chosen at configure time:
|
||||||
be built into the binary:
|
|
||||||
|
|
||||||
./configure --trace-backends=simple
|
./configure --enable-trace-backends=simple
|
||||||
|
|
||||||
For a list of supported trace backends, try ./configure --help or see below.
|
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.
|
The following subsections describe the supported trace backends.
|
||||||
|
|
||||||
|
|
|
@ -253,14 +253,44 @@ def transform(self, *trans):
|
||||||
|
|
||||||
|
|
||||||
def _read_events(fobj):
|
def _read_events(fobj):
|
||||||
res = []
|
events = []
|
||||||
for line in fobj:
|
for line in fobj:
|
||||||
if not line.strip():
|
if not line.strip():
|
||||||
continue
|
continue
|
||||||
if line.lstrip().startswith('#'):
|
if line.lstrip().startswith('#'):
|
||||||
continue
|
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):
|
class TracetoolError (Exception):
|
||||||
|
@ -333,35 +363,4 @@ def generate(fevents, format, backends,
|
||||||
|
|
||||||
events = _read_events(fevents)
|
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)
|
tracetool.format.generate(events, format, backend)
|
||||||
|
|
Loading…
Reference in New Issue