From: Katie Hockman Date: Tue, 25 May 2021 21:21:16 +0000 (+0000) Subject: Revert "[dev.fuzz] internal/fuzz: include coverage in logged stats" X-Git-Tag: go1.18beta1~1282^2~52 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ff0164cf736b12740bf5837111e93130da6d612c;p=gostls13.git Revert "[dev.fuzz] internal/fuzz: include coverage in logged stats" This reverts commit 54f067812dd870c305daabd22ca190b0f48e672e. Reason for revert: While this is helpful for the engineering team when we're debugging, it might lead to users feeling like the fuzzer is stuck and that there are a lot of edges that are still yet to be reached. In reality, it's very likely that the compiler will instrument more lines of code than are actually reachable by the fuzz target, so showing the ratio between number of edges hit vs. all edges can be misleading. In the future, we may want to consider making this information viewable by a debug flag or something similar. Change-Id: Ied696f8bf644445bad22c872b64daa7add605ac6 Reviewed-on: https://go-review.googlesource.com/c/go/+/322632 Trust: Katie Hockman Run-TryBot: Katie Hockman TryBot-Result: Go Bot Reviewed-by: Jay Conrod --- diff --git a/src/internal/fuzz/fuzz.go b/src/internal/fuzz/fuzz.go index 28539b2604..553086b20a 100644 --- a/src/internal/fuzz/fuzz.go +++ b/src/internal/fuzz/fuzz.go @@ -474,18 +474,14 @@ func (c *coordinator) updateStats(result fuzzResult) { } func (c *coordinator) logStats() { + // TODO(jayconrod,katiehockman): consider printing the amount of coverage + // that has been reached so far (perhaps a percentage of edges?) elapsed := time.Since(c.startTime) if c.coverageOnlyRun() { fmt.Fprintf(c.opts.Log, "gathering baseline coverage, elapsed: %.1fs, workers: %d, left: %d\n", elapsed.Seconds(), c.opts.Parallel, c.covOnlyInputs) } else { rate := float64(c.count) / elapsed.Seconds() - edges, hits := len(c.coverageData), 0 - for _, c := range c.coverageData { - if c > 0 { - hits++ - } - } - fmt.Fprintf(c.opts.Log, "fuzzing, elapsed: %.1fs, execs: %d (%.0f/sec), workers: %d, interesting: %d, coverage: %d/%d\n", elapsed.Seconds(), c.count, rate, c.opts.Parallel, c.interestingCount, hits, edges) + fmt.Fprintf(c.opts.Log, "fuzzing, elapsed: %.1fs, execs: %d (%.0f/sec), workers: %d, interesting: %d\n", elapsed.Seconds(), c.count, rate, c.opts.Parallel, c.interestingCount) } }