couldn't get port by PID
gops memstats 27281
couldn't get port by PID: dial tcp 127.0.0.1:0: connect: can't assign requested address
when i use addr,long time no response.
i use go version go1.10 darwin/amd64.
i remember it works before,perhaps i updated the go version.
I got the same issue.
couldn't get port by PID: dial tcp 127.0.0.1:0: connect: connection refused
Me too $ gops pprof-cpu 6433 Profiling CPU now, will take 30 secs... couldn't get port by PID: dial tcp 127.0.0.1:0: connect: can't assign requested address
me too!!!
But no one seems to care!!!
me too!!!
But no one seems to care!!!
1、golang version 2、quote "github.com/google/gops/agent" in your code; 3、add code in you main func, such as: if err := agent.Listen(agent.Options{}); err != nil { log.Fatal(err) } 4、go build your code 5、run your binary program 6、gops option according to gops doc
to use gops, you MUST set env of GOPS_CONFIG_DIR, otherwise, it use $HOME/.config for linux system, in case the dir does not exist, gops will mkdir, but for which you might have no permission to mkdir
func PIDFile(pid int) (string, error) { gopsdir, err := ConfigDir() if err != nil { return "", err } return fmt.Sprintf("%s/%d", gopsdir, pid), nil }