ion: add debug log to clearly account memory held in pools

Presently ion debug interface provides total memory held
in system heap for cached and uncached pool corresponding
to per page order list. Add additional logs to also print
total cumulative bytes held together in these pools so
that it can be accounted easily.

Change-Id: I07dbc45fa99870904cca9b2067b371f4d7247ec5
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
This commit is contained in:
Shiraz Hashim 2015-02-23 16:04:11 +05:30 committed by David Keitel
parent 5cd0d2091e
commit 910d8c50d2

View file

@ -2,7 +2,7 @@
* drivers/staging/android/ion/ion_system_heap.c
*
* Copyright (C) 2011 Google, Inc.
* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@ -414,13 +414,12 @@ static int ion_system_heap_debug_show(struct ion_heap *heap, struct seq_file *s,
pool->low_count, pool->order,
(1 << pool->order) * PAGE_SIZE *
pool->low_count);
} else {
uncached_total += (1 << pool->order) * PAGE_SIZE *
pool->high_count;
uncached_total += (1 << pool->order) * PAGE_SIZE *
pool->low_count;
}
uncached_total += (1 << pool->order) * PAGE_SIZE *
pool->high_count;
uncached_total += (1 << pool->order) * PAGE_SIZE *
pool->low_count;
}
for (i = 0; i < num_orders; i++) {
@ -435,17 +434,29 @@ static int ion_system_heap_debug_show(struct ion_heap *heap, struct seq_file *s,
pool->low_count, pool->order,
(1 << pool->order) * PAGE_SIZE *
pool->low_count);
} else {
cached_total += (1 << pool->order) * PAGE_SIZE *
pool->high_count;
cached_total += (1 << pool->order) * PAGE_SIZE *
pool->low_count;
}
cached_total += (1 << pool->order) * PAGE_SIZE *
pool->high_count;
cached_total += (1 << pool->order) * PAGE_SIZE *
pool->low_count;
}
if (!use_seq)
pr_info("uncached pool total = %lu cached pool total %lu\n",
if (use_seq) {
seq_puts(s, "--------------------------------------------\n");
seq_printf(s, "uncached pool = %lu cached pool = %lu\n",
uncached_total, cached_total);
seq_printf(s, "pool total (uncached + cached) = %lu\n",
uncached_total + cached_total);
seq_puts(s, "--------------------------------------------\n");
} else {
pr_info("-------------------------------------------------\n");
pr_info("uncached pool = %lu cached pool = %lu\n",
uncached_total, cached_total);
pr_info("pool total (uncached + cached) = %lu\n",
uncached_total + cached_total);
pr_info("-------------------------------------------------\n");
}
return 0;
}