Commit Graph

13 Commits

Author SHA1 Message Date
Ville Skyttä f7e1f36418 refactor: remove unnecessary exec.LookPath calls
Executing the command does the lookup if needed and returns the same
error when not found, no need to do it separately.
2022-03-04 18:56:33 +02:00
mmorel-35 1e6b445a8a gofumpt 2021-12-22 21:54:41 +00:00
Ville Skyttä 2278747969 [v2][cpu][solaris] psrinfo parsing fixes 2021-05-08 16:41:03 +03:00
Tobias Klauser ee12f66e4d cpu, v3/cpu: use sysconf package instead of exec'ing getconf
Currently, ClocksPerSec is determined by exec'ing getconf in func init,
i.e. on startup of every program importing the package. getconf might
not be present on some systems or is not executable by the current user.
To avoid this hard to control dependency, use the
github.com/tklauser/go-sysconf package which implements sysconf(3)
entirely in Go without cgo. The package is supported on all platforms
currently supported by the cpu and v3/cpu package of gopsutil.
2021-02-19 12:20:10 +01:00
Chad Harp 8c6072d111 Cast bytes to string 2019-06-07 07:39:57 -05:00
Chad Harp 16b37cc9c2 Modify cpu_solaris to support Sorlais 10 2019-06-02 09:58:35 -05:00
Chad Harp 354718bdd8 Add support for Solaris CPU times 2019-06-01 15:05:46 -05:00
Segflow 86c7289ccc Fix: use filename in exec.LookPath instead of full path
exec.LookPath searches for the file in the $PATH, which mean giving it an absolute path is against it's own purposes.
2019-05-05 20:45:07 +01:00
Lomanic c0ca431bf1 [cpu][linux] Add support for logical arg in Counts #640 #628 2019-03-03 14:44:21 +01:00
shirou 145dca90f7 change to use CommandContext. 2018-03-31 21:35:53 +09:00
shirou 4c73494c78 Add WithContext functions. 2017-12-31 15:25:49 +09:00
WAKAYAMA Shirou f8ef680a47 error strings change to lowercase 2017-03-15 22:43:20 +09:00
James Nugent 49ed700c0d cpu: Implement Solaris support for Info()
This commit adds Solaris(^1) support for the Info() function of package
cpu, with the exception of the L2 cache size which is not trivially
available(^2).

Support is implemented by parsing the output of `isainfo -b -v` (for the
instruction set flags), and `psr-info -p -v` for other information.
Example outputs from a range of different size VMs and Joyent containers
are included as part of the tests.

(^1): This has only been tested with Illumos in the form of SmartOS. I
believe it to be portable to other Illumos distributions but have not
tested on Oracle Solaris.

(^2): Enough support is added here to be usable for my port of
HashiCorp's Nomad to SmartOS.
2017-03-12 21:19:42 -05:00