File tree Expand file tree Collapse file tree 6 files changed +16
-18
lines changed Expand file tree Collapse file tree 6 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -73,15 +73,13 @@ func StartNode(stack *node.Node) {
7373 <- sigc
7474 glog .V (logger .Info ).Infoln ("Got interrupt, shutting down..." )
7575 go stack .Stop ()
76- logger .Flush ()
7776 for i := 10 ; i > 0 ; i -- {
7877 <- sigc
7978 if i > 1 {
80- glog .V (logger .Info ).Infoln ("Already shutting down, please be patient." )
81- glog .V (logger .Info ).Infoln ("Interrupt" , i - 1 , "more times to induce panic." )
79+ glog .V (logger .Info ).Infof ("Already shutting down, interrupt %d more times for panic." , i - 1 )
8280 }
8381 }
84- glog . V ( logger . Error ). Infof ( "Force quitting: this might not end so well." )
82+ debug . Exit () // ensure trace and CPU profile data is flushed.
8583 debug .LoudPanic ("boom" )
8684 }()
8785}
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ type HandlerT struct {
5151 traceFile string
5252}
5353
54- // Verbosity sets the glog verbosity floor .
54+ // Verbosity sets the glog verbosity ceiling .
5555// The verbosity of individual packages and source files
5656// can be raised using Vmodule.
5757func (* HandlerT ) Verbosity (level int ) {
@@ -134,11 +134,11 @@ func (h *HandlerT) StopCPUProfile() error {
134134// GoTrace turns on tracing for nsec seconds and writes
135135// trace data to file.
136136func (h * HandlerT ) GoTrace (file string , nsec uint ) error {
137- if err := h .StartTrace (file ); err != nil {
137+ if err := h .StartGoTrace (file ); err != nil {
138138 return err
139139 }
140140 time .Sleep (time .Duration (nsec ) * time .Second )
141- h .StopTrace ()
141+ h .StopGoTrace ()
142142 return nil
143143}
144144
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ func Setup(ctx *cli.Context) error {
8989 runtime .MemProfileRate = ctx .GlobalInt (memprofilerateFlag .Name )
9090 Handler .SetBlockProfileRate (ctx .GlobalInt (blockprofilerateFlag .Name ))
9191 if traceFile := ctx .GlobalString (traceFlag .Name ); traceFile != "" {
92- if err := Handler .StartTrace (traceFile ); err != nil {
92+ if err := Handler .StartGoTrace (traceFile ); err != nil {
9393 return err
9494 }
9595 }
@@ -114,5 +114,5 @@ func Setup(ctx *cli.Context) error {
114114// respective file.
115115func Exit () {
116116 Handler .StopCPUProfile ()
117- Handler .StopTrace ()
117+ Handler .StopGoTrace ()
118118}
Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ import (
2727 "github.com/ethereum/go-ethereum/logger/glog"
2828)
2929
30- // StartTrace turns on tracing, writing to the given file.
31- func (h * HandlerT ) StartTrace (file string ) error {
30+ // StartGoTrace turns on tracing, writing to the given file.
31+ func (h * HandlerT ) StartGoTrace (file string ) error {
3232 h .mu .Lock ()
3333 defer h .mu .Unlock ()
3434 if h .traceW != nil {
@@ -49,7 +49,7 @@ func (h *HandlerT) StartTrace(file string) error {
4949}
5050
5151// StopTrace stops an ongoing trace.
52- func (h * HandlerT ) StopTrace () error {
52+ func (h * HandlerT ) StopGoTrace () error {
5353 h .mu .Lock ()
5454 defer h .mu .Unlock ()
5555 trace .Stop ()
Original file line number Diff line number Diff line change @@ -22,10 +22,10 @@ package debug
2222
2323import "errors"
2424
25- func (* HandlerT ) StartTrace (string ) error {
25+ func (* HandlerT ) StartGoTrace (string ) error {
2626 return errors .New ("tracing is not supported on Go < 1.5" )
2727}
2828
29- func (* HandlerT ) StopTrace () error {
29+ func (* HandlerT ) StopGoTrace () error {
3030 return errors .New ("tracing is not supported on Go < 1.5" )
3131}
Original file line number Diff line number Diff line change @@ -371,13 +371,13 @@ web3._extend({
371371 params: 2
372372 }),
373373 new web3._extend.Method({
374- name: 'startTrace ',
375- call: 'debug_startTrace ',
374+ name: 'startGoTrace ',
375+ call: 'debug_startGoTrace ',
376376 params: 1
377377 }),
378378 new web3._extend.Method({
379- name: 'stopTrace ',
380- call: 'debug_stopTrace ',
379+ name: 'stopGoTrace ',
380+ call: 'debug_stopGoTrace ',
381381 params: 0
382382 }),
383383 new web3._extend.Method({
You can’t perform that action at this time.
0 commit comments