1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-05-08 19:29:25 +08:00

2429 Commits

Author SHA1 Message Date
dependabot[bot]
fd69d68f44
chore(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.3
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.2 to 1.8.3.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.2...v1.8.3)

---
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>
2023-05-19 01:58:28 +00:00
shirou
7c610c5037
Merge pull request #1462 from cuishuang/master
fix some comments
2023-05-13 12:12:18 +09:00
cui fliter
9aa4e7a744 fix some comments
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-05-09 16:42:07 +08:00
shirou
e045dc75ca
Merge pull request #1460 from shirou/dependabot/go_modules/github.com/shoenig/go-m1cpu-0.1.6
chore(deps): bump github.com/shoenig/go-m1cpu from 0.1.5 to 0.1.6
2023-05-05 21:16:32 +09:00
shirou
d67461898b
Merge pull request #1459 from shirou/dependabot/go_modules/golang.org/x/sys-0.8.0
chore(deps): bump golang.org/x/sys from 0.7.0 to 0.8.0
2023-05-05 21:16:12 +09:00
dependabot[bot]
9c692e250e
chore(deps): bump github.com/shoenig/go-m1cpu from 0.1.5 to 0.1.6
Bumps [github.com/shoenig/go-m1cpu](https://github.com/shoenig/go-m1cpu) from 0.1.5 to 0.1.6.
- [Release notes](https://github.com/shoenig/go-m1cpu/releases)
- [Commits](https://github.com/shoenig/go-m1cpu/compare/v0.1.5...v0.1.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-05 01:58:43 +00:00
dependabot[bot]
61afc551e2
chore(deps): bump golang.org/x/sys from 0.7.0 to 0.8.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.7.0 to 0.8.0.
- [Commits](https://github.com/golang/sys/compare/v0.7.0...v0.8.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-05 01:58:38 +00:00
shirou
db89d12010
Merge pull request #1453 from Juneezee/refactor/errors.Is
refactor(process): compare error with `errors.Is`
v3.23.4
2023-04-29 00:59:48 +09:00
Eng Zer Jun
0439039205
refactor(process): compare error with errors.Is
Starting from Go 1.13, `errors.Is` is the preferable way to compare
error equality [1].

[1]: https://go.dev/blog/go1.13-errors

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-04-24 15:00:01 +08:00
shirou
17fac7cbba
Merge pull request #1450 from gabibguti/master
Add Security Policy
2023-04-16 18:46:34 +09:00
Gabriela Gutierrez
2d2db8fee9
Create SECURITY.md
Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>
2023-04-13 10:34:56 -03:00
shirou
10f213c448
Merge pull request #1448 from shirou/dependabot/github_actions/actions/upload-artifact-3.1.2
chore(deps): bump actions/upload-artifact from 3.1.0 to 3.1.2
2023-04-07 11:05:53 +09:00
dependabot[bot]
d6ee47e5dc
chore(deps): bump actions/upload-artifact from 3.1.0 to 3.1.2
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3.1.0 to 3.1.2.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3.1.0...v3.1.2)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-07 01:57:53 +00:00
shirou
cf428f8c72
Merge pull request #1443 from mmorel-35/linter
ci(lint): correct gci linter
2023-04-06 23:11:29 +09:00
shirou
755bcab7b9
Update branch of sbom_generator.yml 2023-04-06 23:10:05 +09:00
shirou
21a646bd82
Merge pull request #1447 from shirou/feature/add_sbom_github_actions
Add github SBOM Generator
2023-04-06 22:50:27 +09:00
shirou
bcf3fe925c
Merge pull request #1445 from shirou/dependabot/go_modules/golang.org/x/sys-0.7.0
chore(deps): bump golang.org/x/sys from 0.6.0 to 0.7.0
2023-04-06 22:01:32 +09:00
dependabot[bot]
f79a932b05 chore(deps): bump golang.org/x/sys from 0.6.0 to 0.7.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-06 12:52:45 +00:00
shirou
90f9165482 Merge branch 'master' of github.com:shirou/gopsutil into feature/add_sbom_github_actions 2023-04-06 12:49:47 +00:00
shirou
c975eb31f4
Merge pull request #1446 from shirou/dependabot/go_modules/github.com/shoenig/go-m1cpu-0.1.5
chore(deps): bump github.com/shoenig/go-m1cpu from 0.1.4 to 0.1.5
2023-04-06 21:49:20 +09:00
shirou
68a3b4210c fix: remove ubuntu-18.04, add macos-12, windows-2022
ubuntu-18.04 has been deprecated:
https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
2023-04-06 12:38:52 +00:00
shirou
d7f65a84ca Add github SBOM Generator
See this GitHub blog post
https://github.blog/2023-03-28-introducing-self-service-sboms/
2023-04-06 12:31:41 +00:00
dependabot[bot]
13b3618b1e
chore(deps): bump github.com/shoenig/go-m1cpu from 0.1.4 to 0.1.5
Bumps [github.com/shoenig/go-m1cpu](https://github.com/shoenig/go-m1cpu) from 0.1.4 to 0.1.5.
- [Release notes](https://github.com/shoenig/go-m1cpu/releases)
- [Commits](https://github.com/shoenig/go-m1cpu/compare/v0.1.4...v0.1.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-05 01:58:38 +00:00
Matthieu MOREL
1fb1e3e3e6 ci(lint): correct gci linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-04-04 18:07:22 +00:00
shirou
6bda1a5c01
Merge pull request #1436 from shoenig/support-mhz-apple-silicon
cpu: add frequency support for apple silicon m1/m2 cpus
v3.23.3
2023-04-01 00:04:21 +09:00
Seth Hoenig
8617ff654a cpu: add frequency support for apple silicon m1/m2 cpus
This PR adds support for reading the frequency of Apple Silicon
M1/M2 CPUs. We do so by reading the values out of the IOKit
framework, as a few other projects have now demonstrated to be
possible. This requires the use of CGO. The library provides a
convenience IsAppleSilicon() guard to detect whether the values
can be read.

Currently gopsutil does not support the big.LITTLE CPU architectures
(i think?) - in fact the P and E cores have different max frequencies.
For now, just read the P core frequency. The E core data is readily
available if we want to read it in the future.

Closes #1000

Small example program

```go
package main

import (
        "fmt"

        "github.com/shoenig/go-m1cpu"

        "github.com/shirou/gopsutil/v3/cpu"
)

func main() {
        fmt.Println("is Apple Silicon:", m1cpu.IsAppleSilicon())
        fmt.Println("model name", m1cpu.ModelName())
        fmt.Println("pCore GHz", m1cpu.PCoreGHz())
        fmt.Println("eCore GHz", m1cpu.ECoreGHz())
        fmt.Println("pCore Hz", m1cpu.PCoreHz())
        fmt.Println("eCore Hz", m1cpu.ECoreHz())

        fmt.Println("----- gopsutil ----")

        infos, err := cpu.Info()
        if err != nil {
                panic(err)
        }

        for _, info := range infos {
                fmt.Println("info.Mhz", info.Mhz)
        }
}
```

```shell
go run main.go
is Apple Silicon: true
model name Apple M2 Pro
pCore GHz 3.504
eCore GHz 2.424
pCore Hz 3504000000
eCore Hz 2424000000
----- gopsutil ----
info.Mhz 3.504e+09
```
2023-03-27 21:17:12 -05:00
shirou
c0365978d8
Merge pull request #1433 from shirou/feature/ignore_revive_issues
chore(golangci-lint): exlucde unused-parameters and empty-block rule
2023-03-20 16:54:36 +09:00
shirou
24be017cf9 chore(golangci-lint): exlucde unused-parameters and empty-block rule
These are intentional.
2023-03-19 14:42:02 +00:00
shirou
586926508c
Merge pull request #1431 from powersj/fix/1429
fix: moves common.Warnings to common OS files
2023-03-19 22:41:51 +09:00
shirou
27c8bfae7a
Merge pull request #1430 from davidnewhall/master
Fix 'send on closed channel' bug with windows disks
2023-03-19 22:40:12 +09:00
shirou
06a922c621
Merge pull request #1432 from shirou/dependabot/github_actions/actions/setup-go-4
chore(deps): bump actions/setup-go from 3 to 4
2023-03-16 20:05:26 +09:00
dependabot[bot]
0f0223064d
chore(deps): bump actions/setup-go from 3 to 4
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v3...v4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-16 01:58:37 +00:00
Josh Powers
e7c6b6991d
fix: moves common.Warnings to common OS files
This allows all OS types to unwrap the Warnings from errors, and not
just linux in host or windows in disk.

fixes: #1429
2023-03-15 06:39:08 -06:00
David Newhall II
3a88ef27a5 close channel in function that sends to it 2023-03-13 20:09:01 -07:00
shirou
c7c548d6bd
Merge pull request #1428 from dhurley/add-support-for-process-exe-for-freebsd
FreeBSD process exe support
2023-03-11 00:26:13 +09:00
shirou
50d889cc59
Merge pull request #1421 from jak3kaj/cumulus-linux-support
Recognize Cumulus Linux distro
2023-03-10 23:59:18 +09:00
Jacob Young
02660eaf7c
Update host/host_linux.go
Use a raw string instead of escaped quotes.

Co-authored-by: shirou <shirou.faw@gmail.com>
2023-03-10 09:41:18 -05:00
Donal Hurley
cf25de7460 Add support for getting process exe in FreeBSD 2023-03-09 11:46:40 +00:00
shirou
dda567eee6
Merge pull request #1427 from shirou/dependabot/go_modules/golang.org/x/sys-0.6.0
chore(deps): bump golang.org/x/sys from 0.5.0 to 0.6.0
2023-03-06 12:28:08 +09:00
dependabot[bot]
78d3bf5ace
chore(deps): bump golang.org/x/sys from 0.5.0 to 0.6.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.5.0...v0.6.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-06 02:15:15 +00:00
shirou
ad7274d0cc
Merge pull request #1426 from 3139487747/patch-1
English case error
2023-03-04 23:07:15 +09:00
syyyj
39770901ac
English case error
m to M
2023-03-04 02:58:54 +08:00
shirou
7ab2f0eba3
Merge pull request #1423 from shirou/dependabot/go_modules/github.com/stretchr/testify-1.8.2
chore(deps): bump github.com/stretchr/testify from 1.8.1 to 1.8.2
v3.23.2
2023-02-27 12:56:00 +09:00
dependabot[bot]
1e85027fe4
chore(deps): bump github.com/stretchr/testify from 1.8.1 to 1.8.2
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.1 to 1.8.2.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.1...v1.8.2)

---
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>
2023-02-27 02:44:21 +00:00
Jacob Young
43566581f0 Recognize Cumulus Linux distro
Add Cumulus Linux and Kylin to debian family
2023-02-24 13:59:01 -05:00
shirou
b51f72ebfb
Merge pull request #1412 from powersj/fix/dm-resolution
fix(disk): correctly replace /dev in /dev/mapper
2023-02-18 10:41:08 +09:00
shirou
1c27744fc9
Merge pull request #1413 from shirou/dependabot/go_modules/golang.org/x/sys-0.5.0
chore(deps): bump golang.org/x/sys from 0.4.0 to 0.5.0
2023-02-12 19:00:20 +09:00
shirou
f78f9a6bb8
Merge pull request #1414 from jeffweiss/bugfix/get_tests_working_on_s390x
get tests passing on s390x
2023-02-12 18:58:26 +09:00
shirou
57bee8213a
Merge pull request #1417 from shirou/feature/fix_lint
fix lint
2023-02-12 18:54:26 +09:00
shirou
852f455217 fix lint 2023-02-12 09:24:52 +00:00