Index: sys/kern/kern_ktr.c =================================================================== --- sys/kern/kern_ktr.c (revision 229932) +++ sys/kern/kern_ktr.c (working copy) @@ -256,6 +256,8 @@ cpu = KTR_CPU; if (!CPU_ISSET(cpu, &ktr_cpumask)) return; + if (strcmp(curthread->td_name, "fsck_ufs")) + return; #if defined(KTR_VERBOSE) || defined(KTR_ALQ) td = curthread; if (td->td_pflags & TDP_INKTR) Index: sys/vm/vm_radix.c =================================================================== --- sys/vm/vm_radix.c (revision 229932) +++ sys/vm/vm_radix.c (working copy) @@ -218,6 +218,8 @@ c = (uintptr_t)child; + CTR3(KTR_FLO, "match: child %p, color %d, ret %jx", + child, color, (uintmax_t)(c & ~VM_RADIX_FLAGS)); if ((c & color) == 0) return (NULL); return ((void *)(c & ~VM_RADIX_FLAGS)); @@ -430,10 +432,16 @@ int level; start = *startp; + CTR3(KTR_FLO, "leaf: tree %p, start %ju, end %ju", + rtree, (uintmax_t)*startp, (uintmax_t)end); restart: level = vm_radix_height(rtree, &rnode); + CTR4(KTR_FLO, "leaf: tree %p, start %ju, end %ju, level %d", + rtree, (uintmax_t)*startp, (uintmax_t)end, level); if (start > VM_RADIX_MAX(level) || (end && start >= end)) { rnode = NULL; + CTR3(KTR_FLO, "leaf: exit start %ju, end %ju, level %d", + (uintmax_t)start, (uintmax_t)end, level); goto out; } /* @@ -442,12 +450,15 @@ */ for (level--; level; level--) { slot = vm_radix_slot(start, level); - CTR6(KTR_VM, + CTR6(KTR_FLO, "leaf: tree %p, index %ju, level %d, slot %d, rnode %p, child %p", rtree, (uintmax_t)start, level, slot, rnode, (rnode != NULL) ? rnode->rn_child[slot] : NULL); if (rnode->rn_child[slot] != NULL) { rnode = rnode->rn_child[slot]; + CTR4(KTR_FLO, + "leaf: continuing start %ju, end %ju, slot %d, rnode %p", + (uintmax_t)start, (uintmax_t)end, slot, rnode); continue; } /* @@ -460,22 +471,33 @@ start &= ~VM_RADIX_MAX(level); start += inc; slot++; - CTR5(KTR_VM, + CTR5(KTR_FLO, "leaf: start %ju end %ju inc %d mask 0x%lX slot %d", (uintmax_t)start, (uintmax_t)end, inc, ~VM_RADIX_MAX(level), slot); for (; slot < VM_RADIX_COUNT; slot++, start += inc) { if (end != 0 && start >= end) { rnode = NULL; + CTR3(KTR_FLO, + "leaf: exit start %ju, end %ju, slot %d", + (uintmax_t)start, (uintmax_t)end, slot); goto out; } if (rnode->rn_child[slot]) { rnode = rnode->rn_child[slot]; + CTR4(KTR_FLO, + "leaf: exit start %ju, end %ju, slot %d, rnode %p", + (uintmax_t)start, (uintmax_t)end, slot, + rnode); break; } } - if (slot == VM_RADIX_COUNT) + if (slot == VM_RADIX_COUNT) { + CTR4(KTR_FLO, + "leaf: exit start %ju, end %ju, slot %d, level %d", + (uintmax_t)start, (uintmax_t)end, slot, level); goto restart; + } } out: @@ -499,28 +521,49 @@ int slot; int outidx; - CTR3(KTR_VM, "lookupn: tree %p, start %ju, end %ju", + CTR3(KTR_FLO, "lookupn: tree %p, start %ju, end %ju", rtree, (uintmax_t)start, (uintmax_t)end); - if (rtree->rt_root == 0) + if (rtree->rt_root == 0) { + CTR0(KTR_FLO, "lookupn: return with rt_root 0"); return (0); + } outidx = 0; while ((rnode = vm_radix_leaf(rtree, &start, end)) != NULL) { slot = vm_radix_slot(start, 0); + CTR2(KTR_FLO, "lookupn: rnode %p with slot %d found on leaf", + rnode, slot); for (; slot < VM_RADIX_COUNT; slot++, start++) { - if (end != 0 && start >= end) + if (end != 0 && start >= end) { + CTR3(KTR_FLO, + "lookupn: exit start %ju, end %ju, slot %d", + (uintmax_t)start, (uintmax_t)end, slot); goto out; + } val = vm_radix_match(rnode->rn_child[slot], color); - if (val == NULL) + if (val == NULL) { + CTR3(KTR_FLO, + "lookupn: continuing start %ju, end %ju, slot %d", + (uintmax_t)start, (uintmax_t)end, slot); continue; - CTR4(KTR_VM, + } + CTR4(KTR_FLO, "lookupn: tree %p index %ju slot %d found child %p", rtree, (uintmax_t)start, slot, val); out[outidx] = val; - if (++outidx == cnt) + if (++outidx == cnt) { + CTR4(KTR_FLO, + "lookupn: exit start %ju, end %ju, slot %d, outidx %d", + (uintmax_t)start, (uintmax_t)end, slot, + outidx); goto out; + } } - if (end != 0 && start >= end) + if (end != 0 && start >= end) { + CTR4(KTR_FLO, + "lookupn: exit start %ju, end %ju, slot %d, outidx %d", + (uintmax_t)start, (uintmax_t)end, slot, outidx); break; + } } out: *next = start; @@ -535,19 +578,33 @@ void *val; int slot; - if (rtree->rt_root == 0) + CTR3(KTR_FLO, "foreach: tree %p, start %ju, end %ju", + rtree, (uintmax_t)start, (uintmax_t)end); + if (rtree->rt_root == 0) { + CTR0(KTR_FLO, "foreach: return with rt_root 0"); return; + } while ((rnode = vm_radix_leaf(rtree, &start, end)) != NULL) { slot = vm_radix_slot(start, 0); + CTR2(KTR_FLO, "foreach: rnode %p with slot %d found on leaf", + rnode, slot); for (; slot < VM_RADIX_COUNT; slot++, start++) { - if (end != 0 && start >= end) + if (end != 0 && start >= end) { + CTR3(KTR_FLO, + "foreach: exit start %ju, end %ju, slot %d", + (uintmax_t)start, (uintmax_t)end, slot); return; + } val = vm_radix_match(rnode->rn_child[slot], color); if (val) iter(val); } - if (end != 0 && start >= end) + if (end != 0 && start >= end) { + CTR3(KTR_FLO, + "foreach: exit start %ju, end %ju, slot %d", + (uintmax_t)start, (uintmax_t)end, slot); return; + } } } Index: sys/sys/ktr.h =================================================================== --- sys/sys/ktr.h (revision 229932) +++ sys/sys/ktr.h (working copy) @@ -75,6 +75,7 @@ #define KTR_INET6 0x10000000 /* IPv6 stack */ #define KTR_SCHED 0x20000000 /* Machine parsed sched info. */ #define KTR_BUF 0x40000000 /* Buffer cache */ +#define KTR_FLO 0x80000000 /* Test */ #define KTR_ALL 0x7fffffff /* Trace classes to compile in */