From bcaea4da8997ce09d580df351ae7919832882fc5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 25 Feb 2010 12:48:00 -0800 Subject: [PATCH] intel_gpu_top: Print stats lines even when there's no done bit on the line. --- tools/intel_gpu_top.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c index 769777b2..3ddbd387 100644 --- a/tools/intel_gpu_top.c +++ b/tools/intel_gpu_top.c @@ -375,18 +375,17 @@ int main(int argc, char **argv) printf("%30s %s\n\n", "task", "percent busy"); for (i = 0; i < num_instdone_bits; i++) { - if (top_bits_sorted[i]->count < 1) - break; - - if (i < max_lines) { - percent = top_bits_sorted[i]->count / SAMPLES_TO_PERCENT_RATIO; + if (top_bits_sorted[i]->count > 0 && i < max_lines) { + percent = top_bits_sorted[i]->count / + SAMPLES_TO_PERCENT_RATIO; len = printf("%30s: %3d%%: ", top_bits_sorted[i]->bit->name, percent); print_percentage_bar (percent, len); + } else { + printf("%*s", PERCENTAGE_BAR_END, ""); } - if (i < STATS_COUNT && (IS_GEN4(devid) || IS_GEN6(devid))) { printf("%13s: %llu (%lld/sec)", @@ -394,6 +393,9 @@ int main(int argc, char **argv) stats[i], stats[i] - last_stats[i]); last_stats[i] = stats[i]; + } else { + if (!top_bits_sorted[i]->count) + break; } printf("\n");