From bb5a7fc92247131fd743cf507120e2338a47fcc0 Mon Sep 17 00:00:00 2001 From: Carson Long <12767276+ctlong@users.noreply.github.com> Date: Wed, 31 Jul 2024 22:30:36 +0000 Subject: [PATCH] Bump github.com/shirou/gopsutil to v4 Signed-off-by: Andrew Costa --- src/go.mod | 2 +- src/go.sum | 4 +- src/internal/gateway/gateway.go | 2 +- .../gopsutil/v3/host/host_darwin_cgo.go | 47 ----- .../gopsutil/v3/host/host_darwin_nocgo.go | 14 -- .../shirou/gopsutil/v3/host/smc_darwin.c | 169 ------------------ .../shirou/gopsutil/v3/host/smc_darwin.h | 32 ---- .../shirou/gopsutil/v3/net/net_linux_111.go | 12 -- .../shirou/gopsutil/v3/net/net_linux_116.go | 12 -- .../shirou/gopsutil/{v3 => v4}/LICENSE | 0 .../shirou/gopsutil/{v3 => v4}/common/env.go | 1 + .../shirou/gopsutil/{v3 => v4}/cpu/cpu.go | 3 +- .../shirou/gopsutil/{v3 => v4}/cpu/cpu_aix.go | 2 +- .../gopsutil/{v3 => v4}/cpu/cpu_aix_cgo.go | 2 +- .../gopsutil/{v3 => v4}/cpu/cpu_aix_nocgo.go | 4 +- .../gopsutil/{v3 => v4}/cpu/cpu_darwin.go | 2 +- .../gopsutil/{v3 => v4}/cpu/cpu_darwin_cgo.go | 2 +- .../{v3 => v4}/cpu/cpu_darwin_nocgo.go | 4 +- .../gopsutil/{v3 => v4}/cpu/cpu_dragonfly.go | 3 +- .../{v3 => v4}/cpu/cpu_dragonfly_amd64.go | 1 + .../gopsutil/{v3 => v4}/cpu/cpu_fallback.go | 4 +- .../gopsutil/{v3 => v4}/cpu/cpu_freebsd.go | 3 +- .../{v3 => v4}/cpu/cpu_freebsd_386.go | 1 + .../{v3 => v4}/cpu/cpu_freebsd_amd64.go | 1 + .../{v3 => v4}/cpu/cpu_freebsd_arm.go | 1 + .../{v3 => v4}/cpu/cpu_freebsd_arm64.go | 1 + .../gopsutil/{v3 => v4}/cpu/cpu_linux.go | 4 +- .../gopsutil/{v3 => v4}/cpu/cpu_netbsd.go | 4 +- .../{v3 => v4}/cpu/cpu_netbsd_amd64.go | 1 + .../{v3 => v4}/cpu/cpu_netbsd_arm64.go | 1 + .../gopsutil/{v3 => v4}/cpu/cpu_openbsd.go | 4 +- .../{v3 => v4}/cpu/cpu_openbsd_386.go | 1 + .../{v3 => v4}/cpu/cpu_openbsd_amd64.go | 1 + .../{v3 => v4}/cpu/cpu_openbsd_arm.go | 1 + .../{v3 => v4}/cpu/cpu_openbsd_arm64.go | 1 + .../{v3 => v4}/cpu/cpu_openbsd_riscv64.go | 1 + .../gopsutil/{v3 => v4}/cpu/cpu_plan9.go | 4 +- .../gopsutil/{v3 => v4}/cpu/cpu_solaris.go | 1 + .../gopsutil/{v3 => v4}/cpu/cpu_windows.go | 8 +- .../shirou/gopsutil/{v3 => v4}/host/host.go | 19 +- .../gopsutil/{v3 => v4}/host/host_aix.go | 96 +++++----- .../{v3 => v4}/host/host_aix_ppc64.go | 0 .../gopsutil/{v3 => v4}/host/host_bsd.go | 2 +- .../gopsutil/{v3 => v4}/host/host_darwin.go | 6 +- .../{v3 => v4}/host/host_darwin_amd64.go | 1 + .../{v3 => v4}/host/host_darwin_arm64.go | 2 +- .../gopsutil/{v3 => v4}/host/host_fallback.go | 8 +- .../gopsutil/{v3 => v4}/host/host_freebsd.go | 10 +- .../{v3 => v4}/host/host_freebsd_386.go | 1 + .../{v3 => v4}/host/host_freebsd_amd64.go | 1 + .../{v3 => v4}/host/host_freebsd_arm.go | 1 + .../{v3 => v4}/host/host_freebsd_arm64.go | 2 +- .../gopsutil/{v3 => v4}/host/host_linux.go | 152 +--------------- .../{v3 => v4}/host/host_linux_386.go | 1 + .../{v3 => v4}/host/host_linux_amd64.go | 1 + .../{v3 => v4}/host/host_linux_arm.go | 1 + .../{v3 => v4}/host/host_linux_arm64.go | 2 +- .../{v3 => v4}/host/host_linux_loong64.go | 2 +- .../{v3 => v4}/host/host_linux_mips.go | 1 + .../{v3 => v4}/host/host_linux_mips64.go | 1 + .../{v3 => v4}/host/host_linux_mips64le.go | 1 + .../{v3 => v4}/host/host_linux_mipsle.go | 1 + .../{v3 => v4}/host/host_linux_ppc64.go | 2 +- .../{v3 => v4}/host/host_linux_ppc64le.go | 2 +- .../{v3 => v4}/host/host_linux_riscv64.go | 1 + .../{v3 => v4}/host/host_linux_s390x.go | 2 +- .../gopsutil/{v3 => v4}/host/host_netbsd.go | 8 +- .../gopsutil/{v3 => v4}/host/host_openbsd.go | 10 +- .../{v3 => v4}/host/host_openbsd_386.go | 2 +- .../{v3 => v4}/host/host_openbsd_amd64.go | 1 + .../{v3 => v4}/host/host_openbsd_arm.go | 2 +- .../{v3 => v4}/host/host_openbsd_arm64.go | 2 +- .../{v3 => v4}/host/host_openbsd_riscv64.go | 2 +- .../gopsutil/{v3 => v4}/host/host_posix.go | 2 +- .../gopsutil/{v3 => v4}/host/host_solaris.go | 44 +---- .../gopsutil/{v3 => v4}/host/host_windows.go | 62 +++---- .../{v3 => v4}/internal/common/binary.go | 1 + .../{v3 => v4}/internal/common/common.go | 3 +- .../internal/common/common_darwin.go | 2 +- .../internal/common/common_freebsd.go | 2 +- .../internal/common/common_linux.go | 7 +- .../internal/common/common_netbsd.go | 2 +- .../internal/common/common_openbsd.go | 2 +- .../{v3 => v4}/internal/common/common_unix.go | 2 +- .../internal/common/common_windows.go | 2 +- .../{v3 => v4}/internal/common/endian.go | 1 + .../{v3 => v4}/internal/common/sleep.go | 1 + .../{v3 => v4}/internal/common/warnings.go | 1 + .../shirou/gopsutil/v4/mem/ex_linux.go | 40 +++++ .../shirou/gopsutil/v4/mem/ex_windows.go | 39 ++++ .../shirou/gopsutil/{v3 => v4}/mem/mem.go | 3 +- .../shirou/gopsutil/{v3 => v4}/mem/mem_aix.go | 2 +- .../gopsutil/{v3 => v4}/mem/mem_aix_cgo.go | 2 +- .../gopsutil/{v3 => v4}/mem/mem_aix_nocgo.go | 4 +- .../shirou/gopsutil/{v3 => v4}/mem/mem_bsd.go | 2 +- .../gopsutil/{v3 => v4}/mem/mem_darwin.go | 4 +- .../gopsutil/{v3 => v4}/mem/mem_darwin_cgo.go | 2 +- .../{v3 => v4}/mem/mem_darwin_nocgo.go | 2 +- .../gopsutil/{v3 => v4}/mem/mem_fallback.go | 4 +- .../gopsutil/{v3 => v4}/mem/mem_freebsd.go | 4 +- .../gopsutil/{v3 => v4}/mem/mem_linux.go | 36 +--- .../gopsutil/{v3 => v4}/mem/mem_netbsd.go | 2 +- .../gopsutil/{v3 => v4}/mem/mem_openbsd.go | 4 +- .../{v3 => v4}/mem/mem_openbsd_386.go | 2 +- .../{v3 => v4}/mem/mem_openbsd_amd64.go | 1 + .../{v3 => v4}/mem/mem_openbsd_arm.go | 2 +- .../{v3 => v4}/mem/mem_openbsd_arm64.go | 2 +- .../{v3 => v4}/mem/mem_openbsd_riscv64.go | 2 +- .../gopsutil/{v3 => v4}/mem/mem_plan9.go | 4 +- .../gopsutil/{v3 => v4}/mem/mem_solaris.go | 4 +- .../gopsutil/{v3 => v4}/mem/mem_windows.go | 4 +- .../shirou/gopsutil/{v3 => v4}/net/net.go | 3 +- .../shirou/gopsutil/{v3 => v4}/net/net_aix.go | 4 +- .../gopsutil/{v3 => v4}/net/net_aix_cgo.go | 2 +- .../gopsutil/{v3 => v4}/net/net_aix_nocgo.go | 4 +- .../gopsutil/{v3 => v4}/net/net_darwin.go | 4 +- .../gopsutil/{v3 => v4}/net/net_fallback.go | 4 +- .../gopsutil/{v3 => v4}/net/net_freebsd.go | 4 +- .../gopsutil/{v3 => v4}/net/net_linux.go | 6 +- .../gopsutil/{v3 => v4}/net/net_openbsd.go | 7 +- .../gopsutil/{v3 => v4}/net/net_solaris.go | 4 +- .../gopsutil/{v3 => v4}/net/net_unix.go | 4 +- .../gopsutil/{v3 => v4}/net/net_windows.go | 4 +- .../gopsutil/{v3 => v4}/process/process.go | 33 ++-- .../{v3 => v4}/process/process_bsd.go | 6 +- .../{v3 => v4}/process/process_darwin.go | 20 +-- .../process/process_darwin_amd64.go | 1 + .../process/process_darwin_arm64.go | 2 +- .../{v3 => v4}/process/process_darwin_cgo.go | 4 +- .../process/process_darwin_nocgo.go | 6 +- .../{v3 => v4}/process/process_fallback.go | 14 +- .../{v3 => v4}/process/process_freebsd.go | 26 +-- .../{v3 => v4}/process/process_freebsd_386.go | 1 + .../process/process_freebsd_amd64.go | 1 + .../{v3 => v4}/process/process_freebsd_arm.go | 1 + .../process/process_freebsd_arm64.go | 1 + .../{v3 => v4}/process/process_linux.go | 40 +++-- .../{v3 => v4}/process/process_openbsd.go | 28 +-- .../{v3 => v4}/process/process_openbsd_386.go | 2 +- .../process/process_openbsd_amd64.go | 1 + .../{v3 => v4}/process/process_openbsd_arm.go | 2 +- .../process/process_openbsd_arm64.go | 2 +- .../process/process_openbsd_riscv64.go | 2 +- .../{v3 => v4}/process/process_plan9.go | 14 +- .../{v3 => v4}/process/process_posix.go | 4 +- .../{v3 => v4}/process/process_solaris.go | 13 +- .../{v3 => v4}/process/process_windows.go | 14 +- .../process/process_windows_32bit.go | 4 +- .../process/process_windows_64bit.go | 4 +- src/vendor/modules.txt | 16 +- 150 files changed, 460 insertions(+), 864 deletions(-) delete mode 100644 src/vendor/github.com/shirou/gopsutil/v3/host/host_darwin_cgo.go delete mode 100644 src/vendor/github.com/shirou/gopsutil/v3/host/host_darwin_nocgo.go delete mode 100644 src/vendor/github.com/shirou/gopsutil/v3/host/smc_darwin.c delete mode 100644 src/vendor/github.com/shirou/gopsutil/v3/host/smc_darwin.h delete mode 100644 src/vendor/github.com/shirou/gopsutil/v3/net/net_linux_111.go delete mode 100644 src/vendor/github.com/shirou/gopsutil/v3/net/net_linux_116.go rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/LICENSE (100%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/common/env.go (94%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_aix.go (85%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_aix_cgo.go (96%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_aix_nocgo.go (97%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_darwin.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_darwin_cgo.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_darwin_nocgo.go (71%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_dragonfly.go (97%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_dragonfly_amd64.go (71%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_fallback.go (83%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_freebsd.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_freebsd_386.go (71%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_freebsd_amd64.go (71%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_freebsd_arm.go (71%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_freebsd_arm64.go (71%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_linux.go (99%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_netbsd.go (96%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_netbsd_amd64.go (71%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_netbsd_arm64.go (71%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_openbsd.go (96%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_openbsd_386.go (73%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_openbsd_amd64.go (73%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_openbsd_arm.go (73%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_openbsd_arm64.go (73%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_openbsd_riscv64.go (73%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_plan9.go (91%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_solaris.go (99%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/cpu/cpu_windows.go (97%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host.go (90%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_aix.go (70%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_aix_ppc64.go (100%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_bsd.go (94%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_darwin.go (95%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_darwin_amd64.go (88%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_darwin_arm64.go (89%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_fallback.go (80%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_freebsd.go (92%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_freebsd_386.go (92%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_freebsd_amd64.go (92%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_freebsd_arm.go (92%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_freebsd_arm64.go (93%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_linux.go (70%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_linux_386.go (95%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_linux_amd64.go (95%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_linux_arm.go (95%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_linux_arm64.go (95%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_linux_loong64.go (95%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_linux_mips.go (94%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_linux_mips64.go (94%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_linux_mips64le.go (94%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_linux_mipsle.go (94%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_linux_ppc64.go (95%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_linux_ppc64le.go (95%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_linux_riscv64.go (95%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_linux_s390x.go (95%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_netbsd.go (83%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_openbsd.go (88%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_openbsd_386.go (92%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_openbsd_amd64.go (91%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_openbsd_arm.go (92%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_openbsd_arm64.go (92%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_openbsd_riscv64.go (92%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_posix.go (84%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_solaris.go (80%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/host/host_windows.go (88%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/internal/common/binary.go (99%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/internal/common/common.go (99%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/internal/common/common_darwin.go (97%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/internal/common/common_freebsd.go (97%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/internal/common/common_linux.go (99%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/internal/common/common_netbsd.go (96%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/internal/common/common_openbsd.go (96%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/internal/common/common_unix.go (97%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/internal/common/common_windows.go (99%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/internal/common/endian.go (88%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/internal/common/sleep.go (89%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/internal/common/warnings.go (92%) create mode 100644 src/vendor/github.com/shirou/gopsutil/v4/mem/ex_linux.go create mode 100644 src/vendor/github.com/shirou/gopsutil/v4/mem/ex_windows.go rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem.go (97%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_aix.go (86%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_aix_cgo.go (97%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_aix_nocgo.go (95%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_bsd.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_darwin.go (94%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_darwin_cgo.go (97%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_darwin_nocgo.go (97%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_fallback.go (86%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_freebsd.go (97%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_linux.go (93%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_netbsd.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_openbsd.go (96%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_openbsd_386.go (93%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_openbsd_amd64.go (92%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_openbsd_arm.go (93%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_openbsd_arm64.go (93%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_openbsd_riscv64.go (94%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_plan9.go (95%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_solaris.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/mem/mem_windows.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/net/net.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/net/net_aix.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/net/net_aix_cgo.go (95%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/net/net_aix_nocgo.go (95%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/net/net_darwin.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/net/net_fallback.go (96%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/net/net_freebsd.go (97%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/net/net_linux.go (99%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/net/net_openbsd.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/net/net_solaris.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/net/net_unix.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/net/net_windows.go (99%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process.go (94%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_bsd.go (94%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_darwin.go (92%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_darwin_amd64.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_darwin_arm64.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_darwin_cgo.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_darwin_nocgo.go (96%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_fallback.go (93%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_freebsd.go (90%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_freebsd_386.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_freebsd_amd64.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_freebsd_arm.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_freebsd_arm64.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_linux.go (97%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_openbsd.go (91%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_openbsd_386.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_openbsd_amd64.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_openbsd_arm.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_openbsd_arm64.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_openbsd_riscv64.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_plan9.go (93%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_posix.go (97%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_solaris.go (95%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_windows.go (98%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_windows_32bit.go (97%) rename src/vendor/github.com/shirou/gopsutil/{v3 => v4}/process/process_windows_64bit.go (95%) diff --git a/src/go.mod b/src/go.mod index 640950c45..8934a2e7c 100644 --- a/src/go.mod +++ b/src/go.mod @@ -24,7 +24,6 @@ require ( github.com/prometheus/client_model v0.6.1 github.com/prometheus/common v0.55.0 github.com/prometheus/prometheus v1.99.0 - github.com/shirou/gopsutil/v3 v3.24.5 golang.org/x/net v0.27.0 google.golang.org/grpc v1.65.0 google.golang.org/protobuf v1.34.2 @@ -34,6 +33,7 @@ require ( code.cloudfoundry.org/go-log-cache/v3 v3.0.1 code.cloudfoundry.org/go-loggregator/v10 v10.0.0 github.com/go-chi/chi/v5 v5.1.0 + github.com/shirou/gopsutil/v4 v4.24.6 ) require ( diff --git a/src/go.sum b/src/go.sum index 535b2ee8d..26972f419 100644 --- a/src/go.sum +++ b/src/go.sum @@ -378,8 +378,8 @@ github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFo github.com/samuel/go-zookeeper v0.0.0-20190810000440-0ceca61e4d75/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/satori/go.uuid v0.0.0-20160603004225-b111a074d5ef/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= -github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= +github.com/shirou/gopsutil/v4 v4.24.6 h1:9qqCSYF2pgOU+t+NgJtp7Co5+5mHF/HyKBUckySQL64= +github.com/shirou/gopsutil/v4 v4.24.6/go.mod h1:aoebb2vxetJ/yIDZISmduFvVNPHqXQ9SEJwRXxkf0RA= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= diff --git a/src/internal/gateway/gateway.go b/src/internal/gateway/gateway.go index 649bfc6cb..a307e9a61 100644 --- a/src/internal/gateway/gateway.go +++ b/src/internal/gateway/gateway.go @@ -9,7 +9,7 @@ import ( "time" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "github.com/shirou/gopsutil/v3/host" + "github.com/shirou/gopsutil/v4/host" "golang.org/x/net/context" "google.golang.org/grpc" "google.golang.org/grpc/status" diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_darwin_cgo.go b/src/vendor/github.com/shirou/gopsutil/v3/host/host_darwin_cgo.go deleted file mode 100644 index ffdc7b78f..000000000 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_darwin_cgo.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build darwin && cgo -// +build darwin,cgo - -package host - -// #cgo LDFLAGS: -framework IOKit -// #include "smc_darwin.h" -import "C" -import "context" - -func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, error) { - temperatureKeys := []string{ - C.AMBIENT_AIR_0, - C.AMBIENT_AIR_1, - C.CPU_0_DIODE, - C.CPU_0_HEATSINK, - C.CPU_0_PROXIMITY, - C.ENCLOSURE_BASE_0, - C.ENCLOSURE_BASE_1, - C.ENCLOSURE_BASE_2, - C.ENCLOSURE_BASE_3, - C.GPU_0_DIODE, - C.GPU_0_HEATSINK, - C.GPU_0_PROXIMITY, - C.HARD_DRIVE_BAY, - C.MEMORY_SLOT_0, - C.MEMORY_SLOTS_PROXIMITY, - C.NORTHBRIDGE, - C.NORTHBRIDGE_DIODE, - C.NORTHBRIDGE_PROXIMITY, - C.THUNDERBOLT_0, - C.THUNDERBOLT_1, - C.WIRELESS_MODULE, - } - var temperatures []TemperatureStat - - C.gopsutil_v3_open_smc() - defer C.gopsutil_v3_close_smc() - - for _, key := range temperatureKeys { - temperatures = append(temperatures, TemperatureStat{ - SensorKey: key, - Temperature: float64(C.gopsutil_v3_get_temperature(C.CString(key))), - }) - } - return temperatures, nil -} diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_darwin_nocgo.go b/src/vendor/github.com/shirou/gopsutil/v3/host/host_darwin_nocgo.go deleted file mode 100644 index 6285ba94d..000000000 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_darwin_nocgo.go +++ /dev/null @@ -1,14 +0,0 @@ -//go:build darwin && !cgo -// +build darwin,!cgo - -package host - -import ( - "context" - - "github.com/shirou/gopsutil/v3/internal/common" -) - -func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, error) { - return []TemperatureStat{}, common.ErrNotImplementedError -} diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/smc_darwin.c b/src/vendor/github.com/shirou/gopsutil/v3/host/smc_darwin.c deleted file mode 100644 index 0197d95b4..000000000 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/smc_darwin.c +++ /dev/null @@ -1,169 +0,0 @@ -#include -#include -#include "smc_darwin.h" - -#define IOSERVICE_SMC "AppleSMC" -#define IOSERVICE_MODEL "IOPlatformExpertDevice" - -#define DATA_TYPE_SP78 "sp78" - -typedef enum { - kSMCUserClientOpen = 0, - kSMCUserClientClose = 1, - kSMCHandleYPCEvent = 2, - kSMCReadKey = 5, - kSMCWriteKey = 6, - kSMCGetKeyCount = 7, - kSMCGetKeyFromIndex = 8, - kSMCGetKeyInfo = 9, -} selector_t; - -typedef struct { - unsigned char major; - unsigned char minor; - unsigned char build; - unsigned char reserved; - unsigned short release; -} SMCVersion; - -typedef struct { - uint16_t version; - uint16_t length; - uint32_t cpuPLimit; - uint32_t gpuPLimit; - uint32_t memPLimit; -} SMCPLimitData; - -typedef struct { - IOByteCount data_size; - uint32_t data_type; - uint8_t data_attributes; -} SMCKeyInfoData; - -typedef struct { - uint32_t key; - SMCVersion vers; - SMCPLimitData p_limit_data; - SMCKeyInfoData key_info; - uint8_t result; - uint8_t status; - uint8_t data8; - uint32_t data32; - uint8_t bytes[32]; -} SMCParamStruct; - -typedef enum { - kSMCSuccess = 0, - kSMCError = 1, - kSMCKeyNotFound = 0x84, -} kSMC_t; - -typedef struct { - uint8_t data[32]; - uint32_t data_type; - uint32_t data_size; - kSMC_t kSMC; -} smc_return_t; - -static const int SMC_KEY_SIZE = 4; // number of characters in an SMC key. -static io_connect_t conn; // our connection to the SMC. - -kern_return_t gopsutil_v3_open_smc(void) { - kern_return_t result; - io_service_t service; - - service = IOServiceGetMatchingService(0, IOServiceMatching(IOSERVICE_SMC)); - if (service == 0) { - // Note: IOServiceMatching documents 0 on failure - printf("ERROR: %s NOT FOUND\n", IOSERVICE_SMC); - return kIOReturnError; - } - - result = IOServiceOpen(service, mach_task_self(), 0, &conn); - IOObjectRelease(service); - - return result; -} - -kern_return_t gopsutil_v3_close_smc(void) { return IOServiceClose(conn); } - -static uint32_t to_uint32(char *key) { - uint32_t ans = 0; - uint32_t shift = 24; - - if (strlen(key) != SMC_KEY_SIZE) { - return 0; - } - - for (int i = 0; i < SMC_KEY_SIZE; i++) { - ans += key[i] << shift; - shift -= 8; - } - - return ans; -} - -static kern_return_t call_smc(SMCParamStruct *input, SMCParamStruct *output) { - kern_return_t result; - size_t input_cnt = sizeof(SMCParamStruct); - size_t output_cnt = sizeof(SMCParamStruct); - - result = IOConnectCallStructMethod(conn, kSMCHandleYPCEvent, input, input_cnt, - output, &output_cnt); - - if (result != kIOReturnSuccess) { - result = err_get_code(result); - } - return result; -} - -static kern_return_t read_smc(char *key, smc_return_t *result_smc) { - kern_return_t result; - SMCParamStruct input; - SMCParamStruct output; - - memset(&input, 0, sizeof(SMCParamStruct)); - memset(&output, 0, sizeof(SMCParamStruct)); - memset(result_smc, 0, sizeof(smc_return_t)); - - input.key = to_uint32(key); - input.data8 = kSMCGetKeyInfo; - - result = call_smc(&input, &output); - result_smc->kSMC = output.result; - - if (result != kIOReturnSuccess || output.result != kSMCSuccess) { - return result; - } - - result_smc->data_size = output.key_info.data_size; - result_smc->data_type = output.key_info.data_type; - - input.key_info.data_size = output.key_info.data_size; - input.data8 = kSMCReadKey; - - result = call_smc(&input, &output); - result_smc->kSMC = output.result; - - if (result != kIOReturnSuccess || output.result != kSMCSuccess) { - return result; - } - - memcpy(result_smc->data, output.bytes, sizeof(output.bytes)); - - return result; -} - -double gopsutil_v3_get_temperature(char *key) { - kern_return_t result; - smc_return_t result_smc; - - result = read_smc(key, &result_smc); - - if (!(result == kIOReturnSuccess) && result_smc.data_size == 2 && - result_smc.data_type == to_uint32(DATA_TYPE_SP78)) { - return 0.0; - } - - return (double)result_smc.data[0]; -} diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/smc_darwin.h b/src/vendor/github.com/shirou/gopsutil/v3/host/smc_darwin.h deleted file mode 100644 index e3013abdb..000000000 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/smc_darwin.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef __SMC_H__ -#define __SMC_H__ 1 - -#include - -#define AMBIENT_AIR_0 "TA0P" -#define AMBIENT_AIR_1 "TA1P" -#define CPU_0_DIODE "TC0D" -#define CPU_0_HEATSINK "TC0H" -#define CPU_0_PROXIMITY "TC0P" -#define ENCLOSURE_BASE_0 "TB0T" -#define ENCLOSURE_BASE_1 "TB1T" -#define ENCLOSURE_BASE_2 "TB2T" -#define ENCLOSURE_BASE_3 "TB3T" -#define GPU_0_DIODE "TG0D" -#define GPU_0_HEATSINK "TG0H" -#define GPU_0_PROXIMITY "TG0P" -#define HARD_DRIVE_BAY "TH0P" -#define MEMORY_SLOT_0 "TM0S" -#define MEMORY_SLOTS_PROXIMITY "TM0P" -#define NORTHBRIDGE "TN0H" -#define NORTHBRIDGE_DIODE "TN0D" -#define NORTHBRIDGE_PROXIMITY "TN0P" -#define THUNDERBOLT_0 "TI0P" -#define THUNDERBOLT_1 "TI1P" -#define WIRELESS_MODULE "TW0P" - -kern_return_t gopsutil_v3_open_smc(void); -kern_return_t gopsutil_v3_close_smc(void); -double gopsutil_v3_get_temperature(char *); - -#endif // __SMC_H__ diff --git a/src/vendor/github.com/shirou/gopsutil/v3/net/net_linux_111.go b/src/vendor/github.com/shirou/gopsutil/v3/net/net_linux_111.go deleted file mode 100644 index bd5c95871..000000000 --- a/src/vendor/github.com/shirou/gopsutil/v3/net/net_linux_111.go +++ /dev/null @@ -1,12 +0,0 @@ -//go:build !go1.16 -// +build !go1.16 - -package net - -import ( - "os" -) - -func readDir(f *os.File, max int) ([]os.FileInfo, error) { - return f.Readdir(max) -} diff --git a/src/vendor/github.com/shirou/gopsutil/v3/net/net_linux_116.go b/src/vendor/github.com/shirou/gopsutil/v3/net/net_linux_116.go deleted file mode 100644 index a45072e92..000000000 --- a/src/vendor/github.com/shirou/gopsutil/v3/net/net_linux_116.go +++ /dev/null @@ -1,12 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -package net - -import ( - "os" -) - -func readDir(f *os.File, max int) ([]os.DirEntry, error) { - return f.ReadDir(max) -} diff --git a/src/vendor/github.com/shirou/gopsutil/v3/LICENSE b/src/vendor/github.com/shirou/gopsutil/v4/LICENSE similarity index 100% rename from src/vendor/github.com/shirou/gopsutil/v3/LICENSE rename to src/vendor/github.com/shirou/gopsutil/v4/LICENSE diff --git a/src/vendor/github.com/shirou/gopsutil/v3/common/env.go b/src/vendor/github.com/shirou/gopsutil/v4/common/env.go similarity index 94% rename from src/vendor/github.com/shirou/gopsutil/v3/common/env.go rename to src/vendor/github.com/shirou/gopsutil/v4/common/env.go index 4b5f4980c..4acad1fd1 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/common/env.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/common/env.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package common type EnvKeyType string diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu.go index 83bc23d45..56f53c3a1 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu import ( @@ -11,7 +12,7 @@ import ( "sync" "time" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) // TimesStat contains the amounts of time the CPU has spent performing different diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_aix.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_aix.go similarity index 85% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_aix.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_aix.go index 1439d1d79..bc766bd4f 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_aix.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_aix.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix -// +build aix package cpu diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_aix_cgo.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_aix_cgo.go similarity index 96% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_aix_cgo.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_aix_cgo.go index 9c1e70b17..559dc5fea 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_aix_cgo.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_aix_cgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix && cgo -// +build aix,cgo package cpu diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_aix_nocgo.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_aix_nocgo.go similarity index 97% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_aix_nocgo.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_aix_nocgo.go index f3a3186aa..329ef8336 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_aix_nocgo.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_aix_nocgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix && !cgo -// +build aix,!cgo package cpu @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_darwin.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_darwin.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_darwin.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_darwin.go index 41f395e5e..79a458b8e 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_darwin.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_darwin.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin -// +build darwin package cpu diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_darwin_cgo.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_darwin_cgo.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_darwin_cgo.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_darwin_cgo.go index 1d5f0772e..3a02024c5 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_darwin_cgo.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_darwin_cgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && cgo -// +build darwin,cgo package cpu diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_darwin_nocgo.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_darwin_nocgo.go similarity index 71% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_darwin_nocgo.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_darwin_nocgo.go index e067e99f9..1af8566a6 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_darwin_nocgo.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_darwin_nocgo.go @@ -1,9 +1,9 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && !cgo -// +build darwin,!cgo package cpu -import "github.com/shirou/gopsutil/v3/internal/common" +import "github.com/shirou/gopsutil/v4/internal/common" func perCPUTimes() ([]TimesStat, error) { return []TimesStat{}, common.ErrNotImplementedError diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_dragonfly.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_dragonfly.go similarity index 97% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_dragonfly.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_dragonfly.go index fef53e5dc..19b1e9dd3 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_dragonfly.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_dragonfly.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu import ( @@ -10,7 +11,7 @@ import ( "strings" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "github.com/tklauser/go-sysconf" "golang.org/x/sys/unix" ) diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_dragonfly_amd64.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_dragonfly_amd64.go similarity index 71% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_dragonfly_amd64.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_dragonfly_amd64.go index 57e14528d..25ececa68 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_dragonfly_amd64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_dragonfly_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_fallback.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_fallback.go similarity index 83% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_fallback.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_fallback.go index 089f603c8..245c1ec98 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_fallback.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_fallback.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build !darwin && !linux && !freebsd && !openbsd && !netbsd && !solaris && !windows && !dragonfly && !plan9 && !aix -// +build !darwin,!linux,!freebsd,!openbsd,!netbsd,!solaris,!windows,!dragonfly,!plan9,!aix package cpu @@ -7,7 +7,7 @@ import ( "context" "runtime" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func Times(percpu bool) ([]TimesStat, error) { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd.go index d3f47353c..c68d6bff0 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu import ( @@ -10,7 +11,7 @@ import ( "strings" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "github.com/tklauser/go-sysconf" "golang.org/x/sys/unix" ) diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_386.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd_386.go similarity index 71% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_386.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd_386.go index 8b7f4c321..e4799bcf5 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_386.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd_386.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_amd64.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd_amd64.go similarity index 71% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_amd64.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd_amd64.go index 57e14528d..25ececa68 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_amd64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_arm.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd_arm.go similarity index 71% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_arm.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd_arm.go index 8b7f4c321..e4799bcf5 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_arm.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd_arm.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_arm64.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd_arm64.go similarity index 71% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_arm64.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd_arm64.go index 57e14528d..25ececa68 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_freebsd_arm64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_freebsd_arm64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_linux.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_linux.go similarity index 99% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_linux.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_linux.go index da467e2dd..f78c61a25 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_linux.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_linux.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package cpu @@ -13,7 +13,7 @@ import ( "github.com/tklauser/go-sysconf" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) var ClocksPerSec = float64(100) diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_netbsd.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_netbsd.go similarity index 96% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_netbsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_netbsd.go index 1f66be342..2cda5cd24 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_netbsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_netbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build netbsd -// +build netbsd package cpu @@ -9,7 +9,7 @@ import ( "runtime" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "github.com/tklauser/go-sysconf" "golang.org/x/sys/unix" ) diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_netbsd_amd64.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_netbsd_amd64.go similarity index 71% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_netbsd_amd64.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_netbsd_amd64.go index 57e14528d..25ececa68 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_netbsd_amd64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_netbsd_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_netbsd_arm64.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_netbsd_arm64.go similarity index 71% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_netbsd_arm64.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_netbsd_arm64.go index 57e14528d..25ececa68 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_netbsd_arm64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_netbsd_arm64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd.go similarity index 96% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd.go index fe3329030..33233d3c7 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd -// +build openbsd package cpu @@ -9,7 +9,7 @@ import ( "runtime" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "github.com/tklauser/go-sysconf" "golang.org/x/sys/unix" ) diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_386.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_386.go similarity index 73% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_386.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_386.go index 5e878399a..40a6f43e4 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_386.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_386.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_amd64.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_amd64.go similarity index 73% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_amd64.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_amd64.go index d659058cd..464156d54 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_amd64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_arm.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_arm.go similarity index 73% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_arm.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_arm.go index 5e878399a..40a6f43e4 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_arm.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_arm.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_arm64.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_arm64.go similarity index 73% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_arm64.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_arm64.go index d659058cd..464156d54 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_arm64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_arm64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_riscv64.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_riscv64.go similarity index 73% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_riscv64.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_riscv64.go index d659058cd..464156d54 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_openbsd_riscv64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_openbsd_riscv64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu type cpuTimes struct { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_plan9.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_plan9.go similarity index 91% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_plan9.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_plan9.go index a2e99d8c0..bff2e0c75 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_plan9.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_plan9.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build plan9 -// +build plan9 package cpu @@ -9,7 +9,7 @@ import ( "runtime" stats "github.com/lufia/plan9stats" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func Times(percpu bool) ([]TimesStat, error) { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_solaris.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_solaris.go similarity index 99% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_solaris.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_solaris.go index 4231ad168..d8ba1d324 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_solaris.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_solaris.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package cpu import ( diff --git a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_windows.go b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_windows.go similarity index 97% rename from src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_windows.go rename to src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_windows.go index e10612fd1..4476b91cb 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/cpu/cpu_windows.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/cpu/cpu_windows.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build windows -// +build windows package cpu @@ -8,14 +8,12 @@ import ( "fmt" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "github.com/yusufpapurcu/wmi" "golang.org/x/sys/windows" ) -var ( - procGetNativeSystemInfo = common.Modkernel32.NewProc("GetNativeSystemInfo") -) +var procGetNativeSystemInfo = common.Modkernel32.NewProc("GetNativeSystemInfo") type win32_Processor struct { Family uint16 diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host.go similarity index 90% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host.go index ee9486369..b69d2f624 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package host import ( @@ -8,7 +9,7 @@ import ( "runtime" "time" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) type Warnings = common.Warnings @@ -40,13 +41,6 @@ type UserStat struct { Started int `json:"started"` } -type TemperatureStat struct { - SensorKey string `json:"sensorKey"` - Temperature float64 `json:"temperature"` - High float64 `json:"sensorHigh"` - Critical float64 `json:"sensorCritical"` -} - func (h InfoStat) String() string { s, _ := json.Marshal(h) return string(s) @@ -57,11 +51,6 @@ func (u UserStat) String() string { return string(s) } -func (t TemperatureStat) String() string { - s, _ := json.Marshal(t) - return string(s) -} - var enableBootTimeCache bool // EnableBootTimeCache change cache behavior of BootTime. If true, cache BootTime value. Default is false. @@ -157,10 +146,6 @@ func KernelVersion() (string, error) { return KernelVersionWithContext(context.Background()) } -func SensorsTemperatures() ([]TemperatureStat, error) { - return SensorsTemperaturesWithContext(context.Background()) -} - func timeSince(ts uint64) uint64 { return uint64(time.Now().Unix()) - ts } diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_aix.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_aix.go similarity index 70% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_aix.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_aix.go index d06899ea0..4358b61fd 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_aix.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_aix.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix -// +build aix package host @@ -9,14 +9,12 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) // from https://www.ibm.com/docs/en/aix/7.2?topic=files-utmph-file const ( user_PROCESS = 7 - - hostTemperatureScale = 1000.0 // Not part of the linked file, but kept just in case it becomes relevant ) func HostIDWithContext(ctx context.Context) (string, error) { @@ -47,69 +45,79 @@ func BootTimeWithContext(ctx context.Context) (btime uint64, err error) { return timeSince(ut), nil } -// This function takes multiple formats of output frmo the uptime -// command and converts the data into minutes. +// Parses result from uptime into minutes // Some examples of uptime output that this command handles: // 11:54AM up 13 mins, 1 user, load average: 2.78, 2.62, 1.79 // 12:41PM up 1 hr, 1 user, load average: 2.47, 2.85, 2.83 // 07:43PM up 5 hrs, 1 user, load average: 3.27, 2.91, 2.72 // 11:18:23 up 83 days, 18:29, 4 users, load average: 0.16, 0.03, 0.01 +// 08:47PM up 2 days, 20 hrs, 1 user, load average: 2.47, 2.17, 2.17 +// 01:16AM up 4 days, 29 mins, 1 user, load average: 2.29, 2.31, 2.21 func UptimeWithContext(ctx context.Context) (uint64, error) { out, err := invoke.CommandWithContext(ctx, "uptime") if err != nil { return 0, err } - // Convert our uptime to a series of fields we can extract - ut := strings.Fields(string(out[:])) + return parseUptime(string(out[:])), nil +} + +func parseUptime(uptime string) uint64 { + ut := strings.Fields(uptime) + var days, hours, mins uint64 + var err error - // Convert the second field value to integer - var days uint64 = 0 - var hours uint64 = 0 - var minutes uint64 = 0 - if ut[3] == "days," { + switch { + case ut[3] == "day," || ut[3] == "days,": days, err = strconv.ParseUint(ut[2], 10, 64) if err != nil { - return 0, err + return 0 } - // Split field 4 into hours and minutes - hm := strings.Split(ut[4], ":") - hours, err = strconv.ParseUint(hm[0], 10, 64) - if err != nil { - return 0, err - } - minutes, err = strconv.ParseUint(strings.Replace(hm[1], ",", "", -1), 10, 64) - if err != nil { - return 0, err + // day provided along with a single hour or hours + // ie: up 2 days, 20 hrs, + if ut[5] == "hr," || ut[5] == "hrs," { + hours, err = strconv.ParseUint(ut[4], 10, 64) + if err != nil { + return 0 + } } - } else if ut[3] == "hr," || ut[3] == "hrs," { - hours, err = strconv.ParseUint(ut[2], 10, 64) - if err != nil { - return 0, err + + // mins provided along with a single min or mins + // ie: up 4 days, 29 mins, + if ut[5] == "min," || ut[5] == "mins," { + mins, err = strconv.ParseUint(ut[4], 10, 64) + if err != nil { + return 0 + } } - } else if ut[3] == "mins," { - minutes, err = strconv.ParseUint(ut[2], 10, 64) - if err != nil { - return 0, err + + // alternatively day provided with hh:mm + // ie: up 83 days, 18:29 + if strings.Contains(ut[4], ":") { + hm := strings.Split(ut[4], ":") + hours, err = strconv.ParseUint(hm[0], 10, 64) + if err != nil { + return 0 + } + mins, err = strconv.ParseUint(strings.Trim(hm[1], ","), 10, 64) + if err != nil { + return 0 + } } - } else if _, err := strconv.ParseInt(ut[3], 10, 64); err == nil && strings.Contains(ut[2], ":") { - // Split field 2 into hours and minutes - hm := strings.Split(ut[2], ":") - hours, err = strconv.ParseUint(hm[0], 10, 64) + case ut[3] == "hr," || ut[3] == "hrs,": + hours, err = strconv.ParseUint(ut[2], 10, 64) if err != nil { - return 0, err + return 0 } - minutes, err = strconv.ParseUint(strings.Replace(hm[1], ",", "", -1), 10, 64) + case ut[3] == "mins," || ut[3] == "mins,": + mins, err = strconv.ParseUint(ut[2], 10, 64) if err != nil { - return 0, err + return 0 } } - // Stack them all together as minutes - total_time := (days * 24 * 60) + (hours * 60) + minutes - - return total_time, nil + return (days * 24 * 60) + (hours * 60) + mins } // This is a weak implementation due to the limitations on retrieving this data in AIX @@ -196,7 +204,3 @@ func KernelArch() (arch string, err error) { func VirtualizationWithContext(ctx context.Context) (string, string, error) { return "", "", common.ErrNotImplementedError } - -func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, error) { - return nil, common.ErrNotImplementedError -} diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_aix_ppc64.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_aix_ppc64.go similarity index 100% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_aix_ppc64.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_aix_ppc64.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_bsd.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_bsd.go similarity index 94% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_bsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_bsd.go index f9a296148..b67f8fb6e 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_bsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_bsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin || freebsd || openbsd || netbsd -// +build darwin freebsd openbsd netbsd package host diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_darwin.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_darwin.go similarity index 95% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_darwin.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_darwin.go index 873ed4aee..068f1060a 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_darwin.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_darwin.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin -// +build darwin package host @@ -15,8 +15,8 @@ import ( "golang.org/x/sys/unix" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/process" ) // from utmpx.h diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_darwin_amd64.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_darwin_amd64.go similarity index 88% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_darwin_amd64.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_darwin_amd64.go index 8caeed2e8..1efc353aa 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_darwin_amd64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_darwin_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_darwin.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_darwin_arm64.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_darwin_arm64.go similarity index 89% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_darwin_arm64.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_darwin_arm64.go index 293bd4df8..512e56970 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_darwin_arm64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_darwin_arm64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && arm64 -// +build darwin,arm64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs host/types_darwin.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_fallback.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_fallback.go similarity index 80% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_fallback.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_fallback.go index 150ccf008..bc8397909 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_fallback.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_fallback.go @@ -1,12 +1,12 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build !darwin && !linux && !freebsd && !openbsd && !netbsd && !solaris && !windows && !aix -// +build !darwin,!linux,!freebsd,!openbsd,!netbsd,!solaris,!windows,!aix package host import ( "context" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func HostIDWithContext(ctx context.Context) (string, error) { @@ -41,10 +41,6 @@ func PlatformInformationWithContext(ctx context.Context) (string, string, string return "", "", "", common.ErrNotImplementedError } -func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, error) { - return []TemperatureStat{}, common.ErrNotImplementedError -} - func KernelArch() (string, error) { return "", common.ErrNotImplementedError } diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_freebsd.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_freebsd.go similarity index 92% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_freebsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_freebsd.go index 9a5382d39..97aa05a14 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_freebsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_freebsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd -// +build freebsd package host @@ -13,8 +13,8 @@ import ( "strings" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/process" "golang.org/x/sys/unix" ) @@ -141,10 +141,6 @@ func getUsersFromUtmp(utmpfile string) ([]UserStat, error) { return ret, nil } -func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, error) { - return []TemperatureStat{}, common.ErrNotImplementedError -} - func KernelVersionWithContext(ctx context.Context) (string, error) { _, _, version, err := PlatformInformationWithContext(ctx) return version, err diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_386.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_freebsd_386.go similarity index 92% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_386.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_freebsd_386.go index 88453d2a2..0d31eb113 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_386.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_freebsd_386.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs types_freebsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_amd64.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_freebsd_amd64.go similarity index 92% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_amd64.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_freebsd_amd64.go index 8af74b0fe..603a0ba50 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_amd64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_freebsd_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs types_freebsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_arm.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_freebsd_arm.go similarity index 92% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_arm.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_freebsd_arm.go index f7d6ede55..5021f5e1b 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_arm.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_freebsd_arm.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs types_freebsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_arm64.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_freebsd_arm64.go similarity index 93% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_arm64.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_freebsd_arm64.go index 41bec3c11..4fe188b33 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_freebsd_arm64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_freebsd_arm64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd && arm64 -// +build freebsd,arm64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs host/types_freebsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux.go similarity index 70% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_linux.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_linux.go index 5d4c1a90f..04bda6c98 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package host @@ -10,14 +10,12 @@ import ( "fmt" "io" "os" - "path/filepath" "regexp" - "strconv" "strings" "golang.org/x/sys/unix" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) type lsbStruct struct { @@ -30,8 +28,6 @@ type lsbStruct struct { // from utmp.h const ( user_PROCESS = 7 - - hostTemperatureScale = 1000.0 ) func HostIDWithContext(ctx context.Context) (string, error) { @@ -392,147 +388,3 @@ func getSusePlatform(contents []string) string { func VirtualizationWithContext(ctx context.Context) (string, string, error) { return common.VirtualizationWithContext(ctx) } - -func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, error) { - var err error - - var files []string - - temperatures := make([]TemperatureStat, 0) - - // Only the temp*_input file provides current temperature - // value in millidegree Celsius as reported by the temperature to the device: - // https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface - if files, err = filepath.Glob(common.HostSysWithContext(ctx, "/class/hwmon/hwmon*/temp*_input")); err != nil { - return temperatures, err - } - - if len(files) == 0 { - // CentOS has an intermediate /device directory: - // https://github.com/giampaolo/psutil/issues/971 - if files, err = filepath.Glob(common.HostSysWithContext(ctx, "/class/hwmon/hwmon*/device/temp*_input")); err != nil { - return temperatures, err - } - } - - var warns Warnings - - if len(files) == 0 { // handle distributions without hwmon, like raspbian #391, parse legacy thermal_zone files - files, err = filepath.Glob(common.HostSysWithContext(ctx, "/class/thermal/thermal_zone*/")) - if err != nil { - return temperatures, err - } - for _, file := range files { - // Get the name of the temperature you are reading - name, err := os.ReadFile(filepath.Join(file, "type")) - if err != nil { - warns.Add(err) - continue - } - // Get the temperature reading - current, err := os.ReadFile(filepath.Join(file, "temp")) - if err != nil { - warns.Add(err) - continue - } - temperature, err := strconv.ParseInt(strings.TrimSpace(string(current)), 10, 64) - if err != nil { - warns.Add(err) - continue - } - - temperatures = append(temperatures, TemperatureStat{ - SensorKey: strings.TrimSpace(string(name)), - Temperature: float64(temperature) / 1000.0, - }) - } - return temperatures, warns.Reference() - } - - temperatures = make([]TemperatureStat, 0, len(files)) - - // example directory - // device/ temp1_crit_alarm temp2_crit_alarm temp3_crit_alarm temp4_crit_alarm temp5_crit_alarm temp6_crit_alarm temp7_crit_alarm - // name temp1_input temp2_input temp3_input temp4_input temp5_input temp6_input temp7_input - // power/ temp1_label temp2_label temp3_label temp4_label temp5_label temp6_label temp7_label - // subsystem/ temp1_max temp2_max temp3_max temp4_max temp5_max temp6_max temp7_max - // temp1_crit temp2_crit temp3_crit temp4_crit temp5_crit temp6_crit temp7_crit uevent - for _, file := range files { - var raw []byte - - var temperature float64 - - // Get the base directory location - directory := filepath.Dir(file) - - // Get the base filename prefix like temp1 - basename := strings.Split(filepath.Base(file), "_")[0] - - // Get the base path like /temp1 - basepath := filepath.Join(directory, basename) - - // Get the label of the temperature you are reading - label := "" - - if raw, _ = os.ReadFile(basepath + "_label"); len(raw) != 0 { - // Format the label from "Core 0" to "core_0" - label = strings.Join(strings.Split(strings.TrimSpace(strings.ToLower(string(raw))), " "), "_") - } - - // Get the name of the temperature you are reading - if raw, err = os.ReadFile(filepath.Join(directory, "name")); err != nil { - warns.Add(err) - continue - } - - name := strings.TrimSpace(string(raw)) - - if label != "" { - name = name + "_" + label - } - - // Get the temperature reading - if raw, err = os.ReadFile(file); err != nil { - warns.Add(err) - continue - } - - if temperature, err = strconv.ParseFloat(strings.TrimSpace(string(raw)), 64); err != nil { - warns.Add(err) - continue - } - - // Add discovered temperature sensor to the list - temperatures = append(temperatures, TemperatureStat{ - SensorKey: name, - Temperature: temperature / hostTemperatureScale, - High: optionalValueReadFromFile(basepath+"_max") / hostTemperatureScale, - Critical: optionalValueReadFromFile(basepath+"_crit") / hostTemperatureScale, - }) - } - - return temperatures, warns.Reference() -} - -func optionalValueReadFromFile(filename string) float64 { - var raw []byte - - var err error - - var value float64 - - // Check if file exists - if _, err := os.Stat(filename); os.IsNotExist(err) { - return 0 - } - - if raw, err = os.ReadFile(filename); err != nil { - return 0 - } - - if value, err = strconv.ParseFloat(strings.TrimSpace(string(raw)), 64); err != nil { - return 0 - } - - return value -} diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_386.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_386.go similarity index 95% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_386.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_386.go index 46e0c5d5a..3e241b104 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_386.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_386.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // ATTENTION - FILE MANUAL FIXED AFTER CGO. // Fixed line: Tv _Ctype_struct_timeval -> Tv UtTv // Created by cgo -godefs, MANUAL FIXED diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_amd64.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_amd64.go similarity index 95% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_amd64.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_amd64.go index 1e574482f..480e72d3b 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_amd64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_arm.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_arm.go similarity index 95% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_arm.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_arm.go index 7abbbb8a3..1b7ee978a 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_arm.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_arm.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go | sed "s/uint8/int8/g" diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_arm64.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_arm64.go similarity index 95% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_arm64.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_arm64.go index cd0b4ddcf..0e6fc8b76 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_arm64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_arm64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause // Code generated by cmd/cgo -godefs; DO NOT EDIT. -// cgo -godefs types_linux.go package host diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_loong64.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_loong64.go similarity index 95% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_loong64.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_loong64.go index edf1be597..c4c8390f3 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_loong64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_loong64.go @@ -1,8 +1,8 @@ +// SPDX-License-Identifier: BSD-3-Clause // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs host/types_linux.go //go:build linux && loong64 -// +build linux,loong64 package host diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_mips.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_mips.go similarity index 94% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_mips.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_mips.go index 50207e5bc..8aa049cae 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_mips.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_mips.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_mips64.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_mips64.go similarity index 94% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_mips64.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_mips64.go index 50207e5bc..8aa049cae 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_mips64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_mips64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_mips64le.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_mips64le.go similarity index 94% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_mips64le.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_mips64le.go index 50207e5bc..8aa049cae 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_mips64le.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_mips64le.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_mipsle.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_mipsle.go similarity index 94% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_mipsle.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_mipsle.go index 50207e5bc..8aa049cae 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_mipsle.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_mipsle.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_ppc64.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_ppc64.go similarity index 95% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_ppc64.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_ppc64.go index 5b324effa..23f5cb9d8 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_ppc64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_ppc64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux && ppc64 -// +build linux,ppc64 // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_ppc64le.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_ppc64le.go similarity index 95% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_ppc64le.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_ppc64le.go index 51f5bee11..e81f12392 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_ppc64le.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_ppc64le.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux && ppc64le -// +build linux,ppc64le // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_riscv64.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_riscv64.go similarity index 95% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_riscv64.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_riscv64.go index bb03a0b39..080fdb8dc 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_riscv64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_riscv64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_s390x.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_s390x.go similarity index 95% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_s390x.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_s390x.go index 6ea432a61..738af6018 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_linux_s390x.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_linux_s390x.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux && s390x -// +build linux,s390x // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_linux.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_netbsd.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_netbsd.go similarity index 83% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_netbsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_netbsd.go index 488f1dfc2..f3cddb7be 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_netbsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_netbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build netbsd -// +build netbsd package host @@ -7,7 +7,7 @@ import ( "context" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/unix" ) @@ -45,10 +45,6 @@ func UsersWithContext(ctx context.Context) ([]UserStat, error) { return ret, common.ErrNotImplementedError } -func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, error) { - return []TemperatureStat{}, common.ErrNotImplementedError -} - func KernelVersionWithContext(ctx context.Context) (string, error) { _, _, version, err := PlatformInformationWithContext(ctx) return version, err diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_openbsd.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_openbsd.go similarity index 88% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_openbsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_openbsd.go index 325015c23..f21c5e859 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_openbsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_openbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd -// +build openbsd package host @@ -12,8 +12,8 @@ import ( "strings" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/process" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/process" "golang.org/x/sys/unix" ) @@ -95,10 +95,6 @@ func UsersWithContext(ctx context.Context) ([]UserStat, error) { return ret, nil } -func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, error) { - return []TemperatureStat{}, common.ErrNotImplementedError -} - func KernelVersionWithContext(ctx context.Context) (string, error) { _, _, version, err := PlatformInformationWithContext(ctx) return version, err diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_386.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_386.go similarity index 92% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_386.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_386.go index b299d7ae4..df820a4ab 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_386.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_386.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && 386 -// +build openbsd,386 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs host/types_openbsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_amd64.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_amd64.go similarity index 91% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_amd64.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_amd64.go index 2d23b9b71..b1d674e8c 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_amd64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_openbsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_arm.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_arm.go similarity index 92% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_arm.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_arm.go index f0ac57d0b..e5f1590fe 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_arm.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_arm.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && arm -// +build openbsd,arm // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs host/types_openbsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_arm64.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_arm64.go similarity index 92% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_arm64.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_arm64.go index 20fb42dd7..d8c1061f7 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_arm64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_arm64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && arm64 -// +build openbsd,arm64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs host/types_openbsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_riscv64.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_riscv64.go similarity index 92% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_riscv64.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_riscv64.go index 7a123b649..584004b2f 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_openbsd_riscv64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_openbsd_riscv64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && riscv64 -// +build openbsd,riscv64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs host/types_openbsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_posix.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_posix.go similarity index 84% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_posix.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_posix.go index e7e0d837f..91ab6aee8 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_posix.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_posix.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux || freebsd || openbsd || netbsd || darwin || solaris -// +build linux freebsd openbsd netbsd darwin solaris package host diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_solaris.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_solaris.go similarity index 80% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_solaris.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_solaris.go index fef67f835..371cc98e8 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_solaris.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_solaris.go @@ -1,18 +1,19 @@ +// SPDX-License-Identifier: BSD-3-Clause +//go:build solaris + package host import ( "bufio" "bytes" "context" - "encoding/csv" "fmt" - "io" "os" "regexp" "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func HostIDWithContext(ctx context.Context) (string, error) { @@ -94,43 +95,6 @@ func UsersWithContext(ctx context.Context) ([]UserStat, error) { return []UserStat{}, common.ErrNotImplementedError } -func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, error) { - var ret []TemperatureStat - - out, err := invoke.CommandWithContext(ctx, "ipmitool", "-c", "sdr", "list") - if err != nil { - return ret, err - } - - r := csv.NewReader(strings.NewReader(string(out))) - // Output may contain errors, e.g. "bmc_send_cmd: Permission denied", don't expect a consistent number of records - r.FieldsPerRecord = -1 - for { - record, err := r.Read() - if err == io.EOF { - break - } - if err != nil { - return ret, err - } - // CPU1 Temp,40,degrees C,ok - if len(record) < 3 || record[1] == "" || record[2] != "degrees C" { - continue - } - v, err := strconv.ParseFloat(record[1], 64) - if err != nil { - return ret, err - } - ts := TemperatureStat{ - SensorKey: strings.TrimSuffix(record[0], " Temp"), - Temperature: v, - } - ret = append(ret, ts) - } - - return ret, nil -} - func VirtualizationWithContext(ctx context.Context) (string, string, error) { return "", "", common.ErrNotImplementedError } diff --git a/src/vendor/github.com/shirou/gopsutil/v3/host/host_windows.go b/src/vendor/github.com/shirou/gopsutil/v4/host/host_windows.go similarity index 88% rename from src/vendor/github.com/shirou/gopsutil/v3/host/host_windows.go rename to src/vendor/github.com/shirou/gopsutil/v4/host/host_windows.go index b83ad6db1..7daad6f94 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/host/host_windows.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/host/host_windows.go @@ -1,12 +1,11 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build windows -// +build windows package host import ( "context" "fmt" - "math" "strconv" "strings" "sync/atomic" @@ -14,9 +13,8 @@ import ( "time" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/process" - "github.com/yusufpapurcu/wmi" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/process" "golang.org/x/sys/windows" ) @@ -57,13 +55,6 @@ type systemInfo struct { wProcessorRevision uint16 } -type msAcpi_ThermalZoneTemperature struct { - Active bool - CriticalTripPoint uint32 - CurrentTemperature uint32 - InstanceName string -} - func HostIDWithContext(ctx context.Context) (string, error) { // there has been reports of issues on 32bit using golang.org/x/sys/windows/registry, see https://github.com/shirou/gopsutil/pull/312#issuecomment-277422612 // for rationale of using windows.RegOpenKeyEx/RegQueryValueEx instead of registry.OpenKey/GetStringValue @@ -145,6 +136,14 @@ func BootTimeWithContext(ctx context.Context) (uint64, error) { } func PlatformInformationWithContext(ctx context.Context) (platform string, family string, version string, err error) { + platform, family, _, displayVersion, err := platformInformation(ctx) + if err != nil { + return "", "", "", err + } + return platform, family, displayVersion, nil +} + +func platformInformation(ctx context.Context) (platform, family, version, displayVersion string, err error) { // GetVersionEx lies on Windows 8.1 and returns as Windows 8 if we don't declare compatibility in manifest // RtlGetVersion bypasses this lying layer and returns the true Windows version // https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/wdm/nf-wdm-rtlgetversion @@ -208,6 +207,14 @@ func PlatformInformationWithContext(ctx context.Context) (platform string, famil copy((*[4]byte)(unsafe.Pointer(&UBR))[:], regBuf) } + // Get DisplayVersion(ex: 23H2) as platformVersion + err = windows.RegQueryValueEx(h, windows.StringToUTF16Ptr(`DisplayVersion`), nil, &valType, nil, &bufLen) + if err == nil { + regBuf := make([]uint16, bufLen/2+1) + err = windows.RegQueryValueEx(h, windows.StringToUTF16Ptr(`DisplayVersion`), nil, &valType, (*byte)(unsafe.Pointer(®Buf[0])), &bufLen) + displayVersion = windows.UTF16ToString(regBuf[:]) + } + // PlatformFamily switch osInfo.wProductType { case 1: @@ -223,7 +230,7 @@ func PlatformInformationWithContext(ctx context.Context) (platform string, famil osInfo.dwMajorVersion, osInfo.dwMinorVersion, osInfo.dwBuildNumber, UBR, osInfo.dwBuildNumber, UBR) - return platform, family, version, nil + return platform, family, version, displayVersion, nil } func UsersWithContext(ctx context.Context) ([]UserStat, error) { @@ -232,39 +239,12 @@ func UsersWithContext(ctx context.Context) ([]UserStat, error) { return ret, common.ErrNotImplementedError } -func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, error) { - var ret []TemperatureStat - var dst []msAcpi_ThermalZoneTemperature - q := wmi.CreateQuery(&dst, "") - if err := common.WMIQueryWithContext(ctx, q, &dst, nil, "root/wmi"); err != nil { - return ret, err - } - - for _, v := range dst { - ts := TemperatureStat{ - SensorKey: v.InstanceName, - Temperature: kelvinToCelsius(v.CurrentTemperature, 2), - } - ret = append(ret, ts) - } - - return ret, nil -} - -func kelvinToCelsius(temp uint32, n int) float64 { - // wmi return temperature Kelvin * 10, so need to divide the result by 10, - // and then minus 273.15 to get °Celsius. - t := float64(temp/10) - 273.15 - n10 := math.Pow10(n) - return math.Trunc((t+0.5/n10)*n10) / n10 -} - func VirtualizationWithContext(ctx context.Context) (string, string, error) { return "", "", common.ErrNotImplementedError } func KernelVersionWithContext(ctx context.Context) (string, error) { - _, _, version, err := PlatformInformationWithContext(ctx) + _, _, version, _, err := platformInformation(ctx) return version, err } diff --git a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/binary.go b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/binary.go similarity index 99% rename from src/vendor/github.com/shirou/gopsutil/v3/internal/common/binary.go rename to src/vendor/github.com/shirou/gopsutil/v4/internal/common/binary.go index 5e8d43db8..6e75e74b0 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/binary.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/binary.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package common // Copyright 2009 The Go Authors. All rights reserved. diff --git a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/common.go b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/common.go similarity index 99% rename from src/vendor/github.com/shirou/gopsutil/v3/internal/common/common.go rename to src/vendor/github.com/shirou/gopsutil/v4/internal/common/common.go index 5e25e507b..642aabc55 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/common.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/common.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package common // @@ -25,7 +26,7 @@ import ( "strings" "time" - "github.com/shirou/gopsutil/v3/common" + "github.com/shirou/gopsutil/v4/common" ) var ( diff --git a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_darwin.go b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_darwin.go similarity index 97% rename from src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_darwin.go rename to src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_darwin.go index f1a784597..53f9ae8d9 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_darwin.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_darwin.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin -// +build darwin package common diff --git a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_freebsd.go b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_freebsd.go similarity index 97% rename from src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_freebsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_freebsd.go index f590e2e67..53cdceeb6 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_freebsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_freebsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd || openbsd -// +build freebsd openbsd package common diff --git a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_linux.go b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_linux.go similarity index 99% rename from src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_linux.go rename to src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_linux.go index a429e16a2..541de93d3 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_linux.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_linux.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package common @@ -90,6 +90,8 @@ func BootTimeWithContext(ctx context.Context, enableCache bool) (uint64, error) if enableCache { atomic.StoreUint64(&cachedBootTime, t) } + + return t, nil } filename := HostProcWithContext(ctx, "uptime") @@ -97,6 +99,8 @@ func BootTimeWithContext(ctx context.Context, enableCache bool) (uint64, error) if err != nil { return handleBootTimeFileReadErr(err) } + currentTime := float64(time.Now().UnixNano()) / float64(time.Second) + if len(lines) != 1 { return 0, fmt.Errorf("wrong uptime format") } @@ -105,7 +109,6 @@ func BootTimeWithContext(ctx context.Context, enableCache bool) (uint64, error) if err != nil { return 0, err } - currentTime := float64(time.Now().UnixNano()) / float64(time.Second) t := currentTime - b if enableCache { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_netbsd.go b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_netbsd.go similarity index 96% rename from src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_netbsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_netbsd.go index efbc710a5..206532126 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_netbsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_netbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build netbsd -// +build netbsd package common diff --git a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_openbsd.go b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_openbsd.go similarity index 96% rename from src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_openbsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_openbsd.go index 58d76f334..00fa19a2f 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_openbsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_openbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd -// +build openbsd package common diff --git a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_unix.go b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_unix.go similarity index 97% rename from src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_unix.go rename to src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_unix.go index 4af7e5c2a..2715b890b 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_unix.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_unix.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux || freebsd || darwin || openbsd -// +build linux freebsd darwin openbsd package common diff --git a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_windows.go b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_windows.go similarity index 99% rename from src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_windows.go rename to src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_windows.go index 301b2315b..766ed2fcb 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/common_windows.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/common_windows.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build windows -// +build windows package common diff --git a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/endian.go b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/endian.go similarity index 88% rename from src/vendor/github.com/shirou/gopsutil/v3/internal/common/endian.go rename to src/vendor/github.com/shirou/gopsutil/v4/internal/common/endian.go index 147cfdc4b..113ff2e9f 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/endian.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/endian.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package common import "unsafe" diff --git a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/sleep.go b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/sleep.go similarity index 89% rename from src/vendor/github.com/shirou/gopsutil/v3/internal/common/sleep.go rename to src/vendor/github.com/shirou/gopsutil/v4/internal/common/sleep.go index 94cedfd34..504f13ffd 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/sleep.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/sleep.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package common import ( diff --git a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/warnings.go b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/warnings.go similarity index 92% rename from src/vendor/github.com/shirou/gopsutil/v3/internal/common/warnings.go rename to src/vendor/github.com/shirou/gopsutil/v4/internal/common/warnings.go index a4aaadaf5..888cc57fa 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/internal/common/warnings.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/internal/common/warnings.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package common import "fmt" diff --git a/src/vendor/github.com/shirou/gopsutil/v4/mem/ex_linux.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/ex_linux.go new file mode 100644 index 000000000..0a12fe2fe --- /dev/null +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/ex_linux.go @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: BSD-3-Clause +//go:build linux + +package mem + +import ( + "context" + "encoding/json" +) + +type ExVirtualMemory struct { + ActiveFile uint64 `json:"activefile"` + InactiveFile uint64 `json:"inactivefile"` + ActiveAnon uint64 `json:"activeanon"` + InactiveAnon uint64 `json:"inactiveanon"` + Unevictable uint64 `json:"unevictable"` +} + +func (v ExVirtualMemory) String() string { + s, _ := json.Marshal(v) + return string(s) +} + +type ExLinux struct{} + +func NewExLinux() *ExLinux { + return &ExLinux{} +} + +func (ex *ExLinux) VirtualMemory() (*ExVirtualMemory, error) { + return ex.VirtualMemoryWithContext(context.Background()) +} + +func (ex *ExLinux) VirtualMemoryWithContext(ctx context.Context) (*ExVirtualMemory, error) { + _, vmEx, err := fillFromMeminfoWithContext(ctx) + if err != nil { + return nil, err + } + return vmEx, nil +} diff --git a/src/vendor/github.com/shirou/gopsutil/v4/mem/ex_windows.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/ex_windows.go new file mode 100644 index 000000000..4f1573b3c --- /dev/null +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/ex_windows.go @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: BSD-3-Clause +//go:build windows + +package mem + +import ( + "unsafe" + + "golang.org/x/sys/windows" +) + +// ExVirtualMemory represents Windows specific information +// https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-memorystatusex +type ExVirtualMemory struct { + VirtualTotal uint64 `json:"virtualTotal"` + VirtualAvail uint64 `json:"virtualAvail"` +} + +type ExWindows struct{} + +func NewExWindows() *ExWindows { + return &ExWindows{} +} + +func (e *ExWindows) VirtualMemory() (*ExVirtualMemory, error) { + var memInfo memoryStatusEx + memInfo.cbSize = uint32(unsafe.Sizeof(memInfo)) + mem, _, _ := procGlobalMemoryStatusEx.Call(uintptr(unsafe.Pointer(&memInfo))) + if mem == 0 { + return nil, windows.GetLastError() + } + + ret := &ExVirtualMemory{ + VirtualTotal: memInfo.ullTotalVirtual, + VirtualAvail: memInfo.ullAvailVirtual, + } + + return ret, nil +} diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem.go similarity index 97% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem.go index edaf268bb..0da71a988 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem.go @@ -1,9 +1,10 @@ +// SPDX-License-Identifier: BSD-3-Clause package mem import ( "encoding/json" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) var invoke common.Invoker = common.Invoke{} diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_aix.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_aix.go similarity index 86% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_aix.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_aix.go index 22a6a4e92..916bff30d 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_aix.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_aix.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix -// +build aix package mem diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_aix_cgo.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_aix_cgo.go similarity index 97% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_aix_cgo.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_aix_cgo.go index 67e11dff8..2d03dd0c3 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_aix_cgo.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_aix_cgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix && cgo -// +build aix,cgo package mem diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_aix_nocgo.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_aix_nocgo.go similarity index 95% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_aix_nocgo.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_aix_nocgo.go index 027879d9a..bc3c0ed3b 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_aix_nocgo.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_aix_nocgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix && !cgo -// +build aix,!cgo package mem @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_bsd.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_bsd.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_bsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_bsd.go index ef867d742..4f3e57c03 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_bsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_bsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd || openbsd || netbsd -// +build freebsd openbsd netbsd package mem diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_darwin.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_darwin.go similarity index 94% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_darwin.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_darwin.go index a05a0faba..a33c5f125 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_darwin.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_darwin.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin -// +build darwin package mem @@ -10,7 +10,7 @@ import ( "golang.org/x/sys/unix" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func getHwMemsize() (uint64, error) { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_darwin_cgo.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_darwin_cgo.go similarity index 97% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_darwin_cgo.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_darwin_cgo.go index e5da7dcdb..cc6657d04 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_darwin_cgo.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_darwin_cgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && cgo -// +build darwin,cgo package mem diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_darwin_nocgo.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_darwin_nocgo.go similarity index 97% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_darwin_nocgo.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_darwin_nocgo.go index c93931680..097a93e63 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_darwin_nocgo.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_darwin_nocgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && !cgo -// +build darwin,!cgo package mem diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_fallback.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_fallback.go similarity index 86% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_fallback.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_fallback.go index 697fd8709..ba882c8be 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_fallback.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_fallback.go @@ -1,12 +1,12 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build !darwin && !linux && !freebsd && !openbsd && !solaris && !windows && !plan9 && !aix && !netbsd -// +build !darwin,!linux,!freebsd,!openbsd,!solaris,!windows,!plan9,!aix,!netbsd package mem import ( "context" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func VirtualMemory() (*VirtualMemoryStat, error) { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_freebsd.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_freebsd.go similarity index 97% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_freebsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_freebsd.go index 9a56785b3..d9cae7116 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_freebsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_freebsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd -// +build freebsd package mem @@ -8,7 +8,7 @@ import ( "errors" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/unix" ) diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_linux.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_linux.go similarity index 93% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_linux.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_linux.go index 214a91e47..05bfdaf4e 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_linux.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_linux.go @@ -1,12 +1,11 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package mem import ( "bufio" "context" - "encoding/json" "fmt" "io" "math" @@ -16,22 +15,9 @@ import ( "golang.org/x/sys/unix" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) -type VirtualMemoryExStat struct { - ActiveFile uint64 `json:"activefile"` - InactiveFile uint64 `json:"inactivefile"` - ActiveAnon uint64 `json:"activeanon"` - InactiveAnon uint64 `json:"inactiveanon"` - Unevictable uint64 `json:"unevictable"` -} - -func (v VirtualMemoryExStat) String() string { - s, _ := json.Marshal(v) - return string(s) -} - func VirtualMemory() (*VirtualMemoryStat, error) { return VirtualMemoryWithContext(context.Background()) } @@ -44,19 +30,7 @@ func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) { return vm, nil } -func VirtualMemoryEx() (*VirtualMemoryExStat, error) { - return VirtualMemoryExWithContext(context.Background()) -} - -func VirtualMemoryExWithContext(ctx context.Context) (*VirtualMemoryExStat, error) { - _, vmEx, err := fillFromMeminfoWithContext(ctx) - if err != nil { - return nil, err - } - return vmEx, nil -} - -func fillFromMeminfoWithContext(ctx context.Context) (*VirtualMemoryStat, *VirtualMemoryExStat, error) { +func fillFromMeminfoWithContext(ctx context.Context) (*VirtualMemoryStat, *ExVirtualMemory, error) { filename := common.HostProcWithContext(ctx, "meminfo") lines, _ := common.ReadLines(filename) @@ -67,7 +41,7 @@ func fillFromMeminfoWithContext(ctx context.Context) (*VirtualMemoryStat, *Virtu sReclaimable := false // "Sreclaimable:" not available: 2.6.19 / Nov 2006 ret := &VirtualMemoryStat{} - retEx := &VirtualMemoryExStat{} + retEx := &ExVirtualMemory{} for _, line := range lines { fields := strings.Split(line, ":") @@ -409,7 +383,7 @@ func SwapMemoryWithContext(ctx context.Context) (*SwapMemoryStat, error) { // calculateAvailVmem is a fallback under kernel 3.14 where /proc/meminfo does not provide // "MemAvailable:" column. It reimplements an algorithm from the link below // https://github.com/giampaolo/psutil/pull/890 -func calculateAvailVmem(ctx context.Context, ret *VirtualMemoryStat, retEx *VirtualMemoryExStat) uint64 { +func calculateAvailVmem(ctx context.Context, ret *VirtualMemoryStat, retEx *ExVirtualMemory) uint64 { var watermarkLow uint64 fn := common.HostProcWithContext(ctx, "zoneinfo") diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_netbsd.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_netbsd.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_netbsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_netbsd.go index d1f54ecaf..0a41b3e34 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_netbsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_netbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build netbsd -// +build netbsd package mem diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd.go similarity index 96% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd.go index e37d5abe0..2510bb0d3 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd -// +build openbsd package mem @@ -10,7 +10,7 @@ import ( "errors" "fmt" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/unix" ) diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_386.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_386.go similarity index 93% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_386.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_386.go index de2b26ca4..552e93f4a 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_386.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_386.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && 386 -// +build openbsd,386 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs mem/types_openbsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_amd64.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_amd64.go similarity index 92% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_amd64.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_amd64.go index d187abf01..73e5b72aa 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_amd64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_openbsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_arm.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_arm.go similarity index 93% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_arm.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_arm.go index 2488f1851..57b5861de 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_arm.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_arm.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && arm -// +build openbsd,arm // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs mem/types_openbsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_arm64.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_arm64.go similarity index 93% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_arm64.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_arm64.go index 3661b16fb..f39a6456b 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_arm64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_arm64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && arm64 -// +build openbsd,arm64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs mem/types_openbsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_riscv64.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_riscv64.go similarity index 94% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_riscv64.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_riscv64.go index 7a7b48038..f9f838f54 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_openbsd_riscv64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_openbsd_riscv64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && riscv64 -// +build openbsd,riscv64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs mem/types_openbsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_plan9.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_plan9.go similarity index 95% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_plan9.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_plan9.go index b5259f844..c17a102ee 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_plan9.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_plan9.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build plan9 -// +build plan9 package mem @@ -8,7 +8,7 @@ import ( "os" stats "github.com/lufia/plan9stats" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func SwapMemory() (*SwapMemoryStat, error) { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_solaris.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_solaris.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_solaris.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_solaris.go index c911267e1..06d0d9a00 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_solaris.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_solaris.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build solaris -// +build solaris package mem @@ -11,7 +11,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "github.com/tklauser/go-sysconf" ) diff --git a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_windows.go b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_windows.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/mem/mem_windows.go rename to src/vendor/github.com/shirou/gopsutil/v4/mem/mem_windows.go index 8c7fb1a13..4666cbd01 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/mem/mem_windows.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/mem/mem_windows.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build windows -// +build windows package mem @@ -9,7 +9,7 @@ import ( "syscall" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/windows" ) diff --git a/src/vendor/github.com/shirou/gopsutil/v3/net/net.go b/src/vendor/github.com/shirou/gopsutil/v4/net/net.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/net/net.go rename to src/vendor/github.com/shirou/gopsutil/v4/net/net.go index 0f3a62f39..3890eda53 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/net/net.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/net/net.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package net import ( @@ -5,7 +6,7 @@ import ( "encoding/json" "net" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) var invoke common.Invoker = common.Invoke{} diff --git a/src/vendor/github.com/shirou/gopsutil/v3/net/net_aix.go b/src/vendor/github.com/shirou/gopsutil/v4/net/net_aix.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/net/net_aix.go rename to src/vendor/github.com/shirou/gopsutil/v4/net/net_aix.go index 81feaa8d7..df59abecb 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/net/net_aix.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/net/net_aix.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix -// +build aix package net @@ -11,7 +11,7 @@ import ( "strings" "syscall" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func IOCounters(pernic bool) ([]IOCountersStat, error) { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/net/net_aix_cgo.go b/src/vendor/github.com/shirou/gopsutil/v4/net/net_aix_cgo.go similarity index 95% rename from src/vendor/github.com/shirou/gopsutil/v3/net/net_aix_cgo.go rename to src/vendor/github.com/shirou/gopsutil/v4/net/net_aix_cgo.go index 8c34f881c..a45a5b75c 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/net/net_aix_cgo.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/net/net_aix_cgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix && cgo -// +build aix,cgo package net diff --git a/src/vendor/github.com/shirou/gopsutil/v3/net/net_aix_nocgo.go b/src/vendor/github.com/shirou/gopsutil/v4/net/net_aix_nocgo.go similarity index 95% rename from src/vendor/github.com/shirou/gopsutil/v3/net/net_aix_nocgo.go rename to src/vendor/github.com/shirou/gopsutil/v4/net/net_aix_nocgo.go index e3fce9021..f63a21e73 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/net/net_aix_nocgo.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/net/net_aix_nocgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build aix && !cgo -// +build aix,!cgo package net @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func parseNetstatI(output string) ([]IOCountersStat, error) { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/net/net_darwin.go b/src/vendor/github.com/shirou/gopsutil/v4/net/net_darwin.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/net/net_darwin.go rename to src/vendor/github.com/shirou/gopsutil/v4/net/net_darwin.go index 8a7b63744..f86b7bf9e 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/net/net_darwin.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/net/net_darwin.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin -// +build darwin package net @@ -12,7 +12,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) var ( diff --git a/src/vendor/github.com/shirou/gopsutil/v3/net/net_fallback.go b/src/vendor/github.com/shirou/gopsutil/v4/net/net_fallback.go similarity index 96% rename from src/vendor/github.com/shirou/gopsutil/v3/net/net_fallback.go rename to src/vendor/github.com/shirou/gopsutil/v4/net/net_fallback.go index e136be1ba..e62deeeed 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/net/net_fallback.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/net/net_fallback.go @@ -1,12 +1,12 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build !aix && !darwin && !linux && !freebsd && !openbsd && !windows && !solaris -// +build !aix,!darwin,!linux,!freebsd,!openbsd,!windows,!solaris package net import ( "context" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func IOCounters(pernic bool) ([]IOCountersStat, error) { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/net/net_freebsd.go b/src/vendor/github.com/shirou/gopsutil/v4/net/net_freebsd.go similarity index 97% rename from src/vendor/github.com/shirou/gopsutil/v3/net/net_freebsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/net/net_freebsd.go index bf8baf094..155a49c40 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/net/net_freebsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/net/net_freebsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd -// +build freebsd package net @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) func IOCounters(pernic bool) ([]IOCountersStat, error) { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/net/net_linux.go b/src/vendor/github.com/shirou/gopsutil/v4/net/net_linux.go similarity index 99% rename from src/vendor/github.com/shirou/gopsutil/v3/net/net_linux.go rename to src/vendor/github.com/shirou/gopsutil/v4/net/net_linux.go index 20ca5470a..a46f1b9dc 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/net/net_linux.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/net/net_linux.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package net @@ -16,7 +16,7 @@ import ( "strings" "syscall" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) const ( // Conntrack Column numbers @@ -552,7 +552,7 @@ func getProcInodes(root string, pid int32, max int) (map[string][]inodeMap, erro return ret, err } defer f.Close() - dirEntries, err := readDir(f, max) + dirEntries, err := f.ReadDir(max) if err != nil { return ret, err } diff --git a/src/vendor/github.com/shirou/gopsutil/v3/net/net_openbsd.go b/src/vendor/github.com/shirou/gopsutil/v4/net/net_openbsd.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/net/net_openbsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/net/net_openbsd.go index 25bbe49ca..b6c31dd35 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/net/net_openbsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/net/net_openbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd -// +build openbsd package net @@ -12,13 +12,14 @@ import ( "strings" "syscall" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) var portMatch = regexp.MustCompile(`(.*)\.(\d+)$`) func ParseNetstat(output string, mode string, - iocs map[string]IOCountersStat) error { + iocs map[string]IOCountersStat, +) error { lines := strings.Split(output, "\n") exists := make([]string, 0, len(lines)-1) diff --git a/src/vendor/github.com/shirou/gopsutil/v3/net/net_solaris.go b/src/vendor/github.com/shirou/gopsutil/v4/net/net_solaris.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/net/net_solaris.go rename to src/vendor/github.com/shirou/gopsutil/v4/net/net_solaris.go index 79d8ac30e..b886066e8 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/net/net_solaris.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/net/net_solaris.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build solaris -// +build solaris package net @@ -11,7 +11,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) // NetIOCounters returnes network I/O statistics for every network diff --git a/src/vendor/github.com/shirou/gopsutil/v3/net/net_unix.go b/src/vendor/github.com/shirou/gopsutil/v4/net/net_unix.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/net/net_unix.go rename to src/vendor/github.com/shirou/gopsutil/v4/net/net_unix.go index cb846e28a..71fc3b972 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/net/net_unix.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/net/net_unix.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd || darwin -// +build freebsd darwin package net @@ -11,7 +11,7 @@ import ( "strings" "syscall" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) // Return a list of network connections opened. diff --git a/src/vendor/github.com/shirou/gopsutil/v3/net/net_windows.go b/src/vendor/github.com/shirou/gopsutil/v4/net/net_windows.go similarity index 99% rename from src/vendor/github.com/shirou/gopsutil/v3/net/net_windows.go rename to src/vendor/github.com/shirou/gopsutil/v4/net/net_windows.go index 5d384342f..12f62cda0 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/net/net_windows.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/net/net_windows.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build windows -// +build windows package net @@ -11,7 +11,7 @@ import ( "syscall" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/windows" ) diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process.go similarity index 94% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process.go index 1bb27abf8..ba2766252 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package process import ( @@ -9,10 +10,10 @@ import ( "sync" "time" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/mem" - "github.com/shirou/gopsutil/v3/net" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/mem" + "github.com/shirou/gopsutil/v4/net" ) var ( @@ -29,9 +30,9 @@ type Process struct { parent int32 parentMutex sync.RWMutex // for windows ppid cache numCtxSwitches *NumCtxSwitchesStat - uids []int32 - gids []int32 - groups []int32 + uids []uint32 + gids []uint32 + groups []uint32 numThreads int32 memInfo *MemoryInfoStat sigInfo *SignalInfoStat @@ -102,10 +103,18 @@ type RlimitStat struct { } type IOCountersStat struct { - ReadCount uint64 `json:"readCount"` + // ReadCount is a number of read I/O operations such as syscalls. + ReadCount uint64 `json:"readCount"` + // WriteCount is a number of read I/O operations such as syscalls. WriteCount uint64 `json:"writeCount"` - ReadBytes uint64 `json:"readBytes"` + // ReadBytes is a number of all I/O read in bytes. This includes disk I/O on Linux and Windows. + ReadBytes uint64 `json:"readBytes"` + // WriteBytes is a number of all I/O write in bytes. This includes disk I/O on Linux and Windows. WriteBytes uint64 `json:"writeBytes"` + // DiskReadBytes is a number of disk I/O write in bytes. Currently only Linux has this value. + DiskReadBytes uint64 `json:"diskReadBytes"` + // DiskWriteBytes is a number of disk I/O read in bytes. Currently only Linux has this value. + DiskWriteBytes uint64 `json:"diskWriteBytes"` } type NumCtxSwitchesStat struct { @@ -368,7 +377,7 @@ func (p *Process) CPUPercentWithContext(ctx context.Context) (float64, error) { } // Groups returns all group IDs(include supplementary groups) of the process as a slice of the int -func (p *Process) Groups() ([]int32, error) { +func (p *Process) Groups() ([]uint32, error) { return p.GroupsWithContext(context.Background()) } @@ -433,12 +442,12 @@ func (p *Process) Foreground() (bool, error) { } // Uids returns user ids of the process as a slice of the int -func (p *Process) Uids() ([]int32, error) { +func (p *Process) Uids() ([]uint32, error) { return p.UidsWithContext(context.Background()) } // Gids returns group ids of the process as a slice of the int -func (p *Process) Gids() ([]int32, error) { +func (p *Process) Gids() ([]uint32, error) { return p.GidsWithContext(context.Background()) } diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_bsd.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_bsd.go similarity index 94% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_bsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_bsd.go index 263829ffa..dcc056101 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_bsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_bsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin || freebsd || openbsd -// +build darwin freebsd openbsd package process @@ -8,8 +8,8 @@ import ( "context" "encoding/binary" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" ) type MemoryInfoExStat struct{} diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_darwin.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_darwin.go similarity index 92% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_darwin.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_darwin.go index 176661cbd..5231007c3 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_darwin.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_darwin.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin -// +build darwin package process @@ -13,8 +13,8 @@ import ( "github.com/tklauser/go-sysconf" "golang.org/x/sys/unix" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/net" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/net" ) // copied from sys/sysctl.h @@ -117,31 +117,31 @@ func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { return strings.IndexByte(string(out), '+') != -1, nil } -func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) UidsWithContext(ctx context.Context) ([]uint32, error) { k, err := p.getKProc() if err != nil { return nil, err } // See: http://unix.superglobalmegacorp.com/Net2/newsrc/sys/ucred.h.html - userEffectiveUID := int32(k.Eproc.Ucred.Uid) + userEffectiveUID := uint32(k.Eproc.Ucred.Uid) - return []int32{userEffectiveUID}, nil + return []uint32{userEffectiveUID}, nil } -func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) GidsWithContext(ctx context.Context) ([]uint32, error) { k, err := p.getKProc() if err != nil { return nil, err } - gids := make([]int32, 0, 3) - gids = append(gids, int32(k.Eproc.Pcred.P_rgid), int32(k.Eproc.Pcred.P_rgid), int32(k.Eproc.Pcred.P_svgid)) + gids := make([]uint32, 0, 3) + gids = append(gids, uint32(k.Eproc.Pcred.P_rgid), uint32(k.Eproc.Pcred.P_rgid), uint32(k.Eproc.Pcred.P_svgid)) return gids, nil } -func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) GroupsWithContext(ctx context.Context) ([]uint32, error) { return nil, common.ErrNotImplementedError // k, err := p.getKProc() // if err != nil { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_darwin_amd64.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_darwin_amd64.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_darwin_amd64.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_darwin_amd64.go index b353e5eac..a13522473 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_darwin_amd64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_darwin_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_darwin.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_darwin_arm64.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_darwin_arm64.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_darwin_arm64.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_darwin_arm64.go index cbd6bdc79..f1f3df365 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_darwin_arm64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_darwin_arm64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && arm64 -// +build darwin,arm64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs process/types_darwin.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_darwin_cgo.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_darwin_cgo.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_darwin_cgo.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_darwin_cgo.go index 858f08e7a..bbdfc963e 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_darwin_cgo.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_darwin_cgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && cgo -// +build darwin,cgo package process @@ -20,7 +20,7 @@ import ( "syscall" "unsafe" - "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v4/cpu" ) var ( diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_darwin_nocgo.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_darwin_nocgo.go similarity index 96% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_darwin_nocgo.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_darwin_nocgo.go index d903474f6..129bb6098 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_darwin_nocgo.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_darwin_nocgo.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build darwin && !cgo -// +build darwin,!cgo package process @@ -9,8 +9,8 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" ) func (p *Process) CwdWithContext(ctx context.Context) (string, error) { diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_fallback.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_fallback.go similarity index 93% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_fallback.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_fallback.go index 1a5d0c4b4..23793e92c 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_fallback.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_fallback.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build !darwin && !linux && !freebsd && !openbsd && !windows && !solaris && !plan9 -// +build !darwin,!linux,!freebsd,!openbsd,!windows,!solaris,!plan9 package process @@ -7,9 +7,9 @@ import ( "context" "syscall" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/net" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/net" ) type Signal = syscall.Signal @@ -82,15 +82,15 @@ func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { return false, common.ErrNotImplementedError } -func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) UidsWithContext(ctx context.Context) ([]uint32, error) { return nil, common.ErrNotImplementedError } -func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) GidsWithContext(ctx context.Context) ([]uint32, error) { return nil, common.ErrNotImplementedError } -func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) GroupsWithContext(ctx context.Context) ([]uint32, error) { return nil, common.ErrNotImplementedError } diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_freebsd.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_freebsd.go similarity index 90% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_freebsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_freebsd.go index 40b10e14f..3d21183d6 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_freebsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_freebsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd -// +build freebsd package process @@ -10,9 +10,9 @@ import ( "strconv" "strings" - cpu "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" - net "github.com/shirou/gopsutil/v3/net" + cpu "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" + net "github.com/shirou/gopsutil/v4/net" "golang.org/x/sys/unix" ) @@ -157,40 +157,40 @@ func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { return strings.IndexByte(string(out), '+') != -1, nil } -func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) UidsWithContext(ctx context.Context) ([]uint32, error) { k, err := p.getKProc() if err != nil { return nil, err } - uids := make([]int32, 0, 3) + uids := make([]uint32, 0, 3) - uids = append(uids, int32(k.Ruid), int32(k.Uid), int32(k.Svuid)) + uids = append(uids, uint32(k.Ruid), uint32(k.Uid), uint32(k.Svuid)) return uids, nil } -func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) GidsWithContext(ctx context.Context) ([]uint32, error) { k, err := p.getKProc() if err != nil { return nil, err } - gids := make([]int32, 0, 3) - gids = append(gids, int32(k.Rgid), int32(k.Ngroups), int32(k.Svgid)) + gids := make([]uint32, 0, 3) + gids = append(gids, uint32(k.Rgid), uint32(k.Ngroups), uint32(k.Svgid)) return gids, nil } -func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) GroupsWithContext(ctx context.Context) ([]uint32, error) { k, err := p.getKProc() if err != nil { return nil, err } - groups := make([]int32, k.Ngroups) + groups := make([]uint32, k.Ngroups) for i := int16(0); i < k.Ngroups; i++ { - groups[i] = int32(k.Groups[i]) + groups[i] = uint32(k.Groups[i]) } return groups, nil diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_freebsd_386.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_freebsd_386.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_freebsd_386.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_freebsd_386.go index 08ab333b4..279ba9fbb 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_freebsd_386.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_freebsd_386.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_freebsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_freebsd_amd64.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_freebsd_amd64.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_freebsd_amd64.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_freebsd_amd64.go index 560e627d2..f3b70ec1b 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_freebsd_amd64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_freebsd_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_freebsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_freebsd_arm.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_freebsd_arm.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_freebsd_arm.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_freebsd_arm.go index 81ae0b9a8..75ed30630 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_freebsd_arm.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_freebsd_arm.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_freebsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_freebsd_arm64.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_freebsd_arm64.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_freebsd_arm64.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_freebsd_arm64.go index 73ac08201..3dc301c02 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_freebsd_arm64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_freebsd_arm64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build freebsd && arm64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_linux.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_linux.go similarity index 97% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_linux.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_linux.go index 557435b34..8f1d6c89c 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_linux.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_linux.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux -// +build linux package process @@ -18,9 +18,9 @@ import ( "github.com/tklauser/go-sysconf" "golang.org/x/sys/unix" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/net" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/net" ) var pageSize = uint64(os.Getpagesize()) @@ -148,26 +148,26 @@ func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { return pgid == tpgid, nil } -func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) UidsWithContext(ctx context.Context) ([]uint32, error) { err := p.fillFromStatusWithContext(ctx) if err != nil { - return []int32{}, err + return []uint32{}, err } return p.uids, nil } -func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) GidsWithContext(ctx context.Context) ([]uint32, error) { err := p.fillFromStatusWithContext(ctx) if err != nil { - return []int32{}, err + return []uint32{}, err } return p.gids, nil } -func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) GroupsWithContext(ctx context.Context) ([]uint32, error) { err := p.fillFromStatusWithContext(ctx) if err != nil { - return []int32{}, err + return []uint32{}, err } return p.groups, nil } @@ -727,8 +727,12 @@ func (p *Process) fillFromIOWithContext(ctx context.Context) (*IOCountersStat, e case "syscw": ret.WriteCount = t case "read_bytes": - ret.ReadBytes = t + ret.DiskReadBytes = t case "write_bytes": + ret.DiskWriteBytes = t + case "rchar": + ret.ReadBytes = t + case "wchar": ret.WriteBytes = t } } @@ -866,32 +870,32 @@ func (p *Process) fillFromStatusWithContext(ctx context.Context) error { } p.tgid = int32(pval) case "Uid": - p.uids = make([]int32, 0, 4) + p.uids = make([]uint32, 0, 4) for _, i := range strings.Split(value, "\t") { v, err := strconv.ParseInt(i, 10, 32) if err != nil { return err } - p.uids = append(p.uids, int32(v)) + p.uids = append(p.uids, uint32(v)) } case "Gid": - p.gids = make([]int32, 0, 4) + p.gids = make([]uint32, 0, 4) for _, i := range strings.Split(value, "\t") { v, err := strconv.ParseInt(i, 10, 32) if err != nil { return err } - p.gids = append(p.gids, int32(v)) + p.gids = append(p.gids, uint32(v)) } case "Groups": groups := strings.Fields(value) - p.groups = make([]int32, 0, len(groups)) + p.groups = make([]uint32, 0, len(groups)) for _, i := range groups { - v, err := strconv.ParseInt(i, 10, 32) + v, err := strconv.ParseUint(i, 10, 32) if err != nil { return err } - p.groups = append(p.groups, int32(v)) + p.groups = append(p.groups, uint32(v)) } case "Threads": v, err := strconv.ParseInt(value, 10, 32) diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_openbsd.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd.go similarity index 91% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_openbsd.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd.go index 358694063..7f85facb5 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_openbsd.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd -// +build openbsd package process @@ -14,10 +14,10 @@ import ( "strings" "unsafe" - cpu "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" - mem "github.com/shirou/gopsutil/v3/mem" - net "github.com/shirou/gopsutil/v3/net" + cpu "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" + mem "github.com/shirou/gopsutil/v4/mem" + net "github.com/shirou/gopsutil/v4/net" "golang.org/x/sys/unix" ) @@ -176,40 +176,40 @@ func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { return strings.IndexByte(string(out), '+') != -1, nil } -func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) UidsWithContext(ctx context.Context) ([]uint32, error) { k, err := p.getKProc() if err != nil { return nil, err } - uids := make([]int32, 0, 3) + uids := make([]uint32, 0, 3) - uids = append(uids, int32(k.Ruid), int32(k.Uid), int32(k.Svuid)) + uids = append(uids, uint32(k.Ruid), uint32(k.Uid), uint32(k.Svuid)) return uids, nil } -func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) GidsWithContext(ctx context.Context) ([]uint32, error) { k, err := p.getKProc() if err != nil { return nil, err } - gids := make([]int32, 0, 3) - gids = append(gids, int32(k.Rgid), int32(k.Ngroups), int32(k.Svgid)) + gids := make([]uint32, 0, 3) + gids = append(gids, uint32(k.Rgid), uint32(k.Ngroups), uint32(k.Svgid)) return gids, nil } -func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) GroupsWithContext(ctx context.Context) ([]uint32, error) { k, err := p.getKProc() if err != nil { return nil, err } - groups := make([]int32, k.Ngroups) + groups := make([]uint32, k.Ngroups) for i := int16(0); i < k.Ngroups; i++ { - groups[i] = int32(k.Groups[i]) + groups[i] = uint32(k.Groups[i]) } return groups, nil diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_openbsd_386.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd_386.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_openbsd_386.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd_386.go index 6e9edc202..5b84706a7 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_openbsd_386.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd_386.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && 386 -// +build openbsd,386 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs process/types_openbsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_openbsd_amd64.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd_amd64.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_openbsd_amd64.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd_amd64.go index a46d28af5..3229bb32c 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_openbsd_amd64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd_amd64.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause // Created by cgo -godefs - DO NOT EDIT // cgo -godefs types_openbsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_openbsd_arm.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd_arm.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_openbsd_arm.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd_arm.go index 68ea3c8f7..6f74ce756 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_openbsd_arm.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd_arm.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && arm -// +build openbsd,arm // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs process/types_openbsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_openbsd_arm64.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd_arm64.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_openbsd_arm64.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd_arm64.go index fa620ff67..910454562 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_openbsd_arm64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd_arm64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && arm64 -// +build openbsd,arm64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs process/types_openbsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_openbsd_riscv64.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd_riscv64.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_openbsd_riscv64.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd_riscv64.go index b677e70ad..e3e0d36a0 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_openbsd_riscv64.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_openbsd_riscv64.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build openbsd && riscv64 -// +build openbsd,riscv64 // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs process/types_openbsd.go diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_plan9.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_plan9.go similarity index 93% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_plan9.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_plan9.go index bc4bc062a..726758cae 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_plan9.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_plan9.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build plan9 -// +build plan9 package process @@ -7,9 +7,9 @@ import ( "context" "syscall" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/net" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/net" ) type Signal = syscall.Note @@ -82,15 +82,15 @@ func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { return false, common.ErrNotImplementedError } -func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) UidsWithContext(ctx context.Context) ([]uint32, error) { return nil, common.ErrNotImplementedError } -func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) GidsWithContext(ctx context.Context) ([]uint32, error) { return nil, common.ErrNotImplementedError } -func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) GroupsWithContext(ctx context.Context) ([]uint32, error) { return nil, common.ErrNotImplementedError } diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_posix.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_posix.go similarity index 97% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_posix.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_posix.go index a01f9ecfc..caa9d3f7c 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_posix.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_posix.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build linux || freebsd || openbsd || darwin || solaris -// +build linux freebsd openbsd darwin solaris package process @@ -16,7 +16,7 @@ import ( "golang.org/x/sys/unix" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" ) type Signal = syscall.Signal diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_solaris.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_solaris.go similarity index 95% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_solaris.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_solaris.go index dd4bd4760..04f86f16b 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_solaris.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_solaris.go @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: BSD-3-Clause package process import ( @@ -7,9 +8,9 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/net" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/net" ) type MemoryMapsStat struct { @@ -95,15 +96,15 @@ func (p *Process) ForegroundWithContext(ctx context.Context) (bool, error) { return false, common.ErrNotImplementedError } -func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) UidsWithContext(ctx context.Context) ([]uint32, error) { return nil, common.ErrNotImplementedError } -func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) GidsWithContext(ctx context.Context) ([]uint32, error) { return nil, common.ErrNotImplementedError } -func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) GroupsWithContext(ctx context.Context) ([]uint32, error) { return nil, common.ErrNotImplementedError } diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_windows.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_windows.go similarity index 98% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_windows.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_windows.go index f2053d985..f3111649a 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_windows.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_windows.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build windows -// +build windows package process @@ -18,9 +18,9 @@ import ( "unicode/utf16" "unsafe" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/internal/common" - "github.com/shirou/gopsutil/v3/net" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/internal/common" + "github.com/shirou/gopsutil/v4/net" "golang.org/x/sys/windows" ) @@ -466,15 +466,15 @@ func (p *Process) UsernameWithContext(ctx context.Context) (string, error) { return domain + "\\" + user, err } -func (p *Process) UidsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) UidsWithContext(ctx context.Context) ([]uint32, error) { return nil, common.ErrNotImplementedError } -func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) GidsWithContext(ctx context.Context) ([]uint32, error) { return nil, common.ErrNotImplementedError } -func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) { +func (p *Process) GroupsWithContext(ctx context.Context) ([]uint32, error) { return nil, common.ErrNotImplementedError } diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_windows_32bit.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_windows_32bit.go similarity index 97% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_windows_32bit.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_windows_32bit.go index db4d45334..2b231c79d 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_windows_32bit.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_windows_32bit.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build (windows && 386) || (windows && arm) -// +build windows,386 windows,arm package process @@ -8,7 +8,7 @@ import ( "syscall" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/windows" ) diff --git a/src/vendor/github.com/shirou/gopsutil/v3/process/process_windows_64bit.go b/src/vendor/github.com/shirou/gopsutil/v4/process/process_windows_64bit.go similarity index 95% rename from src/vendor/github.com/shirou/gopsutil/v3/process/process_windows_64bit.go rename to src/vendor/github.com/shirou/gopsutil/v4/process/process_windows_64bit.go index 74c6212cf..befe52139 100644 --- a/src/vendor/github.com/shirou/gopsutil/v3/process/process_windows_64bit.go +++ b/src/vendor/github.com/shirou/gopsutil/v4/process/process_windows_64bit.go @@ -1,5 +1,5 @@ +// SPDX-License-Identifier: BSD-3-Clause //go:build (windows && amd64) || (windows && arm64) -// +build windows,amd64 windows,arm64 package process @@ -7,7 +7,7 @@ import ( "syscall" "unsafe" - "github.com/shirou/gopsutil/v3/internal/common" + "github.com/shirou/gopsutil/v4/internal/common" "golang.org/x/sys/windows" ) diff --git a/src/vendor/modules.txt b/src/vendor/modules.txt index 8e7630e92..fd03ca035 100644 --- a/src/vendor/modules.txt +++ b/src/vendor/modules.txt @@ -222,15 +222,15 @@ github.com/prometheus/prometheus/util/stats github.com/prometheus/prometheus/util/strutil github.com/prometheus/prometheus/util/teststorage github.com/prometheus/prometheus/util/testutil -# github.com/shirou/gopsutil/v3 v3.24.5 +# github.com/shirou/gopsutil/v4 v4.24.6 ## explicit; go 1.18 -github.com/shirou/gopsutil/v3/common -github.com/shirou/gopsutil/v3/cpu -github.com/shirou/gopsutil/v3/host -github.com/shirou/gopsutil/v3/internal/common -github.com/shirou/gopsutil/v3/mem -github.com/shirou/gopsutil/v3/net -github.com/shirou/gopsutil/v3/process +github.com/shirou/gopsutil/v4/common +github.com/shirou/gopsutil/v4/cpu +github.com/shirou/gopsutil/v4/host +github.com/shirou/gopsutil/v4/internal/common +github.com/shirou/gopsutil/v4/mem +github.com/shirou/gopsutil/v4/net +github.com/shirou/gopsutil/v4/process # github.com/shoenig/go-m1cpu v0.1.6 ## explicit; go 1.20 github.com/shoenig/go-m1cpu