ptxed: only compute stats when requested
Statistics are currently computed whether or not --stat is specified. The
option only affects printing statistics at the end.
Do not compute stats if we don't want to print them.
Change-Id: I77e8d6ab4be60b62e706714e6429d1759b83eb44
Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
diff --git a/ptxed/src/ptxed.c b/ptxed/src/ptxed.c
index a7f2607..3fe5aac 100644
--- a/ptxed/src/ptxed.c
+++ b/ptxed/src/ptxed.c
@@ -1342,7 +1342,8 @@
xed_tables_init();
- decode(&decoder, iscache, &options, &stats);
+ decode(&decoder, iscache, &options,
+ options.print_stats ? &stats : NULL);
if (options.print_stats)
print_stats(&stats);