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

perf record output is not correct in arm64. #70804

Closed
zdyj3170101136 opened this issue Dec 12, 2024 · 4 comments
Closed

perf record output is not correct in arm64. #70804

zdyj3170101136 opened this issue Dec 12, 2024 · 4 comments

Comments

@zdyj3170101136
Copy link

Go version

go version go1.22.7 (Red Hat 1.22.7-1.0.2.al8) linux/arm64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/root/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/root/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/lib/golang'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/usr/lib/golang/pkg/tool/linux_arm64'
GOVCS=''
GOVERSION='go1.22.7 (Red Hat 1.22.7-1.0.2.al8)'
GCCGO='gccgo'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
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 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1690956932=/tmp/go-build -gno-record-gcc-switches

What did you do?

run benchmark:

package main

import (
        "encoding/json"
        "net/http"
        _ "net/http/pprof"
)

func main() {
        go func() {
                http.ListenAndServe(":7079", nil )
        }()
        for {
                json.Marshal([]byte("sss"))
        }
}

use perf:

perf record -a -g sleep 30s
perf report

What did you see happen?

perf report is very strange:

截屏2024-12-12 下午7 41 46

What did you expect to see?

the perf report should match the go pprof:
截屏2024-12-12 下午7 41 03

@seankhliao
Copy link
Member

I think this is #58835

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Dec 12, 2024
@zdyj3170101136
Copy link
Author

convert addr to func name :

addr2line -f -e ./testjson 0x1deb8
runtime.mallocgc
/root/testjson/go/src/runtime/malloc.go:1117

the result is same in perf and pprof and is correct.

so it is the perf record get wrong address.

@zdyj3170101136
Copy link
Author

截屏2024-12-20 下午5 09 30

@seankhliao

it is the flamegraph generated by perf.

very different with go pprof.

not same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants