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

pprof disasm is not work right after go 1.16 #709

Open
zdyj3170101136 opened this issue Jul 8, 2022 · 1 comment
Open

pprof disasm is not work right after go 1.16 #709

zdyj3170101136 opened this issue Jul 8, 2022 · 1 comment
Labels
Priority: p3 Buganizer priority - P3 type: bug Buganizer type - Bug

Comments

@zdyj3170101136
Copy link

Please answer these questions before submitting your issue. Thanks!

What version of pprof are you using?

yangjie05-mac:awesomeProject35 jie.yang05$ go version
go version go1.17.4 darwin/arm64

What system os and processor architecture are you using?

macos

yangjie05-mac:awesomeProject35 jie.yang05$ arch
arm64

What did you do?

I run my code and want to get disasm from the cpuprofile.

code:

package main

import (
	"math/rand"
	"os"
	"runtime/pprof"
	"time"
)

var global int

func main() {
	f, _ := os.Create("cpu.pprof")
	pprof.StartCPUProfile(f)
	t := time.After(3 * time.Second)
loop:
	for {
		select {
		case <-t:
			break loop
		default:
			global = rand.Int()
		}
	}
	pprof.StopCPUProfile()
	f.Sync()
	f.Close()
}

script:

go build -o=bin main.go
./bin
go tool pprof  bin cpu.pprof
disasm rand

What did you expect to see?

expect to see (which i run in my macos with same code but go version 1.16)

(pprof) disasm rand
Total: 2.67s
ROUTINE ======================== math/rand.(*lockedSource).Int63
     450ms      450ms (flat, cum) 16.85% of Total
     220ms      220ms    106ce80: MOVQ GS:0x30, CX                        ;math/rand.(*lockedSource).Int63 rand.go:387
         .          .    106ce89: CMPQ 0x10(CX), SP                       ;rand.go:387
         .          .    106ce8d: JBE 0x106cf90
         .          .    106ce93: SUBQ $0x20, SP
         .          .    106ce97: MOVQ BP, 0x18(SP)
         .          .    106ce9c: LEAQ 0x18(SP), BP
         .          .    106cea1: XORL AX, AX                             ;rand.go:388
         .          .    106cea3: MOVQ 0x28(SP), DX
         .          .    106cea8: MOVL $0x1, BX
         .          .    106cead: LOCK CMPXCHGL BX, 0(DX)
      60ms       60ms    106ceb1: SETE BL                                 ;math/rand.(*lockedSource).Int63 rand.go:388

What did you see instead?

nothing but total

(pprof) disasm rand
Total: 2.63s
(pprof) 

@Louis-Ye Louis-Ye added type: bug Buganizer type - Bug Priority: p3 Buganizer priority - P3 labels Jun 1, 2023
@cristaloleg
Copy link
Contributor

Also golang/go#50891

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: p3 Buganizer priority - P3 type: bug Buganizer type - Bug
Projects
None yet
Development

No branches or pull requests

3 participants