Add global-profile option
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
f21c5cbbe2
commit
ebc8489ff1
@ -80,6 +80,10 @@ var importBenchCmd = &cli.Command{
|
|||||||
&cli.BoolFlag{
|
&cli.BoolFlag{
|
||||||
Name: "only-gc",
|
Name: "only-gc",
|
||||||
},
|
},
|
||||||
|
&cli.BoolFlag{
|
||||||
|
Name: "global-profile",
|
||||||
|
Value: true,
|
||||||
|
},
|
||||||
&cli.Int64Flag{
|
&cli.Int64Flag{
|
||||||
Name: "start-at",
|
Name: "start-at",
|
||||||
},
|
},
|
||||||
@ -161,14 +165,16 @@ var importBenchCmd = &cli.Command{
|
|||||||
cs := store.NewChainStore(bs, ds, vm.Syscalls(verifier))
|
cs := store.NewChainStore(bs, ds, vm.Syscalls(verifier))
|
||||||
stm := stmgr.NewStateManager(cs)
|
stm := stmgr.NewStateManager(cs)
|
||||||
|
|
||||||
prof, err := os.Create("import-bench.prof")
|
if cctx.Bool("global-profile") {
|
||||||
if err != nil {
|
prof, err := os.Create("import-bench.prof")
|
||||||
return err
|
if err != nil {
|
||||||
}
|
return err
|
||||||
defer prof.Close() //nolint:errcheck
|
}
|
||||||
|
defer prof.Close() //nolint:errcheck
|
||||||
|
|
||||||
if err := pprof.StartCPUProfile(prof); err != nil {
|
if err := pprof.StartCPUProfile(prof); err != nil {
|
||||||
return err
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var head *types.TipSet
|
var head *types.TipSet
|
||||||
|
Loading…
Reference in New Issue
Block a user