aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-10-20 12:23:21 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-10-23 09:59:39 +0200
commit8fa0c867d4e4bbd97321b19ac11115fa7020570a (patch)
tree12d25a05dc84fa5ad849acecc78b8cf073ed3998 /tools
parent5044885ca2e3e8fd8a368cb497946d994d1bb1ad (diff)
syz-fuzzer: generates hints only for the call that gave new coverage
During smashing we know what call gave new coverage, so we can concentrate just on it. This helps to reduce amount of hints generated (we have too many of them).
Diffstat (limited to 'tools')
-rw-r--r--tools/syz-execprog/execprog.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/syz-execprog/execprog.go b/tools/syz-execprog/execprog.go
index 9a9a1b48a..6c5df9ffd 100644
--- a/tools/syz-execprog/execprog.go
+++ b/tools/syz-execprog/execprog.go
@@ -179,7 +179,8 @@ func main() {
if *flagHints {
compMaps := ipc.GetCompMaps(info)
ncomps, ncandidates := 0, 0
- for _, comps := range compMaps {
+ for i := range p.Calls {
+ comps := compMaps[i]
for v, args := range comps {
ncomps += len(args)
if *flagOutput == "stdout" {
@@ -190,13 +191,13 @@ func main() {
fmt.Printf("\n")
}
}
+ p.MutateWithHints(i, comps, func(p *prog.Prog) {
+ ncandidates++
+ if *flagOutput == "stdout" {
+ fmt.Printf("PROGRAM:\n%s\n", p.Serialize())
+ }
+ })
}
- p.MutateWithHints(compMaps, func(p *prog.Prog) {
- ncandidates++
- if *flagOutput == "stdout" {
- fmt.Printf("PROGRAM:\n%s\n", p.Serialize())
- }
- })
fmt.Printf("ncomps=%v ncandidates=%v\n", ncomps, ncandidates)
}
return true