Skip to content

Commit

Permalink
runtime/pprof: fix build breakage on ios
Browse files Browse the repository at this point in the history
CL 503919 breaks tests for ios, this change fixes that.

Fixes #61891

Change-Id: I58508a780abb7a2150faec83c0f002cb22abafb7
Reviewed-on: https://go-review.googlesource.com/c/go/+/517795
Run-TryBot: Bryan Mills <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Michael Knyszek <[email protected]>
Reviewed-by: Bryan Mills <[email protected]>
Auto-Submit: Bryan Mills <[email protected]>
  • Loading branch information
cosnicolaou authored and gopherbot committed Aug 10, 2023
1 parent 8ecdc4e commit fdc9cf3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/runtime/pprof/proto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func testPCs(t *testing.T) (addr1, addr2 uint64, map1, map2 *profile.Mapping) {
addr2 = mprof.Mapping[1].Start
map2 = mprof.Mapping[1]
map2.BuildID, _ = elfBuildID(map2.File)
case "windows", "darwin":
case "windows", "darwin", "ios":
addr1 = uint64(abi.FuncPCABIInternal(f1))
addr2 = uint64(abi.FuncPCABIInternal(f2))

Expand Down
7 changes: 5 additions & 2 deletions src/runtime/pprof/vminfo_darwin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !ios

package pprof

import (
"bufio"
"bytes"
"internal/abi"
"internal/testenv"
"os"
"os/exec"
"strconv"
"strings"
"testing"
Expand Down Expand Up @@ -51,7 +53,8 @@ func TestVMInfo(t *testing.T) {

func useVMMap(t *testing.T) (hi, lo uint64) {
pid := strconv.Itoa(os.Getpid())
out, err := exec.Command("vmmap", pid).Output()
testenv.MustHaveExecPath(t, "vmmap")
out, err := testenv.Command(t, "vmmap", pid).Output()
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit fdc9cf3

Please sign in to comment.