mirror of
https://github.com/reactos/syzkaller.git
synced 2024-11-25 04:19:53 +00:00
syz-fuzzer: expose pprof profiling
This commit is contained in:
parent
0298b1afb6
commit
cde826031a
@ -13,10 +13,13 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"net/rpc"
|
||||
"net/rpc/jsonrpc"
|
||||
"os"
|
||||
"os/signal"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -41,6 +44,7 @@ var (
|
||||
flagProcs = flag.Int("procs", 1, "number of parallel test processes")
|
||||
flagLeak = flag.Bool("leak", false, "detect memory leaks")
|
||||
flagOutput = flag.String("output", "stdout", "write programs to none/stdout/dmesg/file")
|
||||
flagPprof = flag.String("pprof", "", "address to serve pprof profiles")
|
||||
)
|
||||
|
||||
const (
|
||||
@ -114,6 +118,15 @@ func main() {
|
||||
os.Exit(1)
|
||||
}()
|
||||
|
||||
if *flagPprof != "" {
|
||||
go func() {
|
||||
err := http.ListenAndServe(*flagPprof, nil)
|
||||
Fatalf("failed to serve pprof profiles: %v", err)
|
||||
}()
|
||||
} else {
|
||||
runtime.MemProfileRate = 0
|
||||
}
|
||||
|
||||
corpusCover = make([]cover.Cover, sys.CallCount)
|
||||
maxCover = make([]cover.Cover, sys.CallCount)
|
||||
corpusHashes = make(map[Sig]struct{})
|
||||
|
Loading…
Reference in New Issue
Block a user