1
0
mirror of https://github.com/google/gops.git synced 2024-11-24 08:22:25 +02:00
Commit Graph

258 Commits

Author SHA1 Message Date
Tobias Klauser
ed67c5b345
Use os.UserConfigDir for internal.ConfigDir if available (#103)
On Go ≥ 1.13 the os package has os.ConfigDir
(https://golang.org/pkg/os/#UserConfigDir) which returns the default
root directory to use for user-specific configuration data. Use this in
internal.ConfigDir if available, while still making sure that any
directory specified in GOPS_CONFIG_DIR takes precedence.
2020-05-14 22:01:34 +02:00
Tobias Klauser
f1b8f2b15c
Add prefix to profile dump file names (#101)
When getting profile dumps for further processing, it's hard to distinguish
CPU and heap profiles from the file names alone. Make this easier by
adding a prefix (cpu or heap) to the file name depending on the type of
profile.
2020-04-29 10:44:32 -07:00
Dan Peterson
3a98d6d245
agent: silence error on listener close (#97)
As part of agent.Close, Close is called on the listener. This has
Accept return a "use of closed network connection" error, which is
expected. This error is logged but it would be nice if it wasn't.

Unfortunately, there's not a great way to check for this
error (https://golang.org/issues/4373) so use a best-effort
strings.Contains check.
2020-02-29 14:34:15 -08:00
Tobias Klauser
9025be33d5
Don't log path to profile dump twice (#98)
The path to the profile dump is already logged after writing the file
(cmd.go line 121). Remove the duplicate log line.

Co-authored-by: Emmanuel T Odeke <odeke@ualberta.ca>
2020-02-29 14:27:25 -08:00
Jakub Łukasiewicz
71c4255d55
Check $XDG_CONFIG_HOME before falling to ~/.config (#99) 2020-02-29 14:24:56 -08:00
JBD
59c8be2ead
Improve the help text (#94)
Avoid using tabs, remove help from "subcommands" list,
don't differentiate the profiling commands from others.
2019-08-01 22:19:10 -07:00
JBD
6cdc0c0a4a
Update CircleCI to Go 1.12 (#93) 2019-07-29 13:06:16 -07:00
JBD
2aa6a2cfed Switch to Go modules 2019-07-27 15:21:33 -07:00
JBD
fbf94b913d Revert "Switch to Go modules"
This reverts commit 28cfbaf001.
2019-07-27 15:16:00 -07:00
JBD
28cfbaf001 Switch to Go modules 2019-07-27 15:09:47 -07:00
Yash Ladha
036f72c5be Fix exit code if a valid cmd is passed (#91) 2019-03-27 10:35:05 -07:00
Pavlos Ratis
954ead6c72 add support for elapsed time (etime) (#80) 2019-03-20 14:59:55 -07:00
Bernerd Schaefer
05b5a27491 agent: include newlines in warning log messages (#87)
The warnings that agent prints to os.Stderr did not previously include
newlines causing program output to get jumbled up when an error occurs.
We see this most often when calling `Close()`, which causes the listener
to print `gops: accept tcp 127.0.0.1:9999: use of closed network
connection` which breaks whatever is logged next.
2019-03-20 11:58:46 -07:00
JBD
9fda3b87c7 Add Go modules and missing vendored file 2019-01-25 10:45:53 -08:00
Tanabe Ken-ichi
f341a40f99 Add gitignore to ignore gops and remove the binary (#85) 2018-09-03 00:25:10 -07:00
JBD
89672dbe3c fix out of bounds panic 2018-07-11 12:15:44 -07:00
Michal Rostecki
60aa68d3cc cmd: Check error returned by GetPort (#83)
Before this change, error returned by internal.GetPort was
assigned to err variable, but this assignment was ineffectual
and error was ignored.
2018-07-11 10:12:00 -07:00
Shi Han
e4108e7e73 address breaking changes from xlab/treeprint (#84)
A PR of xlab/treeprint (https://github.com/xlab/treeprint/pull/6)
which was merged might break gops in the future.
The PR removed treeprint.EdgeTypeStart. To set the root node,
we can now use SetValue(value Value) instead.

In this commit,

    dep ensure -update github.com/xlab/treeprint

was executed to update the library and then fix is applied.
2018-07-11 10:08:06 -07:00
Michal Rostecki
62b4d22266 vendor: dep ensure -update github.com/shirou/gopsutil (#79)
gopsutil library is licensed under BSD, but the previous version
contained some GPL-licensed code which is a violation of GPL
license. The updated version doesn't contain GPL-licensed code
anymore.

https://github.com/shirou/gopsutil/issues/518
2018-04-29 22:11:38 -07:00
Pavlos Ratis
3bb2ff8d85 Update README with the latest changes (#67) 2018-04-23 16:44:40 -07:00
Jack Mordaunt
160b358b10 Fixed data race. (#68) 2018-03-10 21:24:15 -08:00
Pavlos Ratis
48c083dd34 add command to display a process tree (#72)
Implemented a command, where users can list all running Go
processes in a tree-like format (like pstree).

Example:

$ gops tree
...
├── 13744
│   └── 71746 (gops) {go1.10}
├── 1
│   └── 13962 (gocode) {go1.9}
└── 557
    └── 635 (com.docker.supervisor) {go1.9.2}
        └── 638 (com.docker.driver.amd64-linux) {go1.9.2}
2018-03-10 19:43:39 -08:00
Suhas Karanth
0e2aa5d22e dep ensure -update github.com/go-ole/go-ole (#70) 2018-03-03 12:00:58 -08:00
JBD
09ff00a4dd
Add process info (#59)
Example output:

$ gops <pid>
parent PID:	5985
threads:	27
memory usage:	0.199%
cpu usage:	0.139%
username:	jbd
cmd+args:	/Applications/Splice.app/Contents/Resources/Splice Helper.app/Contents/MacOS/Splice Helper -pid 5985
local/remote:	127.0.0.1:56765 <-> :0 (LISTEN)
local/remote:	127.0.0.1:56765 <-> 127.0.0.1:50955 (ESTABLISHED)
local/remote:	100.76.175.164:52353 <-> 54.241.191.232:443 (ESTABLISHED)

Fixes #58.
2018-02-27 19:41:44 -08:00
ferhat elmas
e09130d898 test: remove unused type (#66) 2017-12-21 19:26:21 -07:00
ferhat elmas
f4d96179f3 cmd: Use strings.Contains (#65)
- instead strings.Index check
2017-12-02 20:39:23 -07:00
Nazri Ramliy
2209de1300 Add usage synopsis in help message (#64) 2017-11-23 18:41:11 -07:00
Rambone
390a41310a Report more Stack info, as stack-mspan-inuse、stack-mspan-sys etc. (#63) 2017-11-20 10:28:44 -08:00
Rambone
dcc978d6e8 make ConfigDir configurable (#61)
make ConfigDir configurable

* internal: retrieve ConfigDir from GOPS_CONFIG_DIR environment variable

* make code graceful

* code optimize
2017-11-13 00:52:04 -07:00
JBD
ce0552a598 README: document setgc (#57) 2017-10-08 12:11:38 -06:00
Daniel Fireman
ed4f1f24a6 Introducing support to debug.SetGCPercent. (#56)
* Introducing support to debug.SetGCPercent.

 Fixes #8

On my I needed to augment a little bit the communication
protocol to add support to optional parameters.
2017-10-06 17:50:40 -06:00
Pieter Louw
3f15b6d2b6 README: replace agent.Listen nil param with empty Options (#55) 2017-10-04 00:22:55 -06:00
JBD
25312cafb9 add missing license headers (#54) 2017-09-21 00:33:28 -06:00
JBD
61651220bb README: godoc should link to the top-level package (#53) 2017-09-18 19:21:51 -06:00
Rene Zbinden
6865b1eab5 keep trace and profile files when go tool chain is not available (#52) 2017-09-15 15:03:29 -07:00
Pavlos Ratis
f6c95cf224 Update gops snippets to match the new output (#50)
* update README snippets to reflect the new output

Updated the sample output in the README to match the
properly tabulated output when actually running the program.
2017-09-13 16:09:42 -06:00
JBD
1a41b817e5 agent: don't close on interrupt by default (#49) 2017-09-11 19:50:16 -07:00
JBD
d38055cdcb internal, vendor: remove unused code (#48)
internal object packages are no longer required
given gops depends on rsc.io/goversion/version now.

Also running dep prune to remove the packages
gops doesn't depend from the vendor directory.
2017-09-06 12:15:36 -06:00
Jaana Burcu Dogan
57e77c5c37 agent indicator should be postfix 2017-09-04 23:05:17 -07:00
Jaana Burcu Dogan
a1c72eeaa8 shorthen devel build version string 2017-09-04 20:08:19 -07:00
Jaana Burcu Dogan
f0a29dc244 add PPID to the output 2017-09-04 18:49:17 -07:00
Jaana Burcu Dogan
08cb2394b4 vendor: dep ensure again 2017-09-04 11:54:34 -07:00
Emmanuel T Odeke
d858829db9 goversion: use rsc.io/goversion/version instead of internal package (#47)
Follow up of
112843115d (commitcomment-23936637)

Solves the problem of us having to manually watch
upstream and pull in bug fixes and updates, if our
internal copy goes stale.

Fixes #22.
2017-09-04 11:53:45 -07:00
Jaana Burcu Dogan
bfd379ce45 goprocess: report info about a single process 2017-09-04 11:45:49 -07:00
Jaana Burcu Dogan
a5b317229c README: add build status badge 2017-09-04 11:23:37 -07:00
Jaana Burcu Dogan
8d0aff5e37 switch to Circle CI 2017-09-04 10:09:16 -07:00
Jaana Burcu Dogan
2a9a4ad991 README: move badges to the next line 2017-09-04 09:45:22 -07:00
JBD
414c940baf output better aligned results (#46)
Before the change, the output looked:
43819	gops	go1.9	/Users/jbd/bin/gops
20160	corp-ssh-helper	go1.8.1.typealias	/usr/local/bin/corp-ssh-helper
30492	dlv	go1.9	/Users/jbd/bin/dlv
31212	godoc	devel +990dac2723 Fri Jun 30 18:24:58 2017 +0000	/Users/jbd/bin/godoc
18579	mnp_logger	go1.7.1	/usr/local/bin/mnp_logger

After the change, it looks:
48071  gops            go1.9                                            /Users/jbd/bin/gops
31212  godoc           devel +990dac2723 Fri Jun 30 18:24:58 2017 +0000 /Users/jbd/bin/godoc
18579  mnp_logger      go1.7.1                                          /usr/local/bin/mnp_logger
20160  corp-ssh-helper go1.8.1.typealias                                /usr/local/bin/corp-ssh-helper
30492  dlv             go1.9                                            /Users/jbd/bin/dlv
44512  gocode          devel +990dac2723 Fri Jun 30 18:24:58 2017 +0000 /Users/jbd/bin/gocode
2017-09-01 18:43:29 -06:00
Jaana Burcu Dogan
208dc6473d support only 1.8 and 1.9 2017-08-29 14:09:23 -07:00
Jaana Burcu Dogan
5c0015f27d Export Go process reporting section as a package. 2017-08-28 19:33:06 -07:00