aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/trace/subscribe.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/trace/subscribe.go')
-rw-r--r--src/runtime/trace/subscribe.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/runtime/trace/subscribe.go b/src/runtime/trace/subscribe.go
index 7e22b6abdb..a4d653dcae 100644
--- a/src/runtime/trace/subscribe.go
+++ b/src/runtime/trace/subscribe.go
@@ -155,7 +155,7 @@ func (t *traceMultiplexer) startLocked() error {
t.subscribersMu.Unlock()
go func() {
- header := runtime_readTrace()
+ header := runtime.ReadTrace()
if traceStartWriter != nil {
traceStartWriter.Write(header)
}
@@ -164,10 +164,16 @@ func (t *traceMultiplexer) startLocked() error {
}
for {
- data := runtime_readTrace()
+ data := runtime.ReadTrace()
if data == nil {
break
}
+ if traceStartWriter != nil {
+ traceStartWriter.Write(data)
+ }
+ if flightRecorder != nil {
+ flightRecorder.Write(data)
+ }
if len(data) == 1 && tracev2.EventType(data[0]) == tracev2.EvEndOfGeneration {
if flightRecorder != nil {
flightRecorder.endGeneration()
@@ -187,13 +193,6 @@ func (t *traceMultiplexer) startLocked() error {
if frIsNew {
flightRecorder.Write(header)
}
- } else {
- if traceStartWriter != nil {
- traceStartWriter.Write(data)
- }
- if flightRecorder != nil {
- flightRecorder.Write(data)
- }
}
}
}()