You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ gops 38707
parent PID: 27500
threads: 21
memory usage: 0.265%
cpu usage: 1.372%
username: admin
cmd+args: go run main.go service api
elapsed time: 03:58
$ gops stack 38707
Couldn't resolve addr or pid 38707 to TCPAddress: couldn't get port for PID 38707: open /Users/admin/Library/Application Support/gops/38707: no such file or directory
how to get it ?
used MacBook-Pro-7
The text was updated successfully, but these errors were encountered:
You might try to run the commands against a process that does not have the gops agent running.
This is not clear from the Github README.md but it is mentioned in the help:
> gops help
gops is a tool to list and diagnose Go processes.
Usage:
gops <cmd> <pid|addr> ...
gops <pid> # displays process info
gops help # displays this help message
Commands:
stack Prints the stack trace.
gc Runs the garbage collector and blocks until successful.
setgc Sets the garbage collection target percentage.
memstats Prints the allocation and garbage collection stats.
version Prints the Go version used to build the program.
stats Prints runtime stats.
trace Runs the runtime tracer for 5 secs and launches "go tool trace".
pprof-heap Reads the heap profile and launches "go tool pprof".
pprof-cpu Reads the CPU profile and launches "go tool pprof".
All commands require the agent running on the Go process.
"*" indicates the process is running the agent.
I am referring to the following part All commands require the agent running on the Go process.
When you run gops against a process that has the agent running you will see a local/remote field reported. That field contains the port gops connects against when running e.g. gops stack
$ gops tree
...
├── 27500
│ └── 38707 (go) {go1.15.4}
│ └── 38744 (main) {go1.15.4}
│ └── 38745 (main) {go1.15.4}
└── 28308
└── 38862 (gops) {go1.15.4}
$ gops 38707
parent PID: 27500
threads: 21
memory usage: 0.265%
cpu usage: 1.372%
username: admin
cmd+args: go run main.go service api
elapsed time: 03:58
$ gops stack 38707
Couldn't resolve addr or pid 38707 to TCPAddress: couldn't get port for PID 38707: open /Users/admin/Library/Application Support/gops/38707: no such file or directory
how to get it ?
used MacBook-Pro-7
The text was updated successfully, but these errors were encountered: