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

257 Commits

Author SHA1 Message Date
Glib Smaga
22cdba11b7 Remove named returns
Named returns should only be used with naked returns, or a
deferred function. And in general are better avoided
2023-10-05 21:43:22 +02:00
Tobias Klauser
710ef44cc3 agent: check listener instead of portfile in Listen
After #213 the portfile might no longer be written, thus check the
listener to determine whether the agent is already listening.
2023-10-05 17:21:37 +02:00
Alex Lyashko
dae615bb91 ignore EROFS and EPERM errors on config saving
agent still works in remote mode and executable environment may not
allow to save any data at all (e.g. in k8s container), so be robust.

Signed-off-by: Alex Lyashko <alex.lyashko@gmail.com>
2023-10-05 16:06:42 +02:00
Alex Lyashko
cf6d865718 minor: move some code to saveConfig() to make it more readable
Signed-off-by: Alex Lyashko <alex.lyashko@gmail.com>
2023-10-05 16:06:42 +02:00
Alex Lyashko
f80c10051e minor: reorder code and group it
and gracefulShutdown() should be called on success only.

Signed-off-by: Alex Lyashko <alex.lyashko@gmail.com>
2023-10-05 16:06:42 +02:00
dependabot[bot]
1fd5d0cc66 build(deps): bump github.com/shirou/gopsutil/v3 from 3.23.8 to 3.23.9
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.23.8 to 3.23.9.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v3.23.8...v3.23.9)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-03 11:19:11 +02:00
dependabot[bot]
ee5f1f664d build(deps): bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 10:52:58 +02:00
dependabot[bot]
d4479113ae build(deps): bump golang.org/x/sys from 0.11.0 to 0.12.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.11.0 to 0.12.0.
- [Commits](https://github.com/golang/sys/compare/v0.11.0...v0.12.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 08:12:17 +02:00
dependabot[bot]
de6ccb1e65 build(deps): bump github.com/shirou/gopsutil/v3 from 3.23.7 to 3.23.8
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.23.7 to 3.23.8.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v3.23.7...v3.23.8)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-03 10:13:42 +02:00
Mahe Tardy
ac7253a173 Fix process command crash when provided with no args
Use cobra.MinimumNArgs to require at least one argument and handle
errors in processing the arguments. Improve the use help string.
2023-08-09 11:50:58 +02:00
dependabot[bot]
e6260f5970 build(deps): bump golang.org/x/sys from 0.10.0 to 0.11.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.10.0 to 0.11.0.
- [Commits](https://github.com/golang/sys/compare/v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-09 07:47:59 +02:00
dependabot[bot]
4cd08d4e35 build(deps): bump github.com/shirou/gopsutil/v3 from 3.23.5 to 3.23.7
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.23.5 to 3.23.7.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v3.23.5...v3.23.7)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-08 08:13:31 +02:00
dependabot[bot]
3e466bcedc build(deps): bump golang.org/x/sys from 0.8.0 to 0.9.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.8.0 to 0.9.0.
- [Commits](https://github.com/golang/sys/compare/v0.8.0...v0.9.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-12 23:13:54 +02:00
dependabot[bot]
e8faef4633 build(deps): bump github.com/shirou/gopsutil/v3 from 3.23.4 to 3.23.5
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.23.4 to 3.23.5.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v3.23.4...v3.23.5)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-02 11:32:48 +02:00
dependabot[bot]
ae4e33f85a build(deps): bump golang.org/x/sys from 0.7.0 to 0.8.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.7.0 to 0.8.0.
- [Commits](https://github.com/golang/sys/compare/v0.7.0...v0.8.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-05 09:57:02 +02:00
dependabot[bot]
05f985aded build(deps): bump github.com/shirou/gopsutil/v3 from 3.23.3 to 3.23.4
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.23.3 to 3.23.4.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v3.23.3...v3.23.4)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-03 11:19:59 +02:00
dependabot[bot]
3a685ab1a0 build(deps): bump github.com/spf13/cobra from 1.6.1 to 1.7.0
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.6.1 to 1.7.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.6.1...v1.7.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-07 13:59:48 +02:00
dependabot[bot]
44f09b5adf build(deps): bump golang.org/x/sys from 0.6.0 to 0.7.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-05 00:16:56 +02:00
dependabot[bot]
78d8cf9e60 build(deps): bump github.com/shirou/gopsutil/v3 from 3.23.2 to 3.23.3
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.23.2 to 3.23.3.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v3.23.2...v3.23.3)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-04 10:03:57 +02:00
dependabot[bot]
71d0c0d092 build(deps): bump actions/setup-go from 3 to 4
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-16 08:52:10 +01:00
dependabot[bot]
f9b679ceb3 build(deps): bump github.com/xlab/treeprint from 1.1.0 to 1.2.0
Bumps [github.com/xlab/treeprint](https://github.com/xlab/treeprint) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/xlab/treeprint/releases)
- [Commits](https://github.com/xlab/treeprint/compare/v1.1.0...v1.2.0)

---
updated-dependencies:
- dependency-name: github.com/xlab/treeprint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-10 10:36:50 +01:00
dependabot[bot]
14342869be build(deps): bump golang.org/x/sys from 0.5.0 to 0.6.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.5.0...v0.6.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-07 09:32:18 +01:00
dependabot[bot]
8321946999 build(deps): bump github.com/shirou/gopsutil/v3 from 3.23.1 to 3.23.2
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.23.1 to 3.23.2.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v3.23.1...v3.23.2)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-03 11:50:53 +01:00
Tobias Klauser
70408a1556 Update CI to Go 1.20 2023-02-10 14:25:28 +01:00
segevda
a241038823
replace ioutil usages with io and os (#202)
ioutil was deprecated in go1.16 and its functions now directly call io
and os functions. It is recommended to use these implementations in new
code.
2023-02-10 14:03:23 +01:00
segevda
dbeb29cd3e
cmd/shared: add 'off' option to setgc (#201)
To stop GC completely, debug.SetGCPercentage needs to receive a negative
integer. Passing a negative integer is cumbersome:
$ gops setgc <pid> -- -1

This commit adds a more user-friendly way to achieve that:
$ gops setgc <pid> off

This behavior is aligned with that of the GOGC env variable, where
negative or "off" can be set to stop the GC.
2023-02-10 11:24:10 +01:00
dependabot[bot]
2b6817995c build(deps): bump golang.org/x/sys from 0.4.0 to 0.5.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.4.0...v0.5.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-07 23:51:36 +01:00
dependabot[bot]
524040e551 build(deps): bump github.com/shirou/gopsutil/v3 from 3.22.12 to 3.23.1
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.22.12 to 3.23.1.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v3.22.12...v3.23.1)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-01 23:21:19 +01:00
Tobias Klauser
52a0828960 internal: remove redundant environment variable checks in ConfigDir
os.UserConfigDir will already check the AppData environment variable on
Windows (environment variable names are case-insensitive on Windows):
https://cs.opensource.google/go/go/+/release-branch.go1.19:src/os/file.go;l=461-465
and the XDG_CONFIG_HOME environment variable on Unix operating systems:
https://cs.opensource.google/go/go/+/release-branch.go1.19:src/os/file.go;l=481-489
2023-01-31 14:45:20 +01:00
dependabot[bot]
b4db245b1a build(deps): bump golang.org/x/sys from 0.3.0 to 0.4.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.3.0 to 0.4.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.3.0...v0.4.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-04 22:07:17 +01:00
dependabot[bot]
b83b19ead3 build(deps): bump github.com/shirou/gopsutil/v3 from 3.22.11 to 3.22.12
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.22.11 to 3.22.12.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/commits/v3.22.12)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-03 15:58:33 +01:00
dependabot[bot]
50c4123411 build(deps): bump github.com/shirou/gopsutil/v3 from 3.22.10 to 3.22.11
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.22.10 to 3.22.11.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/commits)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-20 13:48:55 +01:00
Tobias Klauser
019dbd09a0 go.mod: downgrade github.com/shirou/gopsutil to v3.22.10
dependabot updated gopsutil to v3.22.11 in PR #189. That tag is no
longer available upstream and was retracted, see shirou/gopsutil#1386.
Switch back to the previous version for now and let dependabot update
once there is a new version.

