]> git.lizzy.rs Git - plan9front.git/commitdiff
acid: add some debugging aid function for counting kernel image cache page refs
authorcinap_lenrek <cinap_lenrek@felloff.net>
Mon, 24 Feb 2014 21:45:38 +0000 (22:45 +0100)
committercinap_lenrek <cinap_lenrek@felloff.net>
Mon, 24 Feb 2014 21:45:38 +0000 (22:45 +0100)
sys/lib/acid/kernel

index d385248d319d052d6955ed464283b715763a1a15..2f604ab9ea957c481d43ef0924ec244578012d3b 100644 (file)
@@ -28,6 +28,21 @@ defn path(p) {
 
 // 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;