mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-19 04:16:21 +00:00
Forward OS/Kernel version to checkpoint
Useful to prioritize ebpf testing Also: * Make treatment of kernel release and version consistent across Darwin/Linux
This commit is contained in:
@@ -19,15 +19,15 @@ const kb = 1024
|
||||
// Uname is swappable for mocking in tests.
|
||||
var Uname = syscall.Uname
|
||||
|
||||
// GetKernelVersion returns the kernel version as reported by uname.
|
||||
var GetKernelVersion = func() (string, error) {
|
||||
// GetKernelReleaseAndVersion returns the kernel version as reported by uname.
|
||||
var GetKernelReleaseAndVersion = func() (string, string, error) {
|
||||
var utsname syscall.Utsname
|
||||
if err := Uname(&utsname); err != nil {
|
||||
return "unknown", err
|
||||
return "unknown", "unknown", err
|
||||
}
|
||||
release := marshal.FromUtsname(utsname.Release)
|
||||
version := marshal.FromUtsname(utsname.Version)
|
||||
return fmt.Sprintf("%s %s", release, version), nil
|
||||
return release, version, nil
|
||||
}
|
||||
|
||||
// GetLoad returns the current load averages as metrics.
|
||||
|
||||
Reference in New Issue
Block a user