dump-trace: extended trace information dump configurable
This adds the same --extended-trace commandline switch as import-trace has. Change-Id: I9c13df7b1df0f48ceeb7d1ebfa1a3ad45684c6a8
This commit is contained in:
@ -55,6 +55,9 @@ int main(int argc, char *argv[])
|
|||||||
CommandLine::option_handle STATS =
|
CommandLine::option_handle STATS =
|
||||||
cmd.addOption("s", "stats", Arg::None,
|
cmd.addOption("s", "stats", Arg::None,
|
||||||
"-s/--stats \tShow trace stats");
|
"-s/--stats \tShow trace stats");
|
||||||
|
CommandLine::option_handle EXTENDED_TRACE =
|
||||||
|
cmd.addOption("", "extended-trace", Arg::None,
|
||||||
|
"--extended-trace \tDump extended trace information if available");
|
||||||
|
|
||||||
for (int i = 1; i < argc; ++i) {
|
for (int i = 1; i < argc; ++i) {
|
||||||
cmd.add_args(argv[i]);
|
cmd.add_args(argv[i]);
|
||||||
@ -73,10 +76,8 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool stats_only = false;
|
bool stats_only = cmd[STATS];
|
||||||
if (cmd[STATS]) {
|
bool extended = cmd[EXTENDED_TRACE];
|
||||||
stats_only = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::ifstream normal_stream;
|
std::ifstream normal_stream;
|
||||||
igzstream gz_stream;
|
igzstream gz_stream;
|
||||||
@ -99,7 +100,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stringstream ext;
|
stringstream ext;
|
||||||
if (ev.has_trace_ext() && !stats_only) {
|
if (ev.has_trace_ext() && !stats_only && extended) {
|
||||||
const Trace_Event_Extended& temp_ext = ev.trace_ext();
|
const Trace_Event_Extended& temp_ext = ev.trace_ext();
|
||||||
ext << " DATA " << std::hex;
|
ext << " DATA " << std::hex;
|
||||||
ext << (uint64_t) temp_ext.data();
|
ext << (uint64_t) temp_ext.data();
|
||||||
|
|||||||
Reference in New Issue
Block a user