]> Cypherpunks repositories - gostls13.git/commitdiff
Revert "[dev.fuzz] internal/fuzz: include coverage in logged stats"
authorKatie Hockman <katie@golang.org>
Tue, 25 May 2021 21:21:16 +0000 (21:21 +0000)
committerKatie Hockman <katie@golang.org>
Wed, 26 May 2021 15:00:45 +0000 (15:00 +0000)
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 <katie@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/internal/fuzz/fuzz.go

index 28539b260453c68f43fc124a4c76251bee4b3263..553086b20a3826ee036e1c7a895600da779f7ad6 100644 (file)
@@ -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)
        }
 }