cmd/geth, mobile: add memsize to pprof server (#16532)
* cmd/geth, mobile: add memsize to pprof server This is a temporary change, to be reverted before the next release. * cmd/geth: fix variable name
This commit is contained in:
committed by
Péter Szilágyi
parent
9586f2acc7
commit
e7067be94f
@ -29,6 +29,7 @@ import (
|
||||
"github.com/ethereum/go-ethereum/eth/downloader"
|
||||
"github.com/ethereum/go-ethereum/ethclient"
|
||||
"github.com/ethereum/go-ethereum/ethstats"
|
||||
"github.com/ethereum/go-ethereum/internal/debug"
|
||||
"github.com/ethereum/go-ethereum/les"
|
||||
"github.com/ethereum/go-ethereum/node"
|
||||
"github.com/ethereum/go-ethereum/p2p"
|
||||
@ -72,6 +73,9 @@ type NodeConfig struct {
|
||||
|
||||
// WhisperEnabled specifies whether the node should run the Whisper protocol.
|
||||
WhisperEnabled bool
|
||||
|
||||
// Listening address of pprof server.
|
||||
PprofAddress string
|
||||
}
|
||||
|
||||
// defaultNodeConfig contains the default node configuration values to use if all
|
||||
@ -107,6 +111,11 @@ func NewNode(datadir string, config *NodeConfig) (stack *Node, _ error) {
|
||||
if config.BootstrapNodes == nil || config.BootstrapNodes.Size() == 0 {
|
||||
config.BootstrapNodes = defaultNodeConfig.BootstrapNodes
|
||||
}
|
||||
|
||||
if config.PprofAddress != "" {
|
||||
debug.StartPProf(config.PprofAddress)
|
||||
}
|
||||
|
||||
// Create the empty networking stack
|
||||
nodeConf := &node.Config{
|
||||
Name: clientIdentifier,
|
||||
@ -127,6 +136,8 @@ func NewNode(datadir string, config *NodeConfig) (stack *Node, _ error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
debug.Memsize.Add("node", rawStack)
|
||||
|
||||
var genesis *core.Genesis
|
||||
if config.EthereumGenesis != "" {
|
||||
// Parse the user supplied genesis spec if not mainnet
|
||||
|
Reference in New Issue
Block a user