Commit Graph

2000 Commits (511da82e944b7761e2cdccdcf2123b2517d3a79b)
 

Author SHA1 Message Date
Lomanic 8775def991
Merge pull request #1072 from djs55/externproc-arm64
process: fix ExternProc on Apple Silicon / Darwin arm64
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>
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
Ville Skyttä f43138a3ff [process][solaris] improve Exe portability
Resolving from path/a.out seems more portable than from execname.
Ville Skyttä eab3aea46b [load][solaris] support MiscStat.ProcsRunning
shirou 3af73eac22
Merge pull request #1064 from scop/fix/solaris-cpu
[cpu][solaris] psrinfo parsing fixes
shirou 9a5f86a30e
Merge pull request #1065 from scop/feat/solaris-process-some
Basic Solaris process support
Sergey Kacheev 44d3907f9d
Merge branch 'master' into splitProcStat
Lomanic 37678fe053
Merge pull request #1067 from shirou/feature/add_testdata_process_linux_fillfrom
[process][linux] add test to parse fillFromStatus
Lomanic f3a5a93d62
Merge pull request #1068 from shirou/feature/relax_net_iocounter_test
relax net/NetIOCountersAll test.
Ville Skyttä e35ae34dce [process][solaris] process basics
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.
Ville Skyttä 2278747969 [v2][cpu][solaris] psrinfo parsing fixes
shirou 3d97fc18f4 add check if it runs on CI
shirou c6bd05a3e9 relax net/NetIOCountersAll test.
It often fails in CI.
shirou 2fa855f295 add MockEnv as more generic function.
shirou abacce2177 [process][linux] add test to parse fillFromStatus
shirou 008b5a41ef
Merge pull request #1060 from heptalium/master
Fix fillFromStatusWithContext() on systems with 128 bit signal masks.
Ville Skyttä 7598518443 [v3][cpu][solaris] psrinfo parsing fixes
Sergey Kacheev 716cf26984 add parsing of real data from testdata with the splitProcStat function
Jens Meißner 14a1f64e7e
[v3][process][linux] Fix fillFromStatusWithContext() on systems with 128 bit signal masks.
shirou 539c0d52c0
Merge pull request #1063 from damilola-bello/master
Make limitToUint parse to uint instead of int
Damilola Bello 61c36c7b8c Make limitToUint parse to uint instead of int
Lomanic c7a38de76e
Merge pull request #1052 from gballet/openbsd-arm-support
add support for OpenBSD arm64
Lomanic d447f9f7ed
Merge pull request #1039 from Lomanic/issue1037
[cpu][linux] Fix #1037 only count logical cores where 2nd field is a number
Jens Meißner fc074343f8
[process][linux] Fix fillFromStatusWithContext() on systems with 128 bit signal masks.
Daniel Stutz 9916462c47 use ioreg to read IOPlatformUUID as HostID
Sergey Kacheev b3a9d75932 add file for linux specific tests
Sergey Kacheev 07a870e63b clarify test
Sergey Kacheev 306f6d104b add a reliable way to get fields from /prod/PID/stat
shirou 79048ccbfa
Merge pull request #1035 from jblesener/fixmacosspaces
Fix spaces on long process names for MacOS
John Blesener 07797b12d3
Make cmdNameWithContext lower-case to avoid exporting it
Signed-off-by: John Blesener <jblesener@reactivelabs.com>
Guillaume Ballet 992d17af94 add support for OpenBSD arm64
shirou 76779af909
Merge pull request #1051 from Lomanic/issue1049
[process][posix] Fix #1049 check if procfs is mounted before checking if pid exists there
Lomanic f69e79f6b0
Merge pull request #1050 from shirou/feature/v3_add_suse
[v3][host][linux] add suse to v3 following #1047
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
shirou c177d23a33 [v3][host][linux] add suse to v3 following #1047
shirou 59c1f43d3e
Merge pull request #1047 from m-terel/missing-suse-distributions
Added missing distributions to the suse platform family
shirou 2623881709
Merge pull request #1042 from bobrik/ivan/missing-conditionals
Add missing TargetConditionals.h include, closes #976
Mykola Terelia 84e8e51bf9 Added missing distributions to the suse platform family
shirou c637487c2c
Merge pull request #1045 from Lomanic/issue714
[process][windows] Fix #714 call OpenProcess with PROCESS_QUERY_INFORMATION on WinXP
Lomanic 62d8920abb [process][windows] Fix #714 call OpenProcess with PROCESS_QUERY_INFORMATION on WinXP
Ivan Babrou 19ac85b504 Add missing TargetConditionals.h include, closes #976
shirou 2d13269306
Merge pull request #1041 from shirou/feature/erik-reduce-memory
[process][linux] apply #1033 to v3.
shirou a5a07ae83c [process][linux] apply #1033 to v3.
shirou a5834f48c4
Merge pull request #1033 from eriknordmark/erik-reduce-memory
Avoid returning slice into buffer from Readfile
Lomanic 6589c5c274 [cpu][linux] Fix #1037 only count logical cores where 2nd field is a number
shirou a44e7585f9
Merge pull request #1030 from pawelz/master
Clarify the godoc of the Children function.
shirou a346c31dc3
Merge pull request #1036 from tklauser/drop-getconf
cpu, v3/cpu: use sysconf package instead of exec'ing getconf
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.