Tobias Klauser
cb29e40ade
Update github.com/tklauser/go-sysconf to v0.3.8
...
This fixes the build of go-sysconf on openbsd/386 and openbsd/arm, see
tklauser/go-sysconf#21 and rclone/rclone#5402 for context.
List of changes: https://github.com/tklauser/go-sysconf/compare/v0.3.6...v0.3.8
4 years ago
shirou
efc3e519be
Merge pull request #1112 from xuyang2/process-name-linux
...
[process][linux] get name from /proc/(pid)/comm
4 years ago
xuyang2
45a01f678c
[process][linux] get name from /proc/(pid)/comm
4 years ago
xuyang2
7485c8041d
[process][linux] get name from /proc/(pid)/comm
4 years ago
xuyang2
a9757c7de9
[process][linux] get name from /proc/(pid)/comm
4 years ago
dependabot[bot]
f41cf8143a
Bump github.com/tklauser/go-sysconf from 0.3.6 to 0.3.7 in /v3
...
Bumps [github.com/tklauser/go-sysconf](https://github.com/tklauser/go-sysconf ) from 0.3.6 to 0.3.7.
- [Release notes](https://github.com/tklauser/go-sysconf/releases )
- [Commits](https://github.com/tklauser/go-sysconf/compare/v0.3.6...v0.3.7 )
---
updated-dependencies:
- dependency-name: github.com/tklauser/go-sysconf
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
4 years ago
dependabot[bot]
cd789c0cf9
Bump github.com/stretchr/testify from 1.6.1 to 1.7.0 in /v3
...
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify ) from 1.6.1 to 1.7.0.
- [Release notes](https://github.com/stretchr/testify/releases )
- [Commits](https://github.com/stretchr/testify/compare/v1.6.1...v1.7.0 )
---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
4 years ago
Adam Lesperance
7993cb68cc
Newest version of wmi
4 years ago
xuyang2
7203001e29
[process][linux] get name from /proc/(pid)/comm
4 years ago
shirou
48ca99694c
Merge pull request #1099 from edge/master
...
fix wmi version
4 years ago
shirou
78e21dd887
Merge pull request #1097 from secDre4mer/master
...
feat: Add support for environment variable read
4 years ago
odinje
a3e22baec0
Ensure rhel platform family for Rocky Linux
4 years ago
Max Altgelt
9ad6c64727
fix: Remove superfluous EnvironWithContext definitions
...
Since Darwin / FreeBSD / OpenBSD all use process_bsd.go, remove
the duplicated "not implemented" EnvironWithContext definitions
from their custom go files.
Signed-off-by: Max Altgelt <max.altgelt@nextron-systems.com>
4 years ago
Max Altgelt
5f61473ffd
fix: Correct UNICODE_STRING64 definition
...
Correct the UNICODE_STRING64 definition. The length is only
16 bits, followed by 16 bit max length and 32 bit padding.
4 years ago
Aneurin Barker Snook
42f69011cc
fix wmi version
4 years ago
Max Altgelt
73fee847e6
chore: add tests
...
Add simple tests to verify that environment variables are read.
4 years ago
Max Altgelt
5337ed8408
chore: Add changes to v3 gopsutil
4 years ago
Adam Lesperance
8a083b8393
Update wmi to go.mod supported version
4 years ago
Ralph Schmieder
9494ebdd94
Additional Darwin CGO implementation
...
- added CwdWithContext to get the current working dir of a process
- added CmdLineWithContext natively w/ support for spaces etc.
4 years ago
shirou
d87e955d79
Merge pull request #1090 from MyaLongmire/windows_name_fix
...
simplify mutex usage
4 years ago
shirou
daec167ba2
Merge pull request #1087 from ivandeex/openbsd-process-nocgo
...
process, v3/process (openbsd): remove remaining CGO bits from CmdlineSliceWithContext
4 years ago
Mya
cb512c8500
simplify mutex usage
4 years ago
shirou
7ea8062810
Merge pull request #1083 from elmeyer/fix-processes-smartos
...
process, v3/process (Linux): fix Processes in SmartOS lx containers
4 years ago
Huan Wang
6a572952f0
fix slow cpuinfo on multisocket config
...
updated win32_Processor struct to exclude loadpercentage field.
The loadpercentage takes linearly more time as the # of sockets
increases. By default vSphere maps 1 vCPU to 1 socket, resulting in very
poor performance when getting CPU info against, saying, 40 vCPU VM
(basically 40 sockets as seen by the VM).
4 years ago
Lars Meyer
e89412a81e
[process][linux] copy test for missing iotime in SmartOS lx containers to v3
4 years ago
Ivan Andreev
d6e0932b96
Remove CGO bits from process_openbsd.go (also v3)
...
Prior to this commit CGO was used in OpenBSD implementation of
Process.CmdlineSliceWithContext() for parsing the "kern.proc.args"
sysctl output. It requires some pointer arithmetics and raw pointer
dereferencing.
Having CGO in the "process" module prevents it from being go vet'ted
on any platform other than OpenBSD. In order to overcome this
limitation, the sysctl output parsing was reimplemented without raw
pointer deferencing. The resulting code might be slightly slower
than the original one, but it is cleaner and safer.
Since this fix allows go vet with GOOS=openbsd to run without any
issues on all platforms, openbsd entries were also added to the "vet"
Makefile target.
Co-authored-by: Sergey Vinogradov <cbrpnk@gmail.com>
4 years ago
Lars Meyer
0ab3954dc4
[process][linux] fix Processes in SmartOS lx containers
...
In Linux containers running in LX Branded Zones on SmartOS (potentially
other Solaris-based OSes with LX Branded Zones),
fillFromTIDStatWithContext panics as the delayacct_blkio_ticks field is
not present and thus results in an out-of-bounds slice access.
Check the slice length before and only attempt to parse the
delayacct_blkio_ticks field if there is an appropriate number of fields.
4 years ago
Tobias Klauser
611c8b576e
process, v3/process: use SC_CLK_TCK sysconf value instead of hard-coding clock ticks
...
The github.com/tklauser/go-sysconf package is already a dependency used
in the cpu and v3/cpu packages to determine clock ticks using
`sysconf.Sysconf(sysconf.SC_CLK_TCK)`, see #1036 . Use the same in
packages process and v3/process as well instead of hard-coding clock
ticks to 100.
4 years ago
Tobias Klauser
25b4a07b16
Update github.com/tklauser/go-sysconf to v0.3.6
...
List of changes: https://github.com/tklauser/go-sysconf/compare/v0.3.4...v0.3.6
4 years ago
shirou
b49f37e9f3
Merge pull request #1076 from scop/feat-arm-cpuinfo
...
[cpu][linux] more info for ARM processors
4 years ago
Ville Skyttä
47f2f0eee5
[cpu][linux] add more ARM hw implementers
4 years ago
shirou
9bd4bc70ae
[process][linux] fix 1056 test and copy to v2
4 years ago
shirou
3a48fa3629
Merge pull request #1077 from shirou/feature/1010_port_to_v3
...
[host][openbsd][v3] Fix wrong OpenBSD user count
4 years ago
shirou
bade702712
Merge pull request #1056 from sakateka/splitProcStat
...
add a reliable way to get fields from /prod/PID/stat
4 years ago
shirou
ddef7ea64d
[host][openbsd][v3] Fix wrong OpenBSD user count
4 years ago
shirou
b76e0ffe7a
Merge pull request #1074 from scop/feat/solaris-load-procsrunning
...
[load][solaris] support MiscStat.ProcsRunning
4 years ago
shirou
7ffa844cd5
Merge pull request #1075 from scop/feat/improve-solaris-exe
...
[process][solaris] improve Exe portability
4 years ago
Lomanic
8775def991
Merge pull request #1072 from djs55/externproc-arm64
...
process: fix ExternProc on Apple Silicon / Darwin arm64
4 years ago
David Scott
0a281012db
process: change all pointers to uint64 in ExternProc for darwin arm64
...
This is the arm64 version of the change in
20c3ddbfe5
Before this patch:
```
dave@m1 process % GO111MODULE=off CGO_ENABLED=0 go test
--- FAIL: Test_Process_Name (0.00s)
process_test.go:312: invalid Exe
--- FAIL: Test_Process_Long_Name_With_Spaces (0.22s)
process_test.go:357: loooong name with spaces.go.exe !=
--- FAIL: Test_Process_Long_Name (0.22s)
process_test.go:402: looooooooooooooooooooong.go.exe !=
--- FAIL: Test_Username (0.00s)
process_test.go:593:
Error Trace: process_test.go:593
Error: Not equal:
expected: "dave"
actual : "root"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-dave
+root
Test: Test_Username
process_test.go:595: root
FAIL
exit status 1
FAIL github.com/shirou/gopsutil/process 9.955s
```
After this patch:
```
dave@m1 process % GO111MODULE=off CGO_ENABLED=0 go test
PASS
ok github.com/shirou/gopsutil/process 9.784s
dave@m1 process % GO111MODULE=off CGO_ENABLED=1 go test
PASS
ok github.com/shirou/gopsutil/process 3.180s
```
Signed-off-by: David Scott <dave@recoil.org>
4 years ago
Ville Skyttä
b8ac60acc1
[cpu][linux] more info for ARM processors
...
https://developer.arm.com/documentation/ddi0337/h/system-control/register-descriptions/cpuid-base-register--cpuid
4 years ago
Ville Skyttä
f43138a3ff
[process][solaris] improve Exe portability
...
Resolving from path/a.out seems more portable than from execname.
4 years ago
Ville Skyttä
eab3aea46b
[load][solaris] support MiscStat.ProcsRunning
4 years ago
shirou
3af73eac22
Merge pull request #1064 from scop/fix/solaris-cpu
...
[cpu][solaris] psrinfo parsing fixes
4 years ago
shirou
9a5f86a30e
Merge pull request #1065 from scop/feat/solaris-process-some
...
Basic Solaris process support
4 years ago
Sergey Kacheev
44d3907f9d
Merge branch 'master' into splitProcStat
4 years ago
Lomanic
37678fe053
Merge pull request #1067 from shirou/feature/add_testdata_process_linux_fillfrom
...
[process][linux] add test to parse fillFromStatus
4 years ago
Ville Skyttä
e35ae34dce
[process][solaris] process basics
4 years ago
Ville Skyttä
b7d717ba80
[process][posix] use os.Lstat for symlink check
...
unix.DT_LNK is not portable; per glibc docs it's a BSD extension. It is
not available e.g. in Solaris.
https://www.gnu.org/software/libc/manual/html_node/Directory-Entries.html#index-DT_005fLNK
As a side effect, fixes incorrect equality comparison against
Stat_t.Mode, a bitmask.
4 years ago
shirou
3d97fc18f4
add check if it runs on CI
4 years ago
shirou
c6bd05a3e9
relax net/NetIOCountersAll test.
...
It often fails in CI.
4 years ago
shirou
2fa855f295
add MockEnv as more generic function.
4 years ago
shirou
abacce2177
[process][linux] add test to parse fillFromStatus
4 years ago
shirou
008b5a41ef
Merge pull request #1060 from heptalium/master
...
Fix fillFromStatusWithContext() on systems with 128 bit signal masks.
4 years ago
Ville Skyttä
7598518443
[v3][cpu][solaris] psrinfo parsing fixes
4 years ago
Sergey Kacheev
716cf26984
add parsing of real data from testdata with the splitProcStat function
4 years ago
Jens Meißner
14a1f64e7e
[v3][process][linux] Fix fillFromStatusWithContext() on systems with 128 bit signal masks.
4 years ago
Damilola Bello
61c36c7b8c
Make limitToUint parse to uint instead of int
4 years ago
Lomanic
c7a38de76e
Merge pull request #1052 from gballet/openbsd-arm-support
...
add support for OpenBSD arm64
4 years ago
Lomanic
d447f9f7ed
Merge pull request #1039 from Lomanic/issue1037
...
[cpu][linux] Fix #1037 only count logical cores where 2nd field is a number
4 years ago
Daniel Stutz
9916462c47
use ioreg to read IOPlatformUUID as HostID
4 years ago
Sergey Kacheev
b3a9d75932
add file for linux specific tests
4 years ago
Sergey Kacheev
07a870e63b
clarify test
4 years ago
Sergey Kacheev
306f6d104b
add a reliable way to get fields from /prod/PID/stat
4 years ago
shirou
79048ccbfa
Merge pull request #1035 from jblesener/fixmacosspaces
...
Fix spaces on long process names for MacOS
4 years ago
John Blesener
07797b12d3
Make cmdNameWithContext lower-case to avoid exporting it
...
Signed-off-by: John Blesener <jblesener@reactivelabs.com>
4 years ago
Guillaume Ballet
992d17af94
add support for OpenBSD arm64
4 years ago
shirou
76779af909
Merge pull request #1051 from Lomanic/issue1049
...
[process][posix] Fix #1049 check if procfs is mounted before checking if pid exists there
4 years ago
Lomanic
0881c11a9a
[process][posix] Fix #1049 check if procfs is mounted before checking if pid exists there
...
Benchmark before this change (process.NewProcess() calls process.PidExistsWithContext()
internally)
go test -bench=BenchmarkNewProcess github.com/shirou/gopsutil/process
goos: linux
goarch: amd64
pkg: github.com/shirou/gopsutil/process
BenchmarkNewProcess-4 14722 78751 ns/op
PASS
ok github.com/shirou/gopsutil/process 3.685s
Benchmark with this change applied
go test -bench=BenchmarkNewProcess github.com/shirou/gopsutil/process
goos: linux
goarch: amd64
pkg: github.com/shirou/gopsutil/process
BenchmarkNewProcess-4 14835 80180 ns/op
PASS
ok github.com/shirou/gopsutil/process 3.761s
4 years ago
shirou
c177d23a33
[v3][host][linux] add suse to v3 following #1047
4 years ago
shirou
2623881709
Merge pull request #1042 from bobrik/ivan/missing-conditionals
...
Add missing TargetConditionals.h include, closes #976
4 years ago
Lomanic
62d8920abb
[process][windows] Fix #714 call OpenProcess with PROCESS_QUERY_INFORMATION on WinXP
4 years ago
Ivan Babrou
19ac85b504
Add missing TargetConditionals.h include, closes #976
4 years ago
shirou
a5a07ae83c
[process][linux] apply #1033 to v3.
4 years ago
Lomanic
6589c5c274
[cpu][linux] Fix #1037 only count logical cores where 2nd field is a number
4 years ago
shirou
a44e7585f9
Merge pull request #1030 from pawelz/master
...
Clarify the godoc of the Children function.
4 years ago
Tobias Klauser
ee12f66e4d
cpu, v3/cpu: use sysconf package instead of exec'ing getconf
...
Currently, ClocksPerSec is determined by exec'ing getconf in func init,
i.e. on startup of every program importing the package. getconf might
not be present on some systems or is not executable by the current user.
To avoid this hard to control dependency, use the
github.com/tklauser/go-sysconf package which implements sysconf(3)
entirely in Go without cgo. The package is supported on all platforms
currently supported by the cpu and v3/cpu package of gopsutil.
4 years ago
John Blesener
e8b2bea47f
Fix spaces on long process names for MacOS
4 years ago
shirou
6d324b0586
[v3][cpu] remove accidentally added GPL files.
4 years ago
Johannes Drummer
76fb312c4b
delete unused PdhAddCounterW
4 years ago
Paweł Zuzelski
17c03b3b2d
Clarify the godoc of the Children function.
...
The previous godoc string was slightly confusing and only described information that can be deduced from the function signature.
4 years ago
Johannes Drummer
6e7f4ffe99
Fix windows counters on non english systems
4 years ago
shirou
a9a6146c93
[process] fix MemoryInfo comment. remove Swap
...
fixes #1012
4 years ago
shirou
be483f0a78
Merge pull request #1017 from rishabh-arya95/hotfix/smap-parser
...
[process][linux] Fixing smaps parser
4 years ago
MashaSamoylova
7631bb0e5e
Fix lsof args for udp4 in unix
4 years ago
Rishabh Arya
5b1d8ecae7
fix smap parser
4 years ago
Lomanic
a6ed12aa0e
Merge pull request #998 from shirou/feature/implement_load_windows_v3
...
[v3][load][windows] implement load.Avg on windows
5 years ago
Lomanic
cd25417bd7
[mem][linux] Fix #1002 only try to parse /proc/meminfo numeric values on fields we're interested in
5 years ago
Lomanic
07887a9e9f
[mem][linux] Add mocked test for VirtualMemory() and fix SReclaimable SUnreclaim retrieval
5 years ago
Antoine Jacoutot
0178a24563
v3/process: unbreak on OpenBSD
...
Fix camel case: GetpageSizeWithContext -> GetPageSizeWithContext
5 years ago
Shirou Wakayama
74e1643f82
[load][windows] implement load on windows.
5 years ago
shirou
34412e0b7f
[net] relax NetIOCounterAll test
5 years ago
shirou
6286bea32a
Merge pull request #989 from Lomanic/issue734tests
...
[ci] Implement automatic tests on GH Actions on linux, windows and darwin
5 years ago
shirou
2c0ad9dfac
Merge pull request #988 from Lomanic/cpu-remove-windows-specific-dead-code
...
[v3][cpu][windows] Remove exported windows-specific dead code
5 years ago
Lomanic
318614d7ed
[v3][process][darwin] Fix test Test_Pids_Fail missing testdata folder
5 years ago
Lomanic
995610e109
[process][windows] Fix Nice() test expecting Unix values
5 years ago
Lomanic
5641beec4c
[process][darwin] Fix Parent() when lsof returns warnings
...
Same as #867 , the error being:
error strconv.Atoi: parsing " Output information may be incomplete.": invalid syntax
5 years ago
Lomanic
148a662b06
[process][darwin] Remove Groups() as it's non-functional
5 years ago
Lomanic
64e16cc8c3
[net][darwin] Fix tests with mismatched types
5 years ago
Lomanic
7f0ba43398
[net][darwin][freebsd] Fix tests with func not returning common.ErrNotImplementedError
5 years ago
Lomanic
907e475a45
[v3][process] Fix Test_Process_Status test with new Status() API
5 years ago