dump-trace.py: update after trace.proto relocation
Change-Id: I4f4b9870cdbe9b81338dde76453755700e6fea94
This commit is contained in:
2
tools/dump-trace/.gitignore
vendored
2
tools/dump-trace/.gitignore
vendored
@ -1 +1 @@
|
|||||||
trace_pb2.py
|
TracePlugin_pb2.py{,c}
|
||||||
|
|||||||
@ -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 $<` $<
|
||||||
|
|||||||
@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user