From 99f79ed8b5907502ffe034aa070334db4cc7dc5d Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Sat, 4 Jun 2011 17:44:24 -0700 Subject: [PATCH] some more debug rollsum info --- clients/go/camput/camput.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/clients/go/camput/camput.go b/clients/go/camput/camput.go index 3ecff66aa..f04b84dc6 100644 --- a/clients/go/camput/camput.go +++ b/clients/go/camput/camput.go @@ -368,6 +368,8 @@ func showSplits() { rs := rollsum.New() n := 0 + lastSplit := map[int]int{} + last := 0 for { c, err := bufr.ReadByte() if err != nil { @@ -379,7 +381,13 @@ func showSplits() { n++ rs.Roll(c) if rs.OnSplit() { - log.Printf("split at %d, bits=%d", n, rs.Bits()) + bits := rs.Bits() + log.Printf("split at %d (after %d), bits=%d", n, n - last, bits) + last = n + for bits, last := range lastSplit { + log.Printf(" since %d = %d", bits, n - last) + } + lastSplit[bits] = n } }