dump-trace.py: update after trace.proto relocation

Change-Id: I4f4b9870cdbe9b81338dde76453755700e6fea94
This commit is contained in:
Horst Schirmeier
2013-04-03 18:22:05 +02:00
parent 0654967f39
commit 84559fe467
3 changed files with 5 additions and 7 deletions

View File

@ -1 +1 @@
trace_pb2.py TracePlugin_pb2.py{,c}

View File

@ -1,4 +1,2 @@
all: trace_pb2.py TracePlugin_pb2.py: ../../src/core/comm/TracePlugin.proto
trace_pb2.py: ../../src/plugins/tracing/trace.proto
protoc --python_out=. --proto_path `dirname $<` $< protoc --python_out=. --proto_path `dirname $<` $<

View File

@ -3,7 +3,7 @@
# create python bindings before running: # create python bindings before running:
# protoc --python_out=. trace.proto # protoc --python_out=. trace.proto
import trace_pb2 import TracePlugin_pb2
import sys import sys
import struct import struct
from gzip import GzipFile from gzip import GzipFile
@ -12,7 +12,7 @@ if len(sys.argv) != 2:
print "Usage:", sys.argv[0], "tracefile.pb" print "Usage:", sys.argv[0], "tracefile.pb"
sys.exit(-1) sys.exit(-1)
trace_event = trace_pb2.Trace_Event() trace_event = TracePlugin_pb2.Trace_Event()
def open_trace(filename): def open_trace(filename):
f = open(filename, "rb") f = open(filename, "rb")
@ -56,7 +56,7 @@ while True:
if len(trace_event.trace_ext.stack) > 0: if len(trace_event.trace_ext.stack) > 0:
ext += " STACK: " + "".join(["%x"%x for x in trace_event.trace_ext.stack]) ext += " STACK: " + "".join(["%x"%x for x in trace_event.trace_ext.stack])
print "MEM {0} {1:x} width {2:d} IP {3:x} {4}".format( print "MEM {0} {1:x} width {2:d} IP {3:x} {4}".format(
"R" if trace_event.accesstype == trace_pb2.Trace_Event.READ else "W", "R" if trace_event.accesstype == trace_event.READ else "W",
trace_event.memaddr, trace_event.width, trace_event.ip, ext) trace_event.memaddr, trace_event.width, trace_event.ip, ext)
f.close() f.close()