StopTrace stops an ongoing trace.
()
| 124 | |
| 125 | // StopTrace stops an ongoing trace. |
| 126 | func (h *HandlerT) StopGoTrace() error { |
| 127 | h.mu.Lock() |
| 128 | defer h.mu.Unlock() |
| 129 | trace.Stop() |
| 130 | if h.traceW == nil { |
| 131 | return errors.New("trace not in progress") |
| 132 | } |
| 133 | log.Info("Done writing Go trace", "dump", h.traceFile) |
| 134 | h.traceW.Close() |
| 135 | h.traceW = nil |
| 136 | h.traceFile = "" |
| 137 | return nil |
| 138 | } |
| 139 | |
| 140 | // StartBlockingProfile starts blocking profiling. |
| 141 | // rate 0 disables block profiling. |