X7ROOT File Manager
Current Path:
/opt/golang/1.19.4/src/runtime/pprof
opt
/
golang
/
1.19.4
/
src
/
runtime
/
pprof
/
📁
..
📄
elf.go
(2.79 KB)
📄
label.go
(2.95 KB)
📄
label_test.go
(3.21 KB)
📄
map.go
(1.94 KB)
📄
mprof_test.go
(5.32 KB)
📄
pprof.go
(27.95 KB)
📄
pprof_norusage.go
(378 B)
📄
pprof_rusage.go
(838 B)
📄
pprof_test.go
(59.88 KB)
📄
proto.go
(25.59 KB)
📄
proto_test.go
(16.37 KB)
📄
protobuf.go
(2.51 KB)
📄
protomem.go
(2.91 KB)
📄
protomem_test.go
(2.53 KB)
📄
runtime.go
(1.5 KB)
📄
runtime_test.go
(3 KB)
📄
rusage_test.go
(827 B)
📁
testdata
📄
uname_linux_test.go
(1.3 KB)
📄
uname_other_test.go
(335 B)
Editing: uname_linux_test.go
// Copyright 2021 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build linux package pprof import ( "fmt" "regexp" "strconv" "syscall" ) var versionRe = regexp.MustCompile(`^(\d+)(?:\.(\d+)(?:\.(\d+))).*$`) func linuxKernelVersion() (major, minor, patch int, err error) { var uname syscall.Utsname if err := syscall.Uname(&uname); err != nil { return 0, 0, 0, err } buf := make([]byte, 0, len(uname.Release)) for _, b := range uname.Release { if b == 0 { break } buf = append(buf, byte(b)) } rl := string(buf) m := versionRe.FindStringSubmatch(rl) if m == nil { return 0, 0, 0, fmt.Errorf("error matching version number in %q", rl) } v, err := strconv.ParseInt(m[1], 10, 64) if err != nil { return 0, 0, 0, fmt.Errorf("error parsing major version %q in %s: %w", m[1], rl, err) } major = int(v) if len(m) >= 3 { v, err := strconv.ParseInt(m[2], 10, 64) if err != nil { return 0, 0, 0, fmt.Errorf("error parsing minor version %q in %s: %w", m[2], rl, err) } minor = int(v) } if len(m) >= 4 { v, err := strconv.ParseInt(m[3], 10, 64) if err != nil { return 0, 0, 0, fmt.Errorf("error parsing patch version %q in %s: %w", m[3], rl, err) } patch = int(v) } return }
Upload File
Create Folder