Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go tool trace not work #41291

Closed
tiny1990 opened this issue Sep 9, 2020 · 7 comments
Closed

go tool trace not work #41291

tiny1990 opened this issue Sep 9, 2020 · 7 comments

Comments

@tiny1990
Copy link

tiny1990 commented Sep 9, 2020

What version of Go are you using (go version)?

$ go version
go version go1.11.13 linux/amd64
or
go version go1.14 
or
go version go1.15

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build933204170=/tmp/go-build -gno-record-gcc-switches"

What did you do?

wget -O trace.out  127.0.0.1:5555/debug/pprof/trace?seconds=5
# go tool trace trace.out
2020/09/09 21:31:18 Parsing trace...
failed to parse trace: no consistent ordering of events possible

# docker version
Server: Docker Engine - Community
 Engine:
  Version:          19.03.12
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.10

What did you expect to see?

2020/09/09 21:31:18 Parsing trace...
2019/12/17 10:19:28 Opening browser. Trace viewer is listening on http://127.0.0.1:42335

@tiny1990
Copy link
Author

tiny1990 commented Sep 9, 2020

I want to analyse dockerd, so trace pragram is very imporant.
beacuse of the dockerd Goroutines is : 29003976

@tpaschalis
Copy link
Contributor

Hello, and thanks for opening this issue! The trace tool seems to be working correctly on my end with the latest release and Go tree.

The error that's produced comes from this function, which is responsible for ordering the trace events into a single consistent stream.

Can you provide more information on the code that's running to produce your trace, or a reproductible example?
It might help to check whether #29707 is a dupe, a simple case of how you're closing your trace, or a new bug.

@tiny1990
Copy link
Author

tiny1990 commented Sep 9, 2020

@tpaschalis thanks your reply.
sorry , i have no code, the 127.0.0.1:5555/debug/pprof/trace?seconds=5 is dockerd sock
or you can use socat -d -d TCP-LISTEN:5555,fork,bind=0.0.0.0 UNIX:/var/run/docker.sock for test
docker project use cgo

@tpaschalis
Copy link
Contributor

tpaschalis commented Sep 9, 2020

I understand. The fact that the issue appears with CGO makes me think it's a dupe of #29707, since people are reporting reproducibility with CGO. I'd recommend to chime in there as well.

@tiny1990
Copy link
Author

tiny1990 commented Sep 9, 2020

thanks. so. trace tool is not support cgo ?

@AlexRouSg
Copy link
Contributor

@tiny1990 It is not cgo, it's calling go code from threads not created by go.
See the code in #29707 (comment)

@andybons
Copy link
Member

Duplicate of #29707

Feel free to comment or open a new issue if this is not the case.

@golang golang locked and limited conversation to collaborators Sep 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants