Omar Polo
73f9c8dfd5
avoid cgo for cpu_openbsd
...
Even thought OpenBSD often breaks the ABI compatibility and doesn't make
*any* promise of "stability", this project aims to be "pure go" so avoid
doing inter-op at the cost of artificially reducing the number of
supported architectures down to amd64 and i386.
To add support for another architecture (e.g. arm), add another file
cpu_openbsd_${arch}.go like done for 386 and amd64. The fields are
declared as `long' in C, so pick the appropriate size when declaring the
struct.
2022-02-24 15:05:18 +01:00
Omar Polo
3c3c017f23
avoid copying kernCPUStats
2022-02-08 11:41:54 +00:00
Omar Polo
57d5711d44
refactor TimesWithContext
...
don't make assumptions on which CPUs are online and wich aren't based
on hw.smt and hw.ncpuonline. Rather, use KERN_CPUSTATS to get the CPU
statistics, which includes a flag field that can tell us if that CPU
is online or not.
2022-02-06 23:47:17 +00:00
Omar Polo
16cc7d7d73
improve sysctl parsing: use native byte order
...
We can't use unix.Sysctl* for some sysctls, so we're on our own with
converting data from C arrays.
Don't assume that the byte order is little endian but do the right
thing. Moreover, there's a little distinction in the sizes reported
by KERN_CPTIME (long[cpustates]) and KERN_CPTIME2
(u_int64_t[cpustates]) so account for that too.
2022-02-06 23:47:17 +00:00
Omar Polo
73db061652
some typos + rename smt to smtEnabled for readability
2022-02-06 23:47:17 +00:00
Omar Polo
9203029aae
drop compatibilty with OpenBSD < 6.4
...
6.3 was EOL'd more than three years ago!
2022-02-06 23:47:16 +00:00
shirou
e0ec1b9cda
Merge pull request #1238 from scop/spelling
...
Spelling and grammar fixes
v3.22.1
2022-01-31 22:14:00 +09:00
Ville Skyttä
1e56c6f421
Spelling and grammar fixes
2022-01-30 22:48:09 +02:00
shirou
696bb11b1e
Merge pull request #1235 from scop/refactor/parentwithcontext-ppidwithcontext
...
[process] implement ParentWithContext using PpidWithContext
2022-01-30 10:53:11 +09:00
shirou
50cad0760c
Merge branch 'master' into refactor/parentwithcontext-ppidwithcontext
2022-01-30 10:47:00 +09:00
shirou
34e74aaccb
Merge pull request #1229 from PierreF/darwin-drop-callps-step2
...
Darwin drop callps step2
2022-01-30 10:38:10 +09:00
shirou
6918006d35
Merge pull request #1233 from Kogelvis/almalinux_support
...
Let almalinux be part of the rhel family
2022-01-23 14:17:06 +09:00
shirou
5ba00db577
Merge pull request #1231 from shirou/feature/process_linux_Children_fix_error_check
...
[process][linux] Fix error handling on Children.
2022-01-23 14:10:44 +09:00
shirou
72100d4b16
Merge pull request #1234 from shirou/dependabot/go_modules/github.com/google/go-cmp-0.5.7
...
Bump github.com/google/go-cmp from 0.5.6 to 0.5.7
2022-01-23 14:10:06 +09:00
Ville Skyttä
0306525d78
[process] implement ParentWithContext using PpidWithContext
...
Removes need for redundant ParentWithContext implementations. It had led
to it being unsupported on FreeBSD and OpenBSD even though
PpidWithContext was available for them, and different implementations
for getting the parent info used in ParentWithContext and
PpidWithContext on Darwin and Linux.
2022-01-22 18:27:52 +02:00
dependabot[bot]
5d930b5b84
Bump github.com/google/go-cmp from 0.5.6 to 0.5.7
...
Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp ) from 0.5.6 to 0.5.7.
- [Release notes](https://github.com/google/go-cmp/releases )
- [Commits](https://github.com/google/go-cmp/compare/v0.5.6...v0.5.7 )
---
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-01-20 01:22:32 +00:00
Lammert Hellinga
001699bed7
Let almalinux be part of the rhel family
2022-01-19 22:37:51 +01:00
shirou
35fbe38505
[process][linux] Fix error handling on Children.
...
If pgrep returns error, `CallPgrepWithContext` always returns empty pids. So this Children always returns ErrorNoChildren. This PR fixes that handling.
2022-01-15 14:09:57 +00:00
shirou
511da82e94
Merge pull request #1224 from scop/feat/solaris-loadavg
...
[load][solaris] implement AvgWithContext
2022-01-15 17:49:02 +09:00
shirou
29058848ba
Merge pull request #1217 from scop/feat/freebsd-disk-serial
...
[disk][freebsd] implement SerialNumberWithContext
2022-01-15 17:46:41 +09:00
Pierre Fersing
43e50e1d7d
Reduce call to ps for process package on darwin
2022-01-14 09:41:54 +01:00
Pierre Fersing
60eae48e6a
Drop test for Darwin Pids()
2022-01-13 13:27:05 +01:00
Pierre Fersing
b9b3dbe67a
Avoid ps command and use KProc on MacOS
2022-01-13 11:57:04 +01:00
Lomanic
1ccce7b91c
Merge pull request #1223 from shirou/feature/remove_codecov
...
remove codecov
2022-01-12 00:43:40 +01:00
Ville Skyttä
31c410026d
[disk][freebsd] handle SerialNumberWithContext scanner errors
2022-01-11 08:32:36 +02:00
Ville Skyttä
d92d114f90
[load][solaris] implement AvgWithContext
2022-01-10 23:49:07 +02:00
shirou
59e366d674
remove codecov
2022-01-07 08:12:07 +00:00
Ville Skyttä
0d33df272b
[disk][freebsd] return empty serial on (null)
geom disk ident
2022-01-06 23:16:03 +02:00
shirou
a3ae4bc40d
Merge pull request #1221 from shirou/feature/process_win_fix_dup_handle
...
[process][windows] fix release handle
2022-01-06 22:24:23 +09:00
shirou
dcac9d9b01
[process][windows] fix release handle
2022-01-06 22:16:57 +09:00
shirou
fdfd273cf0
Merge pull request #1218 from scop/feat/freebsd-process-start
...
[process][freebsd] implement createTimeWithContext
2022-01-06 22:04:54 +09:00
shirou
64a13e4c18
Merge pull request #1219 from Lomanic/issue1216
...
[process][windows] Fix #1216 fix compilation on arm/arm64
2022-01-06 21:15:55 +09:00
shirou
b4808b3e94
Merge pull request #1204 from YangKeao/fix-unstable-boottime
...
fix unstable boot time because of float conversion
2022-01-06 21:09:53 +09:00
shirou
c56b5223c5
Merge pull request #1215 from Lomanic/issue1198
...
[net][linux] Fix #1198 "f.ReadDir undefined" on Go 1.15 by redefining a custom readDir according to go version
2022-01-06 20:52:16 +09:00
Lomanic
01cf95a92d
[process][windows] Fix #1216 fix compilation on arm/arm64
...
go build ./... with GOARCH=arm64 is otherwise failing with the following:
process\process_windows.go:412:11: undefined: readProcessMemory
process\process_windows.go:425:11: undefined: readProcessMemory
process\process_windows.go:896:32: undefined: PROCESS_MEMORY_COUNTERS
process\process_windows.go:897:10: undefined: PROCESS_MEMORY_COUNTERS
process\process_windows.go:910:50: undefined: PROCESS_MEMORY_COUNTERS
process\process_windows.go:950:21: undefined: queryPebAddress
process\process_windows.go:955:9: undefined: readProcessMemory
process\process_windows.go:961:8: undefined: readProcessMemory
process\process_windows.go:969:21: undefined: queryPebAddress
process\process_windows.go:974:9: undefined: readProcessMemory
process\process_windows.go:974:9: too many errors
2022-01-05 01:09:23 +01:00
Ville Skyttä
41e2595443
[process][freebsd] implement createTimeWithContext
2022-01-05 01:20:20 +02:00
Ville Skyttä
df68a56e2d
[disk][freebsd] implement SerialNumberWithContext
2022-01-05 00:38:50 +02:00
Lomanic
d826e14e27
[net][linux] Fix #1198 "f.ReadDir undefined" on Go 1.15 by redefining a custom readDir according to go version
...
Using os.File.Readdir pre Go 1.16 and os.File.ReadDir post Go 1.16
2022-01-01 18:07:03 +01:00
shirou
2f8da0a394
Merge pull request #1205 from mmorel-35/master
...
enable more linters, report coverage and cache mods
v3.21.12
2021-12-29 22:31:24 +09:00
Matthieu MOREL
fe2fab4938
Update test.yml
2021-12-27 18:25:31 +01:00
Lomanic
0bd6ae1cf1
Merge pull request #1207 from makazeu/patch-1
...
Fix a typo in comment
2021-12-25 19:37:15 +01:00
Matthieu MOREL
a9e4ce7cf9
enable goimports linter
2021-12-24 21:54:45 +01:00
Matthieu MOREL
e6e3f9399b
enable importas linter
2021-12-24 21:46:59 +01:00
Matthieu MOREL
0f342652ad
enable nakedret linter
2021-12-24 21:32:30 +01:00
Matthieu MOREL
803be09d63
enable megacheck linter
2021-12-24 21:25:34 +01:00
Makazeu
521fafd945
Fix a typo in comment
2021-12-24 17:14:50 +08:00
Matthieu MOREL
2252055b93
enable codecoverage
2021-12-23 08:39:43 +01:00
Matthieu MOREL
5c5245372d
enable predeclared linter
2021-12-23 00:54:07 +01:00
Matthieu MOREL
f8c685e717
enable caching in workflows
2021-12-23 00:46:14 +01:00
Matthieu MOREL
851bffc0f1
enable gosec linter
2021-12-23 00:31:04 +01:00