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) {
73
73
<- sigc
74
74
glog .V (logger .Info ).Infoln ("Got interrupt, shutting down..." )
75
75
go stack .Stop ()
76
- logger .Flush ()
77
76
for i := 10 ; i > 0 ; i -- {
78
77
<- sigc
79
78
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 )
82
80
}
83
81
}
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.
85
83
debug .LoudPanic ("boom" )
86
84
}()
87
85
}
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ type HandlerT struct {
51
51
traceFile string
52
52
}
53
53
54
- // Verbosity sets the glog verbosity floor .
54
+ // Verbosity sets the glog verbosity ceiling .
55
55
// The verbosity of individual packages and source files
56
56
// can be raised using Vmodule.
57
57
func (* HandlerT ) Verbosity (level int ) {
@@ -134,11 +134,11 @@ func (h *HandlerT) StopCPUProfile() error {
134
134
// GoTrace turns on tracing for nsec seconds and writes
135
135
// trace data to file.
136
136
func (h * HandlerT ) GoTrace (file string , nsec uint ) error {
137
- if err := h .StartTrace (file ); err != nil {
137
+ if err := h .StartGoTrace (file ); err != nil {
138
138
return err
139
139
}
140
140
time .Sleep (time .Duration (nsec ) * time .Second )
141
- h .StopTrace ()
141
+ h .StopGoTrace ()
142
142
return nil
143
143
}
144
144
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ func Setup(ctx *cli.Context) error {
89
89
runtime .MemProfileRate = ctx .GlobalInt (memprofilerateFlag .Name )
90
90
Handler .SetBlockProfileRate (ctx .GlobalInt (blockprofilerateFlag .Name ))
91
91
if traceFile := ctx .GlobalString (traceFlag .Name ); traceFile != "" {
92
- if err := Handler .StartTrace (traceFile ); err != nil {
92
+ if err := Handler .StartGoTrace (traceFile ); err != nil {
93
93
return err
94
94
}
95
95
}
@@ -114,5 +114,5 @@ func Setup(ctx *cli.Context) error {
114
114
// respective file.
115
115
func Exit () {
116
116
Handler .StopCPUProfile ()
117
- Handler .StopTrace ()
117
+ Handler .StopGoTrace ()
118
118
}
Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ import (
27
27
"github.com/ethereum/go-ethereum/logger/glog"
28
28
)
29
29
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 {
32
32
h .mu .Lock ()
33
33
defer h .mu .Unlock ()
34
34
if h .traceW != nil {
@@ -49,7 +49,7 @@ func (h *HandlerT) StartTrace(file string) error {
49
49
}
50
50
51
51
// StopTrace stops an ongoing trace.
52
- func (h * HandlerT ) StopTrace () error {
52
+ func (h * HandlerT ) StopGoTrace () error {
53
53
h .mu .Lock ()
54
54
defer h .mu .Unlock ()
55
55
trace .Stop ()
Original file line number Diff line number Diff line change @@ -22,10 +22,10 @@ package debug
22
22
23
23
import "errors"
24
24
25
- func (* HandlerT ) StartTrace (string ) error {
25
+ func (* HandlerT ) StartGoTrace (string ) error {
26
26
return errors .New ("tracing is not supported on Go < 1.5" )
27
27
}
28
28
29
- func (* HandlerT ) StopTrace () error {
29
+ func (* HandlerT ) StopGoTrace () error {
30
30
return errors .New ("tracing is not supported on Go < 1.5" )
31
31
}
Original file line number Diff line number Diff line change @@ -371,13 +371,13 @@ web3._extend({
371
371
params: 2
372
372
}),
373
373
new web3._extend.Method({
374
- name: 'startTrace ',
375
- call: 'debug_startTrace ',
374
+ name: 'startGoTrace ',
375
+ call: 'debug_startGoTrace ',
376
376
params: 1
377
377
}),
378
378
new web3._extend.Method({
379
- name: 'stopTrace ',
380
- call: 'debug_stopTrace ',
379
+ name: 'stopGoTrace ',
380
+ call: 'debug_stopGoTrace ',
381
381
params: 0
382
382
}),
383
383
new web3._extend.Method({
You can’t perform that action at this time.
0 commit comments