diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-04-20 23:59:41 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-04-20 23:59:41 +0800 |
commit | c8e2b3710cec47f023fd01c42ea829579a2753be (patch) | |
tree | f26334a03bb6375daa1f580bd4ad5d0b42fc055b /cmd/geth/main.go | |
parent | 8830403acfea745bd5e256d1498727e9128f02ae (diff) | |
download | dexon-c8e2b3710cec47f023fd01c42ea829579a2753be.tar dexon-c8e2b3710cec47f023fd01c42ea829579a2753be.tar.gz dexon-c8e2b3710cec47f023fd01c42ea829579a2753be.tar.bz2 dexon-c8e2b3710cec47f023fd01c42ea829579a2753be.tar.lz dexon-c8e2b3710cec47f023fd01c42ea829579a2753be.tar.xz dexon-c8e2b3710cec47f023fd01c42ea829579a2753be.tar.zst dexon-c8e2b3710cec47f023fd01c42ea829579a2753be.zip |
cmd/geth, cmd/utils: use pprof disable flag, start globally
Diffstat (limited to 'cmd/geth/main.go')
-rw-r--r-- | cmd/geth/main.go | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go index de1a59772..5695c4117 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -245,9 +245,15 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso utils.LogVModuleFlag, utils.LogFileFlag, utils.LogJSONFlag, - utils.PProfEnabledFlag, + utils.PProfDisabledFlag, utils.PProfPortFlag, } + app.Before = func(ctx *cli.Context) error { + if !ctx.GlobalBool(utils.PProfDisabledFlag.Name) { + utils.StartPProf(ctx) + } + return nil + } // missing: // flag.StringVar(&ConfigFile, "conf", defaultConfigFile, "config file") @@ -332,10 +338,6 @@ func unlockAccount(ctx *cli.Context, am *accounts.Manager, account string) (pass } func startEth(ctx *cli.Context, eth *eth.Ethereum) { - // Start profiling, if requested - if ctx.GlobalBool(utils.PProfEnabledFlag.Name) { - utils.StartPProf(ctx) - } // Start Ethereum itself utils.StartEthereum(eth) am := eth.AccountManager() |