internal/fuzz: more debug logging

Change-Id: I2c36baf423dde419aaa940ce9308088f3bf431f1
Reviewed-on: https://go-review.googlesource.com/c/go/+/476718
Auto-Submit: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
This commit is contained in:
Roland Shoemaker 2023-03-15 16:44:36 -07:00
parent 5f62ba621e
commit bf03fa9807
2 changed files with 13 additions and 2 deletions

View File

@ -322,7 +322,6 @@ func CoordinateFuzzing(ctx context.Context, opts CoordinateFuzzingOpts) (err err
if c.canMinimize() && result.canMinimize && c.crashMinimizing == nil {
// Send back to workers to find a smaller value that preserves
// at least one new coverage bit.
c.queueForMinimization(result, keepCoverage)
} else {
// Update the coordinator's coverage mask and save the value.
@ -822,8 +821,10 @@ func (c *coordinator) refillInputQueue() {
func (c *coordinator) queueForMinimization(result fuzzResult, keepCoverage []byte) {
if shouldPrintDebugInfo() {
c.debugLogf(
"queueing input for minimization, id: %s, crasher: %t",
"queueing input for minimization, id: %s, parent: %s, keepCoverage: %t, crasher: %t",
result.entry.Path,
result.entry.Parent,
keepCoverage,
result.crasherMsg != "",
)
}

View File

@ -216,6 +216,16 @@ func (w *worker) coordinate(ctx context.Context) error {
result.crasherMsg = err.Error()
}
}
if shouldPrintDebugInfo() {
w.coordinator.debugLogf(
"input minimized, id: %s, original id: %s, crasher: %t, originally crasher: %t, minimizing took: %s",
result.entry.Path,
input.entry.Path,
result.crasherMsg != "",
input.crasherMsg != "",
result.totalDuration,
)
}
w.coordinator.resultC <- result
}
}