Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d73269ff authored by Shiraz Hashim's avatar Shiraz Hashim Committed by Matt Wagantall
Browse files

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: default avatarShiraz Hashim <shashim@codeaurora.org>
parent bbd7ba58
Loading
Loading
Loading
Loading
+24 −13
Original line number Diff line number Diff line
@@ -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
@@ -404,15 +404,14 @@ 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;
	}

	}

	for (i = 0; i < num_orders; i++) {
		struct ion_page_pool *pool = sys_heap->cached_pools[i];
		if (use_seq) {
@@ -425,17 +424,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;
	}
	}

	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;
}