diff options
author | Arjan van de Ven <arjan@infradead.org> | 2009-04-28 12:05:43 +0100 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-06-04 14:07:48 +0000 |
commit | 5e13b98da1e7e31cffba84fd257002357d5f2682 (patch) | |
tree | 0e8a08b7c394c2cf85cfb0701962d6be5c733c92 /tools/intel_gpu_top.c | |
parent | 0521bca629a1d350fd5807516cfa0f3d0fc215de (diff) |
intel_gpu_top:print a visual clue on how big a certain use is
humans are pretty bad at reading percentages quicky; this patch adds a
histogram capability to make it more visually clear as to which lines are
big ticket items
Diffstat (limited to 'tools/intel_gpu_top.c')
-rw-r--r-- | tools/intel_gpu_top.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c index bedef12a..66e61c4c 100644 --- a/tools/intel_gpu_top.c +++ b/tools/intel_gpu_top.c @@ -28,11 +28,14 @@ #include <unistd.h> #include <stdlib.h> #include <stdio.h> +#include <string.h> #include <err.h> #include "intel_gpu_tools.h" #define MAX_NUM_TOP_BITS 100 +int use_stars; + struct top_bit { /* initial setup */ uint32_t *reg; @@ -88,6 +91,11 @@ int main(int argc, char **argv) intel_get_mmio(); uint32_t ring_size; + if (argc > 1) { + if (strcmp(argv[1], "--stars")==0) + use_stars = 1; + } + if (IS_965(devid)) { add_instdone_bit(I965_ROW_0_EU_0_DONE, "Row 0, EU 0"); add_instdone_bit(I965_ROW_0_EU_1_DONE, "Row 0, EU 1"); @@ -192,13 +200,19 @@ int main(int argc, char **argv) total_ring_full / ring_size); printf("%30s %s\n\n", "task", "percent busy"); for (i = 0; i < num_top_bits; i++) { + int j; if (top_bits_sorted[i]->count == 0) break; - printf("%30s: %d%%\n", - top_bits_sorted[i]->name, - top_bits_sorted[i]->count); + printf("%30s: %d%% ", + top_bits_sorted[i]->name, + top_bits_sorted[i]->count); + if (use_stars) { + for (j = 0; j < top_bits_sorted[i]->count / 4; j++) + printf("*"); + } + printf("\n"); top_bits_sorted[i]->count = 0; } } |