]> Pileus Git - ~andy/linux/blobdiff - tools/perf/builtin-stat.c
perf diff: Improve the help text
[~andy/linux] / tools / perf / builtin-stat.c
index c6df3770b87e7e69e674cad999b09318394b0478..c70d72003557f17f29345b0f219dc5ca9f572d75 100644 (file)
@@ -357,7 +357,8 @@ static void abs_printout(int counter, double avg)
                        ratio = avg / total;
 
                fprintf(stderr, " # %10.3f IPC  ", ratio);
-       } else if (MATCH_EVENT(HARDWARE, HW_BRANCH_MISSES, counter)) {
+       } else if (MATCH_EVENT(HARDWARE, HW_BRANCH_MISSES, counter) &&
+                       runtime_branches_stats.n != 0) {
                total = avg_stats(&runtime_branches_stats);
 
                if (total)
@@ -365,7 +366,7 @@ static void abs_printout(int counter, double avg)
 
                fprintf(stderr, " # %10.3f %%    ", ratio);
 
-       } else {
+       } else if (runtime_nsecs_stats.n != 0) {
                total = avg_stats(&runtime_nsecs_stats);
 
                if (total)