StopTrace stops an ongoing trace.
()
| 49 | |
| 50 | // StopTrace stops an ongoing trace. |
| 51 | func (h *HandlerT) StopGoTrace() error { |
| 52 | h.mu.Lock() |
| 53 | defer h.mu.Unlock() |
| 54 | trace.Stop() |
| 55 | if h.traceW == nil { |
| 56 | return errors.New("trace not in progress") |
| 57 | } |
| 58 | log.Info("Done writing Go trace", "dump", h.traceFile) |
| 59 | h.traceW.Close() |
| 60 | h.traceW = nil |
| 61 | h.traceFile = "" |
| 62 | return nil |
| 63 | } |