Fixes #191
2022-12-15 11:00:02 +01:00
dependabot[bot]
2531148669 build(deps): bump golang.org/x/sys from 0.2.0 to 0.3.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.2.0 to 0.3.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.2.0...v0.3.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-09 16:51:24 +01:00
dependabot[bot]
9430031e1a build(deps): bump github.com/shirou/gopsutil/v3 from 3.22.10 to 3.22.11
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.22.10 to 3.22.11.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/commits)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-07 09:20:32 +01:00
Tobias Klauser
fc3d8acb6d go.mod: bump to Go 1.17 2022-12-07 09:20:32 +01:00
zhsj
eebecad9f8
goprocess: replace go-ps with gopsutil (#187)
The keybase's fork of go-ps seems abandoned, and gopsutil is already
introduced with same functionalities.
2022-11-25 14:16:13 +01:00
Tobias Klauser
4e8ba583e7
Remove vendored modules (#188) 2022-11-22 07:49:29 -08:00
dependabot[bot]
ed01246b0a build(deps): bump github.com/shirou/gopsutil/v3 from 3.22.9 to 3.22.10
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.22.9 to 3.22.10.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v3.22.9...v3.22.10)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-08 04:10:37 +01:00
dependabot[bot]
f8e83ad200 build(deps): bump github.com/spf13/cobra from 1.5.0 to 1.6.1
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.5.0 to 1.6.1.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.5.0...v1.6.1)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-07 08:38:41 +01:00
dependabot[bot]
31f906129d build(deps): bump github.com/shirou/gopsutil/v3 from 3.22.8 to 3.22.9
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.22.8 to 3.22.9.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v3.22.8...v3.22.9)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-03 23:31:51 +02:00
Tobias Klauser
cf6a02a850 Update CI to Go 1.19 2022-09-01 22:51:33 +02:00
dependabot[bot]
6a7f594c94 build(deps): bump github.com/shirou/gopsutil/v3 from 3.22.7 to 3.22.8
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.22.7 to 3.22.8.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v3.22.7...v3.22.8)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-01 22:48:53 +02:00
dependabot[bot]
1b6dca4616 build(deps): bump github.com/shirou/gopsutil/v3 from 3.22.4 to 3.22.7
Bumps [github.com/shirou/gopsutil/v3](https://github.com/shirou/gopsutil) from 3.22.4 to 3.22.7.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v3.22.4...v3.22.7)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-01 06:36:37 +02:00
dependabot[bot]
ab74a57fd9 build(deps): bump github.com/spf13/cobra from 1.4.0 to 1.5.0
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.4.0...v1.5.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-31 06:13:22 +02:00
dependabot[bot]
b328946709 build(deps): bump actions/setup-go from 2 to 3
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-31 06:05:39 +02:00
dependabot[bot]
62a38d18c9 build(deps): bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-31 05:38:47 +02:00
Tobias Klauser
12769e9c68
ci: add dependabot config (#176) 2022-08-31 02:21:56 +03:00
Glib Smaga
9069aa4d19 Migrate gops to use spf13/cobra for command execution
Manual command setup was starting to show some strain in
terms of documentation and also adding new features
(regardless of what the protocol supports currently).

This new setup aims to make it easier to add new
documentation and functionality.

In comparison to the previous version, this increased the
binary size by 2.4M.
```
6.4M gops
4.0M gops_master
```
2022-08-30 14:31:29 +02:00
Glib Smaga
3655f623db vendor: include cobra 2022-08-30 14:31:29 +02:00