dump-trace: dump timing information
TODO: Showing timing or extended trace information should be configurable with a commandline switch later. Change-Id: I72ac95ddd1d54dfef87f212ec5afa30b2ed9a6ad
This commit is contained in:
@ -56,9 +56,14 @@ int main(int argc, char *argv[])
|
|||||||
igzstream gz_stream;
|
igzstream gz_stream;
|
||||||
ProtoIStream ps(&openStream(argv[1], normal_stream, gz_stream));
|
ProtoIStream ps(&openStream(argv[1], normal_stream, gz_stream));
|
||||||
|
|
||||||
|
uint64_t acctime = 0;
|
||||||
|
|
||||||
while (ps.getNext(&ev)) {
|
while (ps.getNext(&ev)) {
|
||||||
|
if (ev.has_time_delta()) {
|
||||||
|
acctime += ev.time_delta();
|
||||||
|
}
|
||||||
if (!ev.has_memaddr()) {
|
if (!ev.has_memaddr()) {
|
||||||
cout << "IP " << hex << ev.ip() << "\n";
|
cout << "IP " << hex << ev.ip() << dec << " t=" << acctime << "\n";
|
||||||
} else {
|
} else {
|
||||||
string ext = ""; // FIXME: use stringstream?
|
string ext = ""; // FIXME: use stringstream?
|
||||||
if (ev.has_trace_ext()) {
|
if (ev.has_trace_ext()) {
|
||||||
@ -88,6 +93,7 @@ int main(int argc, char *argv[])
|
|||||||
<< ev.memaddr()
|
<< ev.memaddr()
|
||||||
<< dec << " width " << ev.width()
|
<< dec << " width " << ev.width()
|
||||||
<< hex << " IP " << ev.ip()
|
<< hex << " IP " << ev.ip()
|
||||||
|
<< dec << " t=" << acctime
|
||||||
<< ext << "\n";
|
<< ext << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user