git: 9front

Download patch

ref: 96985d0bf8d0f0d5cebfa9e7671ea887f2bc67bc
parent: c68d3882ea892bc421119be4f7009f765ccad598
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;
 
--