diff options
| author | Necip Fazil Yildiran <necip@google.com> | 2023-08-21 21:57:07 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2023-08-22 12:20:36 +0000 |
| commit | b81ca3f66f8d2d8b397c3c1dc5f14e77c2936b1e (patch) | |
| tree | b1fa304cf31d167f2cc6dc35df5a8a949869484a /tools/syz-execprog | |
| parent | 96546aceffcf9f774c2f704a3f8348930a66b4cb (diff) | |
tools/syz-execprog: create coverage file per program run
When coverfile option is used with multiple program inputs (e.g., with
a corpus input), syz-execprog overwrites the output coverage files with
each program run.
Create coverage file per program run instead, which would let save
the coverage information for all inputs.
Diffstat (limited to 'tools/syz-execprog')
| -rw-r--r-- | tools/syz-execprog/execprog.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/syz-execprog/execprog.go b/tools/syz-execprog/execprog.go index ec6d59e1e..70d0eee81 100644 --- a/tools/syz-execprog/execprog.go +++ b/tools/syz-execprog/execprog.go @@ -153,11 +153,11 @@ func (ctx *Context) run(pid int) { return } entry := ctx.progs[idx%len(ctx.progs)] - ctx.execute(pid, env, entry) + ctx.execute(pid, env, entry, idx) } } -func (ctx *Context) execute(pid int, env *ipc.Env, p *prog.Prog) { +func (ctx *Context) execute(pid int, env *ipc.Env, p *prog.Prog, progIndex int) { // Limit concurrency window. ticket := ctx.gate.Enter() defer ctx.gate.Leave(ticket) @@ -187,7 +187,8 @@ func (ctx *Context) execute(pid int, env *ipc.Env, p *prog.Prog) { ctx.printHints(p, info) } if *flagCoverFile != "" { - ctx.dumpCoverage(*flagCoverFile, info) + covFile := fmt.Sprintf("%s_prog%d", *flagCoverFile, progIndex) + ctx.dumpCoverage(covFile, info) } } else { log.Logf(1, "RESULT: no calls executed") |
