From: Amelia Downs Date: Thu, 30 Sep 2021 15:35:30 +0000 (-0400) Subject: internal/fuzz: print size of interesting cache X-Git-Tag: go1.18beta1~1075 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e8a85e90aca4adb472c66f8c42f6d4a41b8cca99;p=gostls13.git internal/fuzz: print size of interesting cache This change updates the log lines to clarify that the printed interesting count is only for newly discovered cache entries, and prints the total cache size. It only prints information about interesting entries when coverageEnabled is true. Fixes #48669 Change-Id: I2045afc204764c1842d323e8ae42016fb21b6fb7 Reviewed-on: https://go-review.googlesource.com/c/go/+/353172 Trust: Michael Knyszek Trust: Katie Hockman Reviewed-by: Katie Hockman Reviewed-by: Jay Conrod Run-TryBot: Katie Hockman TryBot-Result: Go Bot --- diff --git a/src/internal/fuzz/fuzz.go b/src/internal/fuzz/fuzz.go index a38036b9d2..87f5459afd 100644 --- a/src/internal/fuzz/fuzz.go +++ b/src/internal/fuzz/fuzz.go @@ -685,7 +685,12 @@ func (c *coordinator) logStats() { } } else { rate := float64(c.count) / time.Since(c.startTime).Seconds() // be more precise here - fmt.Fprintf(c.opts.Log, "fuzz: elapsed: %s, execs: %d (%.0f/sec), interesting: %d\n", c.elapsed(), c.count, rate, c.interestingCount) + if coverageEnabled { + interestingTotalCount := len(c.corpus.entries) - len(c.opts.Seed) + fmt.Fprintf(c.opts.Log, "fuzz: elapsed: %s, execs: %d (%.0f/sec), new interesting: %d (total: %d)\n", c.elapsed(), c.count, rate, c.interestingCount, interestingTotalCount) + } else { + fmt.Fprintf(c.opts.Log, "fuzz: elapsed: %s, execs: %d (%.0f/sec)", c.elapsed(), c.count, rate) + } } }