shithub: riscv

Download patch

ref: 5e353e17c6d4410487bc33aaa07fdb3121962c16
parent: c29719ce841be56ed8486697433f6059011c63ee
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Feb 24 17:45:38 EST 2014

acid: add some debugging aid function for counting kernel image cache page refs

--- a/sys/lib/acid/kernel
+++ b/sys/lib/acid/kernel
@@ -28,6 +28,21 @@
 
 // print Image cache contents
 IHASHSIZE = 64;
+
+defn imagepagerefs(i) {
+	local p, n;
+
+	n = 0;
+	p = palloc.$tail;
+	while p != 0 && p.image != 0 do {
+		if p.image == i then {
+			n = n + 1;
+		}
+		p = p.prev;
+	}
+	return n;
+}
+
 defn imagecacheline(h) {
 	local d, p, q;