Skip to content

cmd/trace: failed to read event: expected batch event (EventBatch), got Invalid(115) #67602

@codenoid

Description

@codenoid

Go version

go version go1.22.1 darwin/arm64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/user/Library/Caches/go-build'
GOENV='/Users/user/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/user/go/pkg/mod'
GONOPROXY='github.com/xx'
GONOSUMDB='github.com/xx'
GOOS='darwin'
GOPATH='/Users/user/go'
GOPRIVATE='github.com/xx'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.1'
GCCGO='gccgo'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/Users/user/Documents/xx/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/kk/ypk1jlt93r9cgpc_nnx75q0w0000gn/T/go-build877092516=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

I basically generate golang trace file like this below:

package main

import (
    "os"
    "runtime/trace"
)

func main() {
    trace.Start(os.Stderr) //start the trace 
    defer trace.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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions