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

couldn't get port by PID #74

Open
weichangdong opened this issue Mar 21, 2018 · 5 comments
Open

couldn't get port by PID #74

weichangdong opened this issue Mar 21, 2018 · 5 comments

Comments

@weichangdong
Copy link

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.

@ghost
Copy link

ghost commented Mar 31, 2018

I got the same issue.

couldn't get port by PID: dial tcp 127.0.0.1:0: connect: connection refused

@ashishchandra2017
Copy link

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

@19920716
Copy link

19920716 commented Jul 7, 2018

me too!!!

But no one seems to care!!!

@Crazy-Kitty
Copy link

Crazy-Kitty commented Oct 26, 2018

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

@westwin
Copy link

westwin commented Nov 27, 2019

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
}

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

5 participants