You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I basically generate golang trace file like this below:
package main
import (
"os""runtime/trace"
)
funcmain() {
trace.Start(os.Stderr) //start the trace defertrace.Stop() // defer to the end.... //rest of the code
}
run with:
go run ./cmd/app 2> trace.out
# then ctrl+c after doing some task
the trace.out file is generated
I'm sorry I can't put trace.out file publicly
What did you see happen?
when I want to see the trace using:
go tool trace trace.out
it's print
user@users-MacBook-Pro xx % go tool trace trace.out
2024/05/23 19:46:40 Preparing trace for viewer...
failed to read event: expected batch event (EventBatch), got Invalid(115)
What did you expect to see?
view the trace
The text was updated successfully, but these errors were encountered:
Deferred functions won't run if you stop your program with Ctrl-C. So, trace.Stop won't run and you will likely end up with an incomplete trace. #65319 is meant to address this, I think, as well as #65316 to make go tool trace handle incomplete traces better.
Go version
go version go1.22.1 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
I basically generate golang trace file like this below:
run with:
the trace.out file is generated
I'm sorry I can't put trace.out file publicly
What did you see happen?
when I want to see the trace using:
it's print
What did you expect to see?
view the trace
The text was updated successfully, but these errors were encountered: