Add global-profile option

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera
2020-09-29 14:49:18 +02:00
parent f21c5cbbe2
commit ebc8489ff1
+6
View File
@@ -80,6 +80,10 @@ var importBenchCmd = &cli.Command{
&cli.BoolFlag{
Name: "only-gc",
},
&cli.BoolFlag{
Name: "global-profile",
Value: true,
},
&cli.Int64Flag{
Name: "start-at",
},
@@ -161,6 +165,7 @@ var importBenchCmd = &cli.Command{
cs := store.NewChainStore(bs, ds, vm.Syscalls(verifier))
stm := stmgr.NewStateManager(cs)
if cctx.Bool("global-profile") {
prof, err := os.Create("import-bench.prof")
if err != nil {
return err
@@ -170,6 +175,7 @@ var importBenchCmd = &cli.Command{
if err := pprof.StartCPUProfile(prof); err != nil {
return err
}
}
var head *types.TipSet
if !cctx.Bool("no-import") {