diff options
| author | Andrey Konovalov <andreyknvl@google.com> | 2018-11-21 16:44:29 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-11-22 13:49:50 +0100 |
| commit | 582e1f0d1d51b9237d2dedfcb4c1540b849da8c2 (patch) | |
| tree | 0988637cc3c89ac5ed0791073dee453f87cb2bd3 /tools | |
| parent | 2ee778023a54f301219962a2996da1a2c60a817d (diff) | |
ipc: add ProgInfo struct
This patch add a new struct ProgInfo that for now holds info about each
call in a program []CallInfo, but in the future will be expanded with remote
coverage info. Update all the callers to use the new interface as well.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/syz-execprog/execprog.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/syz-execprog/execprog.go b/tools/syz-execprog/execprog.go index 1a42a8279..1ece85c17 100644 --- a/tools/syz-execprog/execprog.go +++ b/tools/syz-execprog/execprog.go @@ -148,7 +148,7 @@ func (ctx *Context) execute(pid int, env *ipc.Env, entry *prog.LogEntry) { log.Logf(0, "result: failed=%v hanged=%v err=%v\n\n%s", failed, hanged, err, output) } - if len(info) != 0 { + if len(info.Calls) != 0 { ctx.printCallResults(info) if *flagHints { ctx.printHints(entry.P, info) @@ -173,8 +173,8 @@ func (ctx *Context) logProgram(pid int, p *prog.Prog, callOpts *ipc.ExecOpts) { ctx.logMu.Unlock() } -func (ctx *Context) printCallResults(info []ipc.CallInfo) { - for i, inf := range info { +func (ctx *Context) printCallResults(info *ipc.ProgInfo) { + for i, inf := range info.Calls { if inf.Flags&ipc.CallExecuted == 0 { continue } @@ -193,13 +193,13 @@ func (ctx *Context) printCallResults(info []ipc.CallInfo) { } } -func (ctx *Context) printHints(p *prog.Prog, info []ipc.CallInfo) { +func (ctx *Context) printHints(p *prog.Prog, info *ipc.ProgInfo) { ncomps, ncandidates := 0, 0 for i := range p.Calls { if *flagOutput { fmt.Printf("call %v:\n", i) } - comps := info[i].Comps + comps := info.Calls[i].Comps for v, args := range comps { ncomps += len(args) if *flagOutput { @@ -220,8 +220,8 @@ func (ctx *Context) printHints(p *prog.Prog, info []ipc.CallInfo) { log.Logf(0, "ncomps=%v ncandidates=%v", ncomps, ncandidates) } -func (ctx *Context) dumpCoverage(coverFile string, info []ipc.CallInfo) { - for i, inf := range info { +func (ctx *Context) dumpCoverage(coverFile string, info *ipc.ProgInfo) { + for i, inf := range info.Calls { log.Logf(0, "call #%v: signal %v, coverage %v", i, len(inf.Signal), len(inf.Cover)) if len(inf.Cover) == 0 { continue |
