1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-26 13:48:59 +08:00

2178 Commits

Author SHA1 Message Date
Aman Gupta Karmani
34cc43d282
[android][host] fix Info() failure due to forbidden /proc/stat and /proc/uptime (#1361)
* [android][host] fallback to sysinfo() syscall for uptime

with Android O, /proc/{stat,uptime} both return permission denied
2022-11-19 04:17:18 +01:00
shirou
d3ea8776ff
Merge pull request #1362 from fancybits/ios-iokit
[ios][disk] IOKit is not available on iOS
2022-11-19 11:58:31 +09:00
shirou
672e2518f2
Merge pull request #1374 from shirou/feature/add_ubr_on_host_windows
feat(host, windows): add UBR (Update Build Revision) to kernel version
2022-11-10 10:22:20 +09:00
shirou
2099ec6e27
Merge pull request #1375 from shirou/dependabot/go_modules/github.com/tklauser/go-sysconf-0.3.11
chore(deps): bump github.com/tklauser/go-sysconf from 0.3.10 to 0.3.11
2022-11-10 10:22:05 +09:00
dependabot[bot]
2a3e4c7326
chore(deps): bump github.com/tklauser/go-sysconf from 0.3.10 to 0.3.11
Bumps [github.com/tklauser/go-sysconf](https://github.com/tklauser/go-sysconf) from 0.3.10 to 0.3.11.
- [Release notes](https://github.com/tklauser/go-sysconf/releases)
- [Commits](https://github.com/tklauser/go-sysconf/compare/v0.3.10...v0.3.11)

---
updated-dependencies:
- dependency-name: github.com/tklauser/go-sysconf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-10 01:08:53 +00:00
shirou
59246d8b0f
Merge pull request #1373 from yaozbek/modelname-support-for-arm
feat: Setting the model name for arm based CPUs
2022-11-06 13:13:02 +09:00
Yalcin Ozbek
8bf7f37fca
the code has been moved before append
Signed-off-by: Yalcin Ozbek <yalcinozbekceng@gmail.com>
2022-11-05 16:40:39 +03:00
Yalcin Ozbek
4314a0567b
the code has been moved outside the loop.
Signed-off-by: Yalcin Ozbek <yalcinozbekceng@gmail.com>
2022-11-05 16:37:04 +03:00
Yalcin Ozbek
13f00fde46
code review fix
Signed-off-by: Yalcin Ozbek <yalcinozbekceng@gmail.com>
2022-11-05 15:06:30 +03:00
shirou
68452e2602 feat(host, windows): add UBR (Update Build Revision) to kernel version 2022-11-05 20:59:15 +09:00
Yalcin Ozbek
102439862e
feat: Setting the model name for arm based CPUs
- Added arm model and model name as map.
- The modelName is set again according to the model value when the model name is empty.
- Based on lscpu source code.. https://github.com/util-linux/util-linux/blob/master/sys-utils/lscpu-arm.c

---

Signed-off-by: Yalcin Ozbek <yalcinozbekceng@gmail.com>
2022-11-05 02:36:48 +03:00
shirou
50f22507f5
Merge pull request #1365 from ib-steffen/pass-context
Pass on context to ConnectionsPidWithContext
v3.22.10
2022-10-29 13:45:28 +09:00
shirou
b34aa19712
Merge pull request #1370 from shirou/dependabot/go_modules/github.com/stretchr/testify-1.8.1
chore(deps): bump github.com/stretchr/testify from 1.8.0 to 1.8.1
2022-10-29 13:29:07 +09:00
shirou
20b15fb639
Merge pull request #1369 from Lomanic/issue1368
[process][windows] Retrieve process name as basename of executable
2022-10-29 13:28:52 +09:00
dependabot[bot]
359e8eb4b3
chore(deps): bump github.com/stretchr/testify from 1.8.0 to 1.8.1
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.0...v1.8.1)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-24 01:45:06 +00:00
Lomanic
980cc82c08 [process][windows] Retrieve process name as basename of executable
We align ourself with psutil
8e4099d9f0/psutil/_pswindows.py (L749-L759)

Benchmarks show vast improvements

    go test -run=BenchmarkProcessName -bench=BenchmarkProcessName ./process
    goos: windows
    goarch: amd64
    pkg: github.com/shirou/gopsutil/v3/process
    cpu: Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz
    BenchmarkProcessName-4               180           6564033 ns/op
    BenchmarkProcessNameViaExe-4       22111             51153 ns/op
    PASS
    ok      github.com/shirou/gopsutil/v3/process   3.914s

Fixes #1368
2022-10-22 21:43:23 +02:00
Lomanic
bd4529a7cc [process][windows] Refator a tiny bit is32BitProcess() function to be more idiomatic Go 2022-10-22 19:09:36 +02:00
Steffen Geissinger
5bbcabf17d Pass on context to ConnectionsPidWithContext 2022-10-19 10:07:21 +02:00
Aman Karmani
0823447625 [ios][disk] IOKit is not available on iOS 2022-10-11 13:17:17 -07:00
shirou
400a453e67
Merge pull request #1360 from bduffany/darwin-memleak
Fix memory leaks in process_darwin_cgo
2022-10-09 12:57:36 +09:00
shirou
769daafb9e
Merge pull request #1347 from atoulme/windows_errors
Return all Windows partitions
2022-10-09 12:55:42 +09:00
Brandon Duffany
38064605a8 Fix memory leaks in darwin_cgo 2022-10-04 14:35:52 -04:00
Antoine Toulme
dbc0f20fe3 code review 2022-10-03 13:55:14 -07:00
shirou
16b3aac6ad
Merge pull request #1336 from johanburati/job043
Add hostinfo Virtualization hyperv
v3.22.9
2022-09-30 17:33:58 +09:00
shirou
da529f3639
Merge pull request #1341 from chbuescher/master
implement aix nocgo disk usage
2022-09-30 17:13:54 +09:00
shirou
38732e038f
Merge pull request #1348 from shirou/dependabot/github_actions/actions/checkout-3
chore(deps): bump actions/checkout from 2 to 3
2022-09-30 17:12:09 +09:00
shirou
d36a053dc5
Merge pull request #1349 from shirou/dependabot/go_modules/github.com/google/go-cmp-0.5.9
chore(deps): bump github.com/google/go-cmp from 0.5.8 to 0.5.9
2022-09-30 17:11:49 +09:00
shirou
434cc29594
Merge pull request #1345 from itsties/patch-1
[disk][linux] Fix for diskusage Ceph mount
2022-09-09 16:09:44 +09:00
dependabot[bot]
3ebe2e0471
chore(deps): bump github.com/google/go-cmp from 0.5.8 to 0.5.9
Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.8 to 0.5.9.
- [Release notes](https://github.com/google/go-cmp/releases)
- [Commits](https://github.com/google/go-cmp/compare/v0.5.8...v0.5.9)

---
updated-dependencies:
- dependency-name: github.com/google/go-cmp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-09 01:21:23 +00:00
dependabot[bot]
3ece2bff78
chore(deps): bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-09 01:13:29 +00:00
Antoine Toulme
6b2bfe408d Return all partitions on Windows and all errors rather than returning early 2022-09-06 23:13:22 -07:00
shirou
a63ec01c75
Merge pull request #1346 from tienthanh1993/master
fix(process,windows): compare len(cwd) to an incorrect value
2022-09-04 22:38:53 +09:00
Ties de Wit
f253d81d1b
Update common.go 2022-09-01 09:18:20 +02:00
Ties de Wit
e4409ef6a1
Update net_linux.go 2022-09-01 09:17:10 +02:00
Ties de Wit
705a63f1b2
Update disk_unix.go 2022-08-29 15:44:23 +02:00
tienthanh1993
6bc339626b
fix(process,windows): compare len(cwd) to an incorrect value
process/process_windows.go#L411 len(cwd) need compare to userProcParams.CurrentDirectoryPathNameLength instead of userProcParams.CurrentDirectoryPathAddress
2022-08-25 20:09:21 +07:00
Ties de Wit
43d805cf5d
Fix for diskusage Ceph mount
This sets `used` and `usedPercent` correctly in #1344
2022-08-25 09:55:04 +02:00
xca1075
9ef87ea3d8 aix disk: implement getFSType to get Usage() from disk_unix working; implement Partitions() 2022-08-12 14:59:18 +02:00
Johan Burati
e7034b47f2 Add hostinfo Virtualization hyperv 2022-08-02 16:23:43 +09:00
shirou
ed37dc27a2
Merge pull request #1335 from tklauser/drop-darwin-386
host, process: delete darwin/386 code
v3.22.8 v3.22.7
2022-07-30 11:24:12 +09:00
shirou
1499bf63a6 feat: drop darwin/i386 from README and Makefile 2022-07-30 02:11:39 +00:00
shirou
360136f405
Merge pull request #1333 from kyz/remove-iomainport
Replace IOMainPort/IOMasterPort() and kIOMainPortDefault/kIOMasterPortDefault with NULL
2022-07-30 11:05:55 +09:00
Stuart Caie
e0400cc94f Use 0 as default mach port 2022-07-30 00:44:15 +00:00
shirou
190dfee6b4
Merge pull request #1334 from kyz/fix-darwin-pagesize
mem.VirtualMemory(): wrong page size on darwin arm64
2022-07-29 20:58:03 +09:00
Tobias Klauser
c76712b8da
host, process: delete darwin/386 code
The darwin/386 port was dropped in Go 1.15 and the imported version of
golang.org/x/sys also no longer supports the port. This module requires
at least Go 1.15 per go.mod, so it no longer builds on darwin/386
anyway.
2022-07-28 13:01:59 +02:00
Stuart Caie
d962cf2d68 Use the page size that host_statistics() pages are measured in 2022-07-25 12:22:57 +00:00
Stuart Caie
55411f1178 Replace IOMainPort/IOMasterPort() and kIOMainPortDefault/kIOMasterPortDefault with NULL 2022-07-25 12:19:31 +00:00
shirou
a1701dcb73
Merge pull request #1330 from Lomanic/macos-ci-update
Update README with /v3 godoc links and remove deprecated macos-10.15 virtual environment in CI
2022-07-22 12:06:44 +09:00
Lomanic
ef5eaa83fe
Merge pull request #1328 from shirou/feature/check-file-contents
fix(host,linux): Check if path exists and is nonempty before reading host files
2022-07-20 00:57:01 +02:00
Lomanic
2553c620ed [ci] Remove deprecated macos-10.15 virtual environment in tests
Ref https://github.com/actions/virtual-environments/issues/5583
2022-07-20 00:44:15 +02:00