Commit Graph

1763 Commits

Author SHA1 Message Date
Tobias Klauser aacbba22ae Use unix.SysctlUvmexp on OpenBSD
Use SysctlUvmexp from golang.org/x/sys/unix to avoid having to define
the type Uvmexp and the sysctl consts. This will also allow to build on
GOOS=openbsd with e.g. GOARCH=arm64.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-08-31 12:38:11 +02:00
Lomanic c4663018cc
Merge pull request #923 from disconnect3d/patch-2
net_linux.go: decode port as uint16 instead of int64
2020-08-30 18:43:20 +02:00
Lomanic d9f9a85e75
Merge pull request #924 from nightmared/fix-utf16-windows
fix an invalid shift in windows processes name UTF16 conversion
2020-08-29 18:52:44 +02:00
Lomanic ab084b525c [net] Skip tests on non-implemented platforms #446 2020-08-29 18:39:50 +02:00
Lomanic ea86cbc3ff [mem] Skip tests on non-implemented platforms #446 2020-08-29 18:39:50 +02:00
Lomanic 78a65a67a9 [load] Skip tests on non-implemented platforms #446 2020-08-29 18:39:50 +02:00
Lomanic 8110480793 [host] Skip tests on non-implemented platforms #446 2020-08-29 18:39:44 +02:00
Lomanic b7781f5858 [disk] Skip tests on non-implemented platforms #446 2020-08-29 18:29:36 +02:00
Lomanic 38f6ed0e0c [cpu] Skip tests on non-implemented platforms #446 2020-08-29 18:29:04 +02:00
Disconnect3d 5c1a9e709d net_linux.go: decode port as 16-bit uint
Changes the port parsing from `/proc/net/*` files records from parsing them as 64-bit integers to parse them as 16-bit unsigned integers.

While this is mostly a cosmetic change, it will also make so that the code fails faster in case the entry is malformed (for whatever reason).

Note that the returned value is still casted to uint32 when an  `Addr` object is created.
It seems to me that the `Addr.port` field should be changed to `uint16` but maybe some other APIs/systems wants it to be `uint32` and also changing it there may require changes in users code if they update. This being said I am not changing that field's type.
2020-08-28 00:31:50 +02:00
Simon Thoby 04a6f81e9f fix an invalid shift in windows processes name UTF16 conversion 2020-08-25 11:59:41 +02:00
Justin Kolberg 53ffb0cece Add support for Darwin/ARM64
Signed-off-by: Justin Kolberg <amd.prophet@gmail.com>
2020-08-10 21:26:24 -07:00
shirou 7e94bb8bcd
Merge pull request #775 from TakayukiBGoto/add_additional_gids_support
[Process] Implement Groups() to get additional gids.
2020-07-24 22:09:41 +09:00
shirou 4e6138ae09
Merge pull request #901 from nightmared/expose-available-memory-as-free-win
Set the 'free' memory value to the 'available' memory on windows
2020-07-24 14:00:27 +09:00
shirou bbcb80cd3f
Merge pull request #891 from tribes/master
[process][windows] implement suspending and resuming with ntdll library
2020-07-24 13:56:50 +09:00
shirou efc768ada6
Merge pull request #898 from tyldavis/master
Fix MemoryMaps on ARM
2020-07-24 12:39:17 +09:00
shirou 7a4809ba68
Merge pull request #908 from tklauser/host-bsd-boottime
Use common implementation for BootTime/Uptime on all BSDs
2020-07-24 12:34:48 +09:00
Tobias Klauser 28890b0482 Use common implementation for BootTime/Uptime on all BSDs
All BSDs use the same implementation to get BootTime{,WithContext} and
Uptime{,WithContext} based on the kern.boottime sysctl. Move this
implementation to a separate host/host_bsd.go file shared by darwin,
freebsd and openbsd. Also use SysctlTimeval to get
the boot time directly as a type Timeval instead of manually
extracting it using package unsafe. It will also allow for easier reuse
to support package host on e.g. Dragonfly BSD or NetBSD.

