Files
fail/core/plugins/tracing/dump-trace.py
hsc b70b6fb43a another directory rename: failstar -> fail
"failstar" sounds like a name for a cruise liner from the 80s.  As "*" isn't a
desirable part of directory names, just name the whole thing "fail/", the core
parts being stored in "fail/core/".

Additionally fixing two build system dependency issues:
 - missing jobserver -> protomessages dependency
 - broken bochs -> fail dependency (add_custom_target DEPENDS only allows plain
   file dependencies ... cmake for the win)


git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@956 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
2012-03-08 19:43:02 +00:00

35 lines
814 B
Python
Executable File

#! /usr/bin/env python
# create python bindings before running:
# protoc --python_out=. trace.proto
import trace_pb2
import sys
if len(sys.argv) != 2:
print "Usage:", sys.argv[0], "tracefile.pb"
sys.exit(-1)
trace = trace_pb2.Trace()
# Read trace
try:
f = open(sys.argv[1], "rb")
trace.ParseFromString(f.read())
f.close()
except IOError:
print sys.argv[1] + ": Could not open file."
sys.exit(-1)
# This works for any type of pb message:
#print trace
# More compact dump for traces:
for event in trace.event:
if not event.HasField("memaddr"):
print "IP {0:x}".format(event.ip)
else:
print "MEM {0} {1:x} width {2:d} IP {3:x}".format(
"R" if event.accesstype == trace_pb2.Trace.Event.READ else "W",
event.memaddr, event.width, event.ip)