Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/cmd/go/internal/cache/prog.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ func (c *ProgCache) send(ctx context.Context, req *cacheprog.Request) (*cachepro
func (c *ProgCache) writeToChild(req *cacheprog.Request, resc chan<- *cacheprog.Response) (err error) {
c.mu.Lock()
if c.inFlight == nil {
c.mu.Unlock()
return errCacheprogClosed
}
c.nextID++
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/go/internal/modfetch/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ func rewriteVersionList(ctx context.Context, dir string) (err error) {
}
if fi, err := f.Stat(); err == nil && int(fi.Size()) == buf.Len() {
old := make([]byte, buf.Len()+1)
if n, err := f.ReadAt(old, 0); err == io.EOF && n == buf.Len() && bytes.Equal(buf.Bytes(), old) {
if n, err := f.ReadAt(old, 0); err == io.EOF && n == buf.Len() && bytes.Equal(buf.Bytes(), old[:n]) {
return nil // No edit needed.
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/html/template/transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ func tJSDelimited(c context, s []byte) (context, int) {
// If "</script" appears in a regex literal, the '/' should not
// close the regex literal, and it will later be escaped to
// "\x3C/script" in escapeText.
if i > 0 && i+7 <= len(s) && bytes.Equal(bytes.ToLower(s[i-1:i+7]), []byte("</script")) {
if i > 0 && i+7 <= len(s) && bytes.EqualFold(s[i-1:i+7], []byte("</script")) {
i++
} else if !inCharset {
c.state, c.jsCtx = stateJS, jsCtxDivOp
Expand Down
8 changes: 0 additions & 8 deletions src/internal/goexperiment/exp_goroutineleakprofile_off.go

This file was deleted.

8 changes: 0 additions & 8 deletions src/internal/goexperiment/exp_goroutineleakprofile_on.go

This file was deleted.

28 changes: 11 additions & 17 deletions src/net/http/pprof/pprof.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ import (
"fmt"
"html"
"internal/godebug"
"internal/goexperiment"
"internal/profile"
"io"
"log"
Expand Down Expand Up @@ -362,22 +361,17 @@ var profileSupportsDelta = map[handler]bool{
}

var profileDescriptions = map[string]string{
"allocs": "A sampling of all past memory allocations",
"block": "Stack traces that led to blocking on synchronization primitives",
"cmdline": "The command line invocation of the current program",
"goroutine": "Stack traces of all current goroutines. Use debug=2 as a query parameter to export in the same format as an unrecovered panic.",
"heap": "A sampling of memory allocations of live objects. You can specify the gc GET parameter to run GC before taking the heap sample.",
"mutex": "Stack traces of holders of contended mutexes",
"profile": "CPU profile. You can specify the duration in the seconds GET parameter. After you get the profile file, use the go tool pprof command to investigate the profile.",
"symbol": "Maps given program counters to function names. Counters can be specified in a GET raw query or POST body, multiple counters are separated by '+'.",
"threadcreate": "Stack traces that led to the creation of new OS threads",
"trace": "A trace of execution of the current program. You can specify the duration in the seconds GET parameter. After you get the trace file, use the go tool trace command to investigate the trace.",
}

func init() {
if goexperiment.GoroutineLeakProfile {
profileDescriptions["goroutineleak"] = "Stack traces of all leaked goroutines. Use debug=2 as a query parameter to export in the same format as an unrecovered panic."
}
"allocs": "A sampling of all past memory allocations",
"block": "Stack traces that led to blocking on synchronization primitives",
"cmdline": "The command line invocation of the current program",
"goroutine": "Stack traces of all current goroutines. Use debug=2 as a query parameter to export in the same format as an unrecovered panic.",
"heap": "A sampling of memory allocations of live objects. You can specify the gc GET parameter to run GC before taking the heap sample.",
"mutex": "Stack traces of holders of contended mutexes",
"profile": "CPU profile. You can specify the duration in the seconds GET parameter. After you get the profile file, use the go tool pprof command to investigate the profile.",
"symbol": "Maps given program counters to function names. Counters can be specified in a GET raw query or POST body, multiple counters are separated by '+'.",
"threadcreate": "Stack traces that led to the creation of new OS threads",
"trace": "A trace of execution of the current program. You can specify the duration in the seconds GET parameter. After you get the trace file, use the go tool trace command to investigate the trace.",
"goroutineleak": "Stack traces of all leaked goroutines. Use debug=2 as a query parameter to export in the same format as an unrecovered panic.",
}

type profileEntry struct {
Expand Down
15 changes: 0 additions & 15 deletions src/runtime/crash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,21 +194,6 @@ func buildTestProg(t *testing.T, binary string, flags ...string) (string, error)
cmd.Dir = "testdata/" + binary
cmd = testenv.CleanCmdEnv(cmd)

// If tests need any experimental flags, add them here.
//
// TODO(vsaioc): Remove `goroutineleakprofile` once the feature is no longer experimental.
edited := false
for i := range cmd.Env {
e := cmd.Env[i]
if _, vars, ok := strings.Cut(e, "GOEXPERIMENT="); ok {
cmd.Env[i] = "GOEXPERIMENT=" + vars + ",goroutineleakprofile"
edited, _ = true, vars
}
}
if !edited {
cmd.Env = append(cmd.Env, "GOEXPERIMENT=goroutineleakprofile")
}

out, err := cmd.CombinedOutput()
if err != nil {
target.err = fmt.Errorf("building %s %v: %v\n%s", binary, flags, err, out)
Expand Down
1 change: 0 additions & 1 deletion src/runtime/goroutineleakprofile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,6 @@ func TestGoroutineLeakProfile(t *testing.T) {

cmdEnv := []string{
"GODEBUG=asyncpreemptoff=1",
"GOEXPERIMENT=goroutineleakprofile",
}

if tcase.simple {
Expand Down
17 changes: 7 additions & 10 deletions src/runtime/pprof/pprof.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ import (
"cmp"
"fmt"
"internal/abi"
"internal/goexperiment"
"internal/profilerecord"
"io"
"runtime"
Expand Down Expand Up @@ -257,15 +256,13 @@ func lockProfiles() {
if profiles.m == nil {
// Initial built-in profiles.
profiles.m = map[string]*Profile{
"goroutine": goroutineProfile,
"threadcreate": threadcreateProfile,
"heap": heapProfile,
"allocs": allocsProfile,
"block": blockProfile,
"mutex": mutexProfile,
}
if goexperiment.GoroutineLeakProfile {
profiles.m["goroutineleak"] = goroutineLeakProfile
"goroutine": goroutineProfile,
"threadcreate": threadcreateProfile,
"heap": heapProfile,
"allocs": allocsProfile,
"block": blockProfile,
"mutex": mutexProfile,
"goroutineleak": goroutineLeakProfile,
}
}
}
Expand Down
Loading