This requires updating the golang.org/x/sys/unix dependency to the
latest revision.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-07-23 13:23:20 +02:00
Simon Thoby 3b64944534 Set the 'free' memory value to the 'available' memory on windows 2020-07-09 17:14:33 +02:00
Tyler Davis 8d28f1b305 Clean up boolean condition 2020-07-07 18:02:06 +10:00
Tyler Davis 9473d01f0f Fix MemoryMaps on ARM
ARM has some tab characters in smaps instead of spaces, hence switching to strings.Fields instead of strings.Split which handles splitting on all whitespace instead of just spaces.
2020-07-07 15:02:10 +10:00
shirou 6d64cd6d43
Merge pull request #882 from james-bebbington/mem-linux-pgmajfault
Add pgmajfault to data returned by vmstat on Linux
2020-07-07 11:26:29 +09:00
James Bebbington 28b2246b5b Add processes created to misc stats 2020-07-02 11:40:58 +10:00
James Bebbington 61cb122a84
Added comment noting that PgMajFault is Linux specific 2020-07-01 22:21:38 +10:00
shirou 10a398abdd add RISC-V and DragonFlyBSD to partial support. 2020-06-30 21:04:21 +09:00
shirou c8251cf603
Merge pull request #896 from tklauser/host-linux-riscv64-support
Add linux/riscv64 support
2020-06-30 21:14:54 +09:00
Tobias Klauser 1934eadfcb Add linux/riscv64 build test 2020-06-30 11:34:17 +02:00
Tobias Klauser 1e61ed79fa host: add support for linux/riscv64 2020-06-30 11:34:17 +02:00
shirou 01afd763e6
Merge pull request #893 from gballet/cpu-add-dragonflybsd-support
cpu: support for DragonflyBSD
2020-06-30 18:15:42 +09:00
shirou 7d13aa15fc
Merge pull request #895 from tklauser/freebsd-statvfs-type
Fix FreeBSD build with latest x/sys/unix
2020-06-30 18:12:32 +09:00
Tobias Klauser d5eecd689d Fix FreeBSD build with latest x/sys/unix
There was a breaking change in upstream golang.org/x/sys/unix which
changed the type of some Statvfs members, see #853. As it looks like
this change won't be reverted, adjust gopsutil to work with it and allow
to build against the latest version of x/sys/unix.
2020-06-22 23:41:01 +02:00
Guillaume Ballet baec973ff6 Fix stepping extraction 2020-06-22 13:03:18 +02:00
Guillaume Ballet 877e0a6603 more typo fixes 2020-06-22 11:59:22 +02:00
Guillaume Ballet 8968457048 fix typo 2020-06-22 11:56:02 +02:00
Guillaume Ballet 771601b292 use sysctl instead of parsing dmesg output 2020-06-22 11:54:44 +02:00
shirou b806400ff0
Merge pull request #894 from citruspi/improved-lxc-guest-discovery
LXC Guest Detection from Environ Procfile
2020-06-21 21:36:49 +09:00
Guillaume Ballet 9390667f0f
Update cpu/cpu_dragonfly.go
Co-authored-by: shirou <shirou.faw@gmail.com>
2020-06-21 12:21:18 +02:00
Mihir Singh 92d6df6d8f Attempted LXC guest detection from environ procfile 2020-06-21 09:13:34 +00:00
Guillaume Ballet 56d9e0b7be cpu: support for DragonflyBSD 2020-06-18 10:17:23 +02:00
Merwan Ouddane f459195bc0 [process][windows] implement suspending and resuming with ntdll library 2020-06-17 21:21:14 +02:00
Lomanic 6f7ec36749
Merge pull request #888 from Lomanic/issue853-pin-sys
[disk][freebsd] Work around #853, pin x/sys with dep to the hash just before upstream breaking change
2020-06-06 14:31:49 +02:00
Lomanic ca4849b710
Merge pull request #889 from Lomanic/issue832
[darwin][disk][host] Move C dependencies to satisfy go mod and have descriptive file names
2020-06-06 11:55:04 +02:00
Lomanic 5aca383d4f [disk][darwin][cgo] Rename C files dependencies to more descriptive names 2020-05-31 20:41:48 +02:00
Lomanic 42c6875555 [host][darwin][cgo] Fix #832 work around once-again broken go modules not including C files
Supersedes #885 by @afontaine
2020-05-31 20:40:36 +02:00
Lomanic e9ecebec5a [disk][freebsd] Work around #853, pin x/sys with dep to the hash just before upstream breaking change 2020-05-31 20:36:42 +02:00
Lomanic 663af789c0
Merge pull request #872 from renaynay/update-docs-cputimes
Update docs for TimesStat with correct time unit
2020-05-31 17:11:28 +02:00
Lomanic a901d160ca
Merge pull request #870 from renaynay/naming-consistency
Renamed variables storing `CLK_TCK` value for consistency across OSs
2020-05-31 17:01:13 +02:00
Lomanic a303ddc7d1
Merge pull request #880 from Lomanic/issue867
[process][darwin][nocgo] Fix #867 iterate on every lines returned by lsof to handle potential warnings
2020-05-31 10:18:36 +02:00
James Bebbington 16fdb92bfc Add pgmajfault to data returned by vmstat on Linux 2020-05-25 17:15:30 +10:00
Lomanic 42aec722ba
Merge pull request #878 from fancybits/android-loadavg
[load][linux] implement Avg() on top of sysinfo syscall when /proc/loadavg is not readable
2020-05-21 18:14:56 +02:00