diff options
-rw-r--r-- | tools/intel_gpu_mem_top.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/intel_gpu_mem_top.c b/tools/intel_gpu_mem_top.c index 75132c0b..02418a09 100644 --- a/tools/intel_gpu_mem_top.c +++ b/tools/intel_gpu_mem_top.c @@ -73,18 +73,19 @@ static int compare(const void *a, const void *b) struct proc_mem_stats *stat_b = (struct proc_mem_stats *)b; if (stat_a->in_use < stat_b->in_use) - return -1; + return 1; else if (stat_a->in_use == stat_b->in_use) return 0; else - return 1; + return -1; } static void print_stats(void) { qsort(stats, next_stats + 1, sizeof(stats[0]), compare); - + + printf("Top GPU mem usage:\n"); for (int i = 0; i < 128; i++) { if (strncmp(stats[i].name, "\0", 1) == 0) break; |