diff options
author | Ian Lance Taylor <iant@golang.org> | 2020-12-23 09:57:37 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2020-12-30 15:13:24 -0800 |
commit | cfcbb4227fb20191e04eb8d7766ae6202f526afd (patch) | |
tree | e2effea96f6f204451779f044415c2385e45042b /libgo/go/runtime/pprof | |
parent | 0696141107d61483f38482b941549959a0d7f613 (diff) | |
download | gcc-cfcbb4227fb20191e04eb8d7766ae6202f526afd.zip gcc-cfcbb4227fb20191e04eb8d7766ae6202f526afd.tar.gz gcc-cfcbb4227fb20191e04eb8d7766ae6202f526afd.tar.bz2 |
libgo: update to Go1.16beta1 release
This does not yet include support for the //go:embed directive added
in this release.
* Makefile.am (check-runtime): Don't create check-runtime-dir.
(mostlyclean-local): Don't remove check-runtime-dir.
(check-go-tool, check-vet): Copy in go.mod and modules.txt.
(check-cgo-test, check-carchive-test): Add go.mod file.
* Makefile.in: Regenerate.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/280172
Diffstat (limited to 'libgo/go/runtime/pprof')
-rw-r--r-- | libgo/go/runtime/pprof/mprof_test.go | 2 | ||||
-rw-r--r-- | libgo/go/runtime/pprof/pprof_rusage.go | 2 | ||||
-rw-r--r-- | libgo/go/runtime/pprof/pprof_test.go | 13 | ||||
-rw-r--r-- | libgo/go/runtime/pprof/proto.go | 4 | ||||
-rw-r--r-- | libgo/go/runtime/pprof/proto_test.go | 3 |
5 files changed, 13 insertions, 11 deletions
diff --git a/libgo/go/runtime/pprof/mprof_test.go b/libgo/go/runtime/pprof/mprof_test.go index 83bf572..9551ea7 100644 --- a/libgo/go/runtime/pprof/mprof_test.go +++ b/libgo/go/runtime/pprof/mprof_test.go @@ -70,7 +70,7 @@ func TestMemoryProfiler(t *testing.T) { runtime.MemProfileRate = oldRate }() - // Allocate a meg to ensure that mcache.next_sample is updated to 1. + // Allocate a meg to ensure that mcache.nextSample is updated to 1. for i := 0; i < 1024; i++ { memSink = make([]byte, 1024) } diff --git a/libgo/go/runtime/pprof/pprof_rusage.go b/libgo/go/runtime/pprof/pprof_rusage.go index d42e6ed..7954673 100644 --- a/libgo/go/runtime/pprof/pprof_rusage.go +++ b/libgo/go/runtime/pprof/pprof_rusage.go @@ -19,7 +19,7 @@ func addMaxRSS(w io.Writer) { switch runtime.GOOS { case "linux", "android": rssToBytes = 1024 - case "darwin": + case "darwin", "ios": rssToBytes = 1 default: panic("unsupported OS") diff --git a/libgo/go/runtime/pprof/pprof_test.go b/libgo/go/runtime/pprof/pprof_test.go index 7adf891..42411e9 100644 --- a/libgo/go/runtime/pprof/pprof_test.go +++ b/libgo/go/runtime/pprof/pprof_test.go @@ -13,7 +13,6 @@ import ( "internal/profile" "internal/testenv" "io" - "io/ioutil" "math/big" "os" "os/exec" @@ -262,7 +261,7 @@ func parseProfile(t *testing.T, valBytes []byte, f func(uintptr, []*profile.Loca // as interpreted by matches, and returns the parsed profile. func testCPUProfile(t *testing.T, matches matchFunc, need []string, avoid []string, f func(dur time.Duration)) *profile.Profile { switch runtime.GOOS { - case "darwin": + case "darwin", "ios": switch runtime.GOARCH { case "arm64": // nothing @@ -280,12 +279,16 @@ func testCPUProfile(t *testing.T, matches matchFunc, need []string, avoid []stri broken := false switch runtime.GOOS { - case "darwin", "dragonfly", "netbsd", "illumos", "solaris": + case "darwin", "ios", "dragonfly", "netbsd", "illumos", "solaris": broken = true case "openbsd": if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { broken = true } + case "windows": + if runtime.GOARCH == "arm" { + broken = true // See https://golang.org/issues/42862 + } } maxDuration := 5 * time.Second @@ -1195,7 +1198,7 @@ func TestLabelRace(t *testing.T) { // Check that there is no deadlock when the program receives SIGPROF while in // 64bit atomics' critical section. Used to happen on mips{,le}. See #20146. func TestAtomicLoadStore64(t *testing.T) { - f, err := ioutil.TempFile("", "profatomic") + f, err := os.CreateTemp("", "profatomic") if err != nil { t.Fatalf("TempFile: %v", err) } @@ -1224,7 +1227,7 @@ func TestAtomicLoadStore64(t *testing.T) { func TestTracebackAll(t *testing.T) { // With gccgo, if a profiling signal arrives at the wrong time // during traceback, it may crash or hang. See issue #29448. - f, err := ioutil.TempFile("", "proftraceback") + f, err := os.CreateTemp("", "proftraceback") if err != nil { t.Fatalf("TempFile: %v", err) } diff --git a/libgo/go/runtime/pprof/proto.go b/libgo/go/runtime/pprof/proto.go index bd269e7..6c5dd31 100644 --- a/libgo/go/runtime/pprof/proto.go +++ b/libgo/go/runtime/pprof/proto.go @@ -10,7 +10,7 @@ import ( "fmt" internalcpu "internal/cpu" "io" - "io/ioutil" + "os" "runtime" "strconv" "time" @@ -588,7 +588,7 @@ func (b *profileBuilder) emitLocation() uint64 { // It saves the address ranges of the mappings in b.mem for use // when emitting locations. func (b *profileBuilder) readMapping() { - data, _ := ioutil.ReadFile("/proc/self/maps") + data, _ := os.ReadFile("/proc/self/maps") parseProcSelfMaps(data, b.addMapping) if len(b.mem) == 0 { // pprof expects a map entry, so fake one. b.addMappingEntry(0, 0, 0, "", "", true) diff --git a/libgo/go/runtime/pprof/proto_test.go b/libgo/go/runtime/pprof/proto_test.go index e8efd4a..9290210 100644 --- a/libgo/go/runtime/pprof/proto_test.go +++ b/libgo/go/runtime/pprof/proto_test.go @@ -10,7 +10,6 @@ import ( "fmt" "internal/profile" "internal/testenv" - "io/ioutil" "os" "os/exec" "reflect" @@ -80,7 +79,7 @@ func testPCs(t *testing.T) (addr1, addr2 uint64, map1, map2 *profile.Mapping) { switch runtime.GOOS { case "linux", "android", "netbsd": // Figure out two addresses from /proc/self/maps. - mmap, err := ioutil.ReadFile("/proc/self/maps") + mmap, err := os.ReadFile("/proc/self/maps") if err != nil { t.Fatal(err) } |