summaryrefslogtreecommitdiff
path: root/tools/intel_gpu_top.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-02-25 12:48:00 -0800
committerEric Anholt <eric@anholt.net>2010-02-25 12:48:00 -0800
commitbcaea4da8997ce09d580df351ae7919832882fc5 (patch)
tree39b70f053c579b1df56f3c64cf70b5f824bc8523 /tools/intel_gpu_top.c
parent9271e2256d7e86989587b001715fccc30400180e (diff)
intel_gpu_top: Print stats lines even when there's no done bit on the line.
Diffstat (limited to 'tools/intel_gpu_top.c')
-rw-r--r--tools/intel_gpu_top.c14
1 files 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");