lntest: add flag -goroutinedump
This commit is contained in:
2 files changed
+11
-1
No files matched your search
@@ -652,6 +652,11 @@ func (n *NetworkHarness) StopNode(node *HarnessNode) error {
|
|||||||
// SaveProfilesPages hits profiles pages of all active nodes and writes it to
|
// SaveProfilesPages hits profiles pages of all active nodes and writes it to
|
||||||
// disk using a similar naming scheme as to the regular set of logs.
|
// disk using a similar naming scheme as to the regular set of logs.
|
||||||
func (n *NetworkHarness) SaveProfilesPages() {
|
func (n *NetworkHarness) SaveProfilesPages() {
|
||||||
|
// Only write gorutine dumps if flag is active.
|
||||||
|
if !(*goroutineDump) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
for _, node := range n.activeNodes {
|
for _, node := range n.activeNodes {
|
||||||
if err := saveProfilesPage(node); err != nil {
|
if err := saveProfilesPage(node); err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
|
|||||||
+6
-1
@@ -80,7 +80,12 @@ var (
|
|||||||
// logOutput is a flag that can be set to append the output from the
|
// logOutput is a flag that can be set to append the output from the
|
||||||
// seed nodes to log files.
|
// seed nodes to log files.
|
||||||
logOutput = flag.Bool("logoutput", false,
|
logOutput = flag.Bool("logoutput", false,
|
||||||
"log output from node n to file outputn.log")
|
"log output from node n to file output-n.log")
|
||||||
|
|
||||||
|
// goroutineDump is a flag that can be set to dump the active
|
||||||
|
// goroutines of test nodes on failure.
|
||||||
|
goroutineDump = flag.Bool("goroutinedump", false,
|
||||||
|
"write goroutine dump from node n to file pprof-n.log")
|
||||||
)
|
)
|
||||||
|
|
||||||
// generateListeningPorts returns three ints representing ports to listen on
|
// generateListeningPorts returns three ints representing ports to listen on
|
||||||
|
|||||||
Reference in new issue
Block a user