Commit Graph

1942 Commits (v3.21.11)
 

Author SHA1 Message Date
Ross Smith II ebe2843f84
More (opinionated) doc fixes 4 years ago
Ross Smith II e364a40c47
docs: fix typo 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
shirou 4746baa8c7
Merge pull request #1101 from shirou/dependabot/github_actions/actions/labeler-3.0.2
Bump actions/labeler from 2 to 3.0.2
4 years ago
dependabot[bot] 0f84c89cb4
Bump actions/labeler from 2 to 3.0.2
Bumps [actions/labeler](https://github.com/actions/labeler) from 2 to 3.0.2.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/v2...v3.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
4 years ago
shirou 3814f4e2a1
Merge pull request #1100 from mmorel-35/chore/dependabot
Set up Dependabot
4 years ago
Matthieu MOREL 0e9c4d3b85
Update dependabot.yml 4 years ago
Matthieu MOREL 26442de1b3
Create dependabot.yml 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
Max Altgelt b02b92e16b
feat: Add support for environment variable read
Add support (for Linux and Windows for now) for reading the
environment variables of a process, with a similar syntax to
os.Environ().
For Windows, this includes some refactoring for clean access to the
RTL_USER_PROCESS_PARAMETERS structure which points to the command
line and the environment variables.
4 years ago
shirou 42d667edb6
Merge pull request #1096 from lespea/goModWMI
Update wmi to go.mod supported version
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 ec072d99db
Merge pull request #1091 from shirou/add_other_flag_to_shellcheck
change to use ludeeus/action-shellcheck for shellcheck.
4 years ago
shirou 92aa11e80a use ludeeus/action-shellcheck for shellcheck. 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
shirou fcbe555401
Merge pull request #1088 from fredwangwang/fix-slow-cpuinfo-win
processor, v3/processor (Win): fix slow cpuinfo on multisocket config
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
shirou b60e8d1895
Merge pull request #1081 from tklauser/process-sysconf-clk-tck
process, v3/process: use SC_CLK_TCK sysconf value instead of hard-coding clock ticks
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 e42c52cb35 [process][linux] add test for missing iotime in SmartOS lx containers 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 d5e9031b2a
Merge pull request #1079 from shirou/feature/fix_1056_tests_and_copy_to_v2
[process][linux] fix 1056 test and copy to v2
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 2782a109dc
Merge pull request #1010 from gdbinit/openbsd-wrong-users-number-patch
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