diff options
| author | pg <[email protected]> | 2024-02-07 22:29:27 +0300 |
|---|---|---|
| committer | pg <[email protected]> | 2024-02-07 22:51:57 +0300 |
| commit | dcf4fb9ddcc3669785108fba005e532001fdfe58 (patch) | |
| tree | 27e9074c21095c2a30da740eee763184fa4b4be7 /contrib/go/_std_1.21/src/runtime | |
| parent | 174824b4acaabb831c071d3569790a0ded19f40b (diff) | |
Diffstat (limited to 'contrib/go/_std_1.21/src/runtime')
31 files changed, 1550 insertions, 2842 deletions
diff --git a/contrib/go/_std_1.21/src/runtime/coverage/apis.go b/contrib/go/_std_1.21/src/runtime/coverage/apis.go deleted file mode 100644 index 05da345ede8..00000000000 --- a/contrib/go/_std_1.21/src/runtime/coverage/apis.go +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright 2022 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. - -package coverage - -import ( - "fmt" - "internal/coverage" - "io" - "reflect" - "sync/atomic" - "unsafe" -) - -// WriteMetaDir writes a coverage meta-data file for the currently -// running program to the directory specified in 'dir'. An error will -// be returned if the operation can't be completed successfully (for -// example, if the currently running program was not built with -// "-cover", or if the directory does not exist). -func WriteMetaDir(dir string) error { - if !finalHashComputed { - return fmt.Errorf("error: no meta-data available (binary not built with -cover?)") - } - return emitMetaDataToDirectory(dir, getCovMetaList()) -} - -// WriteMeta writes the meta-data content (the payload that would -// normally be emitted to a meta-data file) for the currently running -// program to the writer 'w'. An error will be returned if the -// operation can't be completed successfully (for example, if the -// currently running program was not built with "-cover", or if a -// write fails). -func WriteMeta(w io.Writer) error { - if w == nil { - return fmt.Errorf("error: nil writer in WriteMeta") - } - if !finalHashComputed { - return fmt.Errorf("error: no meta-data available (binary not built with -cover?)") - } - ml := getCovMetaList() - return writeMetaData(w, ml, cmode, cgran, finalHash) -} - -// WriteCountersDir writes a coverage counter-data file for the -// currently running program to the directory specified in 'dir'. An -// error will be returned if the operation can't be completed -// successfully (for example, if the currently running program was not -// built with "-cover", or if the directory does not exist). The -// counter data written will be a snapshot taken at the point of the -// call. -func WriteCountersDir(dir string) error { - if cmode != coverage.CtrModeAtomic { - return fmt.Errorf("WriteCountersDir invoked for program built with -covermode=%s (please use -covermode=atomic)", cmode.String()) - } - return emitCounterDataToDirectory(dir) -} - -// WriteCounters writes coverage counter-data content for the -// currently running program to the writer 'w'. An error will be -// returned if the operation can't be completed successfully (for -// example, if the currently running program was not built with -// "-cover", or if a write fails). The counter data written will be a -// snapshot taken at the point of the invocation. -func WriteCounters(w io.Writer) error { - if w == nil { - return fmt.Errorf("error: nil writer in WriteCounters") - } - if cmode != coverage.CtrModeAtomic { - return fmt.Errorf("WriteCounters invoked for program built with -covermode=%s (please use -covermode=atomic)", cmode.String()) - } - // Ask the runtime for the list of coverage counter symbols. - cl := getCovCounterList() - if len(cl) == 0 { - return fmt.Errorf("program not built with -cover") - } - if !finalHashComputed { - return fmt.Errorf("meta-data not written yet, unable to write counter data") - } - - pm := getCovPkgMap() - s := &emitState{ - counterlist: cl, - pkgmap: pm, - } - return s.emitCounterDataToWriter(w) -} - -// ClearCounters clears/resets all coverage counter variables in the -// currently running program. It returns an error if the program in -// question was not built with the "-cover" flag. Clearing of coverage -// counters is also not supported for programs not using atomic -// counter mode (see more detailed comments below for the rationale -// here). -func ClearCounters() error { - cl := getCovCounterList() - if len(cl) == 0 { - return fmt.Errorf("program not built with -cover") - } - if cmode != coverage.CtrModeAtomic { - return fmt.Errorf("ClearCounters invoked for program built with -covermode=%s (please use -covermode=atomic)", cmode.String()) - } - - // Implementation note: this function would be faster and simpler - // if we could just zero out the entire counter array, but for the - // moment we go through and zero out just the slots in the array - // corresponding to the counter values. We do this to avoid the - // following bad scenario: suppose that a user builds their Go - // program with "-cover", and that program has a function (call it - // main.XYZ) that invokes ClearCounters: - // - // func XYZ() { - // ... do some stuff ... - // coverage.ClearCounters() - // if someCondition { <<--- HERE - // ... - // } - // } - // - // At the point where ClearCounters executes, main.XYZ has not yet - // finished running, thus as soon as the call returns the line - // marked "HERE" above will trigger the writing of a non-zero - // value into main.XYZ's counter slab. However since we've just - // finished clearing the entire counter segment, we will have lost - // the values in the prolog portion of main.XYZ's counter slab - // (nctrs, pkgid, funcid). This means that later on at the end of - // program execution as we walk through the entire counter array - // for the program looking for executed functions, we'll zoom past - // main.XYZ's prolog (which was zero'd) and hit the non-zero - // counter value corresponding to the "HERE" block, which will - // then be interpreted as the start of another live function. - // Things will go downhill from there. - // - // This same scenario is also a potential risk if the program is - // running on an architecture that permits reordering of - // writes/stores, since the inconsistency described above could - // arise here. Example scenario: - // - // func ABC() { - // ... // prolog - // if alwaysTrue() { - // XYZ() // counter update here - // } - // } - // - // In the instrumented version of ABC, the prolog of the function - // will contain a series of stores to the initial portion of the - // counter array to write number-of-counters, pkgid, funcid. Later - // in the function there is also a store to increment a counter - // for the block containing the call to XYZ(). If the CPU is - // allowed to reorder stores and decides to issue the XYZ store - // before the prolog stores, this could be observable as an - // inconsistency similar to the one above. Hence the requirement - // for atomic counter mode: according to package atomic docs, - // "...operations that happen in a specific order on one thread, - // will always be observed to happen in exactly that order by - // another thread". Thus we can be sure that there will be no - // inconsistency when reading the counter array from the thread - // running ClearCounters. - - var sd []atomic.Uint32 - - bufHdr := (*reflect.SliceHeader)(unsafe.Pointer(&sd)) - for _, c := range cl { - bufHdr.Data = uintptr(unsafe.Pointer(c.Counters)) - bufHdr.Len = int(c.Len) - bufHdr.Cap = int(c.Len) - for i := 0; i < len(sd); i++ { - // Skip ahead until the next non-zero value. - sdi := sd[i].Load() - if sdi == 0 { - continue - } - // We found a function that was executed; clear its counters. - nCtrs := sdi - for j := 0; j < int(nCtrs); j++ { - sd[i+coverage.FirstCtrOffset+j].Store(0) - } - // Move to next function. - i += coverage.FirstCtrOffset + int(nCtrs) - 1 - } - } - return nil -} diff --git a/contrib/go/_std_1.21/src/runtime/coverage/dummy.s b/contrib/go/_std_1.21/src/runtime/coverage/dummy.s deleted file mode 100644 index 75928593a0b..00000000000 --- a/contrib/go/_std_1.21/src/runtime/coverage/dummy.s +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2022 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. - -// The runtime package uses //go:linkname to push a few functions into this -// package but we still need a .s file so the Go tool does not pass -complete -// to 'go tool compile' so the latter does not complain about Go functions -// with no bodies. diff --git a/contrib/go/_std_1.21/src/runtime/coverage/emit.go b/contrib/go/_std_1.21/src/runtime/coverage/emit.go deleted file mode 100644 index bb0c6fb6a2f..00000000000 --- a/contrib/go/_std_1.21/src/runtime/coverage/emit.go +++ /dev/null @@ -1,622 +0,0 @@ -// Copyright 2022 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. - -package coverage - -import ( - "crypto/md5" - "fmt" - "internal/coverage" - "internal/coverage/encodecounter" - "internal/coverage/encodemeta" - "internal/coverage/rtcov" - "io" - "os" - "path/filepath" - "reflect" - "runtime" - "strconv" - "sync/atomic" - "time" - "unsafe" -) - -// This file contains functions that support the writing of data files -// emitted at the end of code coverage testing runs, from instrumented -// executables. - -// getCovMetaList returns a list of meta-data blobs registered -// for the currently executing instrumented program. It is defined in the -// runtime. -func getCovMetaList() []rtcov.CovMetaBlob - -// getCovCounterList returns a list of counter-data blobs registered -// for the currently executing instrumented program. It is defined in the -// runtime. -func getCovCounterList() []rtcov.CovCounterBlob - -// getCovPkgMap returns a map storing the remapped package IDs for -// hard-coded runtime packages (see internal/coverage/pkgid.go for -// more on why hard-coded package IDs are needed). This function -// is defined in the runtime. -func getCovPkgMap() map[int]int - -// emitState holds useful state information during the emit process. -// -// When an instrumented program finishes execution and starts the -// process of writing out coverage data, it's possible that an -// existing meta-data file already exists in the output directory. In -// this case openOutputFiles() below will leave the 'mf' field below -// as nil. If a new meta-data file is needed, field 'mfname' will be -// the final desired path of the meta file, 'mftmp' will be a -// temporary file, and 'mf' will be an open os.File pointer for -// 'mftmp'. The meta-data file payload will be written to 'mf', the -// temp file will be then closed and renamed (from 'mftmp' to -// 'mfname'), so as to insure that the meta-data file is created -// atomically; we want this so that things work smoothly in cases -// where there are several instances of a given instrumented program -// all terminating at the same time and trying to create meta-data -// files simultaneously. -// -// For counter data files there is less chance of a collision, hence -// the openOutputFiles() stores the counter data file in 'cfname' and -// then places the *io.File into 'cf'. -type emitState struct { - mfname string // path of final meta-data output file - mftmp string // path to meta-data temp file (if needed) - mf *os.File // open os.File for meta-data temp file - cfname string // path of final counter data file - cftmp string // path to counter data temp file - cf *os.File // open os.File for counter data file - outdir string // output directory - - // List of meta-data symbols obtained from the runtime - metalist []rtcov.CovMetaBlob - - // List of counter-data symbols obtained from the runtime - counterlist []rtcov.CovCounterBlob - - // Table to use for remapping hard-coded pkg ids. - pkgmap map[int]int - - // emit debug trace output - debug bool -} - -var ( - // finalHash is computed at init time from the list of meta-data - // symbols registered during init. It is used both for writing the - // meta-data file and counter-data files. - finalHash [16]byte - // Set to true when we've computed finalHash + finalMetaLen. - finalHashComputed bool - // Total meta-data length. - finalMetaLen uint64 - // Records whether we've already attempted to write meta-data. - metaDataEmitAttempted bool - // Counter mode for this instrumented program run. - cmode coverage.CounterMode - // Counter granularity for this instrumented program run. - cgran coverage.CounterGranularity - // Cached value of GOCOVERDIR environment variable. - goCoverDir string - // Copy of os.Args made at init time, converted into map format. - capturedOsArgs map[string]string - // Flag used in tests to signal that coverage data already written. - covProfileAlreadyEmitted bool -) - -// fileType is used to select between counter-data files and -// meta-data files. -type fileType int - -const ( - noFile = 1 << iota - metaDataFile - counterDataFile -) - -// emitMetaData emits the meta-data output file for this coverage run. -// This entry point is intended to be invoked by the compiler from -// an instrumented program's main package init func. -func emitMetaData() { - if covProfileAlreadyEmitted { - return - } - ml, err := prepareForMetaEmit() - if err != nil { - fmt.Fprintf(os.Stderr, "error: coverage meta-data prep failed: %v\n", err) - if os.Getenv("GOCOVERDEBUG") != "" { - panic("meta-data write failure") - } - } - if len(ml) == 0 { - fmt.Fprintf(os.Stderr, "program not built with -cover\n") - return - } - - goCoverDir = os.Getenv("GOCOVERDIR") - if goCoverDir == "" { - fmt.Fprintf(os.Stderr, "warning: GOCOVERDIR not set, no coverage data emitted\n") - return - } - - if err := emitMetaDataToDirectory(goCoverDir, ml); err != nil { - fmt.Fprintf(os.Stderr, "error: coverage meta-data emit failed: %v\n", err) - if os.Getenv("GOCOVERDEBUG") != "" { - panic("meta-data write failure") - } - } -} - -func modeClash(m coverage.CounterMode) bool { - if m == coverage.CtrModeRegOnly || m == coverage.CtrModeTestMain { - return false - } - if cmode == coverage.CtrModeInvalid { - cmode = m - return false - } - return cmode != m -} - -func granClash(g coverage.CounterGranularity) bool { - if cgran == coverage.CtrGranularityInvalid { - cgran = g - return false - } - return cgran != g -} - -// prepareForMetaEmit performs preparatory steps needed prior to -// emitting a meta-data file, notably computing a final hash of -// all meta-data blobs and capturing os args. -func prepareForMetaEmit() ([]rtcov.CovMetaBlob, error) { - // Ask the runtime for the list of coverage meta-data symbols. - ml := getCovMetaList() - - // In the normal case (go build -o prog.exe ... ; ./prog.exe) - // len(ml) will always be non-zero, but we check here since at - // some point this function will be reachable via user-callable - // APIs (for example, to write out coverage data from a server - // program that doesn't ever call os.Exit). - if len(ml) == 0 { - return nil, nil - } - - s := &emitState{ - metalist: ml, - debug: os.Getenv("GOCOVERDEBUG") != "", - } - - // Capture os.Args() now so as to avoid issues if args - // are rewritten during program execution. - capturedOsArgs = captureOsArgs() - - if s.debug { - fmt.Fprintf(os.Stderr, "=+= GOCOVERDIR is %s\n", os.Getenv("GOCOVERDIR")) - fmt.Fprintf(os.Stderr, "=+= contents of covmetalist:\n") - for k, b := range ml { - fmt.Fprintf(os.Stderr, "=+= slot: %d path: %s ", k, b.PkgPath) - if b.PkgID != -1 { - fmt.Fprintf(os.Stderr, " hcid: %d", b.PkgID) - } - fmt.Fprintf(os.Stderr, "\n") - } - pm := getCovPkgMap() - fmt.Fprintf(os.Stderr, "=+= remap table:\n") - for from, to := range pm { - fmt.Fprintf(os.Stderr, "=+= from %d to %d\n", - uint32(from), uint32(to)) - } - } - - h := md5.New() - tlen := uint64(unsafe.Sizeof(coverage.MetaFileHeader{})) - for _, entry := range ml { - if _, err := h.Write(entry.Hash[:]); err != nil { - return nil, err - } - tlen += uint64(entry.Len) - ecm := coverage.CounterMode(entry.CounterMode) - if modeClash(ecm) { - return nil, fmt.Errorf("coverage counter mode clash: package %s uses mode=%d, but package %s uses mode=%s\n", ml[0].PkgPath, cmode, entry.PkgPath, ecm) - } - ecg := coverage.CounterGranularity(entry.CounterGranularity) - if granClash(ecg) { - return nil, fmt.Errorf("coverage counter granularity clash: package %s uses gran=%d, but package %s uses gran=%s\n", ml[0].PkgPath, cgran, entry.PkgPath, ecg) - } - } - - // Hash mode and granularity as well. - h.Write([]byte(cmode.String())) - h.Write([]byte(cgran.String())) - - // Compute final digest. - fh := h.Sum(nil) - copy(finalHash[:], fh) - finalHashComputed = true - finalMetaLen = tlen - - return ml, nil -} - -// emitMetaDataToDirectory emits the meta-data output file to the specified -// directory, returning an error if something went wrong. -func emitMetaDataToDirectory(outdir string, ml []rtcov.CovMetaBlob) error { - ml, err := prepareForMetaEmit() - if err != nil { - return err - } - if len(ml) == 0 { - return nil - } - - metaDataEmitAttempted = true - - s := &emitState{ - metalist: ml, - debug: os.Getenv("GOCOVERDEBUG") != "", - outdir: outdir, - } - - // Open output files. - if err := s.openOutputFiles(finalHash, finalMetaLen, metaDataFile); err != nil { - return err - } - - // Emit meta-data file only if needed (may already be present). - if s.needMetaDataFile() { - if err := s.emitMetaDataFile(finalHash, finalMetaLen); err != nil { - return err - } - } - return nil -} - -// emitCounterData emits the counter data output file for this coverage run. -// This entry point is intended to be invoked by the runtime when an -// instrumented program is terminating or calling os.Exit(). -func emitCounterData() { - if goCoverDir == "" || !finalHashComputed || covProfileAlreadyEmitted { - return - } - if err := emitCounterDataToDirectory(goCoverDir); err != nil { - fmt.Fprintf(os.Stderr, "error: coverage counter data emit failed: %v\n", err) - if os.Getenv("GOCOVERDEBUG") != "" { - panic("counter-data write failure") - } - } -} - -// emitCounterDataToDirectory emits the counter-data output file for this coverage run. -func emitCounterDataToDirectory(outdir string) error { - // Ask the runtime for the list of coverage counter symbols. - cl := getCovCounterList() - if len(cl) == 0 { - // no work to do here. - return nil - } - - if !finalHashComputed { - return fmt.Errorf("error: meta-data not available (binary not built with -cover?)") - } - - // Ask the runtime for the list of coverage counter symbols. - pm := getCovPkgMap() - s := &emitState{ - counterlist: cl, - pkgmap: pm, - outdir: outdir, - debug: os.Getenv("GOCOVERDEBUG") != "", - } - - // Open output file. - if err := s.openOutputFiles(finalHash, finalMetaLen, counterDataFile); err != nil { - return err - } - if s.cf == nil { - return fmt.Errorf("counter data output file open failed (no additional info") - } - - // Emit counter data file. - if err := s.emitCounterDataFile(finalHash, s.cf); err != nil { - return err - } - if err := s.cf.Close(); err != nil { - return fmt.Errorf("closing counter data file: %v", err) - } - - // Counter file has now been closed. Rename the temp to the - // final desired path. - if err := os.Rename(s.cftmp, s.cfname); err != nil { - return fmt.Errorf("writing %s: rename from %s failed: %v\n", s.cfname, s.cftmp, err) - } - - return nil -} - -// emitCounterDataToWriter emits counter data for this coverage run to an io.Writer. -func (s *emitState) emitCounterDataToWriter(w io.Writer) error { - if err := s.emitCounterDataFile(finalHash, w); err != nil { - return err - } - return nil -} - -// openMetaFile determines whether we need to emit a meta-data output -// file, or whether we can reuse the existing file in the coverage out -// dir. It updates mfname/mftmp/mf fields in 's', returning an error -// if something went wrong. See the comment on the emitState type -// definition above for more on how file opening is managed. -func (s *emitState) openMetaFile(metaHash [16]byte, metaLen uint64) error { - - // Open meta-outfile for reading to see if it exists. - fn := fmt.Sprintf("%s.%x", coverage.MetaFilePref, metaHash) - s.mfname = filepath.Join(s.outdir, fn) - fi, err := os.Stat(s.mfname) - if err != nil || fi.Size() != int64(metaLen) { - // We need a new meta-file. - tname := "tmp." + fn + strconv.FormatInt(time.Now().UnixNano(), 10) - s.mftmp = filepath.Join(s.outdir, tname) - s.mf, err = os.Create(s.mftmp) - if err != nil { - return fmt.Errorf("creating meta-data file %s: %v", s.mftmp, err) - } - } - return nil -} - -// openCounterFile opens an output file for the counter data portion -// of a test coverage run. If updates the 'cfname' and 'cf' fields in -// 's', returning an error if something went wrong. -func (s *emitState) openCounterFile(metaHash [16]byte) error { - processID := os.Getpid() - fn := fmt.Sprintf(coverage.CounterFileTempl, coverage.CounterFilePref, metaHash, processID, time.Now().UnixNano()) - s.cfname = filepath.Join(s.outdir, fn) - s.cftmp = filepath.Join(s.outdir, "tmp."+fn) - var err error - s.cf, err = os.Create(s.cftmp) - if err != nil { - return fmt.Errorf("creating counter data file %s: %v", s.cftmp, err) - } - return nil -} - -// openOutputFiles opens output files in preparation for emitting -// coverage data. In the case of the meta-data file, openOutputFiles -// may determine that we can reuse an existing meta-data file in the -// outdir, in which case it will leave the 'mf' field in the state -// struct as nil. If a new meta-file is needed, the field 'mfname' -// will be the final desired path of the meta file, 'mftmp' will be a -// temporary file, and 'mf' will be an open os.File pointer for -// 'mftmp'. The idea is that the client/caller will write content into -// 'mf', close it, and then rename 'mftmp' to 'mfname'. This function -// also opens the counter data output file, setting 'cf' and 'cfname' -// in the state struct. -func (s *emitState) openOutputFiles(metaHash [16]byte, metaLen uint64, which fileType) error { - fi, err := os.Stat(s.outdir) - if err != nil { - return fmt.Errorf("output directory %q inaccessible (err: %v); no coverage data written", s.outdir, err) - } - if !fi.IsDir() { - return fmt.Errorf("output directory %q not a directory; no coverage data written", s.outdir) - } - - if (which & metaDataFile) != 0 { - if err := s.openMetaFile(metaHash, metaLen); err != nil { - return err - } - } - if (which & counterDataFile) != 0 { - if err := s.openCounterFile(metaHash); err != nil { - return err - } - } - return nil -} - -// emitMetaDataFile emits coverage meta-data to a previously opened -// temporary file (s.mftmp), then renames the generated file to the -// final path (s.mfname). -func (s *emitState) emitMetaDataFile(finalHash [16]byte, tlen uint64) error { - if err := writeMetaData(s.mf, s.metalist, cmode, cgran, finalHash); err != nil { - return fmt.Errorf("writing %s: %v\n", s.mftmp, err) - } - if err := s.mf.Close(); err != nil { - return fmt.Errorf("closing meta data temp file: %v", err) - } - - // Temp file has now been flushed and closed. Rename the temp to the - // final desired path. - if err := os.Rename(s.mftmp, s.mfname); err != nil { - return fmt.Errorf("writing %s: rename from %s failed: %v\n", s.mfname, s.mftmp, err) - } - - return nil -} - -// needMetaDataFile returns TRUE if we need to emit a meta-data file -// for this program run. It should be used only after -// openOutputFiles() has been invoked. -func (s *emitState) needMetaDataFile() bool { - return s.mf != nil -} - -func writeMetaData(w io.Writer, metalist []rtcov.CovMetaBlob, cmode coverage.CounterMode, gran coverage.CounterGranularity, finalHash [16]byte) error { - mfw := encodemeta.NewCoverageMetaFileWriter("<io.Writer>", w) - - // Note: "sd" is re-initialized on each iteration of the loop - // below, and would normally be declared inside the loop, but - // placed here escape analysis since we capture it in bufHdr. - var sd []byte - bufHdr := (*reflect.SliceHeader)(unsafe.Pointer(&sd)) - - var blobs [][]byte - for _, e := range metalist { - bufHdr.Data = uintptr(unsafe.Pointer(e.P)) - bufHdr.Len = int(e.Len) - bufHdr.Cap = int(e.Len) - blobs = append(blobs, sd) - } - return mfw.Write(finalHash, blobs, cmode, gran) -} - -func (s *emitState) VisitFuncs(f encodecounter.CounterVisitorFn) error { - var sd []atomic.Uint32 - var tcounters []uint32 - bufHdr := (*reflect.SliceHeader)(unsafe.Pointer(&sd)) - - rdCounters := func(actrs []atomic.Uint32, ctrs []uint32) []uint32 { - ctrs = ctrs[:0] - for i := range actrs { - ctrs = append(ctrs, actrs[i].Load()) - } - return ctrs - } - - dpkg := uint32(0) - for _, c := range s.counterlist { - bufHdr.Data = uintptr(unsafe.Pointer(c.Counters)) - bufHdr.Len = int(c.Len) - bufHdr.Cap = int(c.Len) - for i := 0; i < len(sd); i++ { - // Skip ahead until the next non-zero value. - sdi := sd[i].Load() - if sdi == 0 { - continue - } - - // We found a function that was executed. - nCtrs := sd[i+coverage.NumCtrsOffset].Load() - pkgId := sd[i+coverage.PkgIdOffset].Load() - funcId := sd[i+coverage.FuncIdOffset].Load() - cst := i + coverage.FirstCtrOffset - counters := sd[cst : cst+int(nCtrs)] - - // Check to make sure that we have at least one live - // counter. See the implementation note in ClearCoverageCounters - // for a description of why this is needed. - isLive := false - for i := 0; i < len(counters); i++ { - if counters[i].Load() != 0 { - isLive = true - break - } - } - if !isLive { - // Skip this function. - i += coverage.FirstCtrOffset + int(nCtrs) - 1 - continue - } - - if s.debug { - if pkgId != dpkg { - dpkg = pkgId - fmt.Fprintf(os.Stderr, "\n=+= %d: pk=%d visit live fcn", - i, pkgId) - } - fmt.Fprintf(os.Stderr, " {i=%d F%d NC%d}", i, funcId, nCtrs) - } - - // Vet and/or fix up package ID. A package ID of zero - // indicates that there is some new package X that is a - // runtime dependency, and this package has code that - // executes before its corresponding init package runs. - // This is a fatal error that we should only see during - // Go development (e.g. tip). - ipk := int32(pkgId) - if ipk == 0 { - fmt.Fprintf(os.Stderr, "\n") - reportErrorInHardcodedList(int32(i), ipk, funcId, nCtrs) - } else if ipk < 0 { - if newId, ok := s.pkgmap[int(ipk)]; ok { - pkgId = uint32(newId) - } else { - fmt.Fprintf(os.Stderr, "\n") - reportErrorInHardcodedList(int32(i), ipk, funcId, nCtrs) - } - } else { - // The package ID value stored in the counter array - // has 1 added to it (so as to preclude the - // possibility of a zero value ; see - // runtime.addCovMeta), so subtract off 1 here to form - // the real package ID. - pkgId-- - } - - tcounters = rdCounters(counters, tcounters) - if err := f(pkgId, funcId, tcounters); err != nil { - return err - } - - // Skip over this function. - i += coverage.FirstCtrOffset + int(nCtrs) - 1 - } - if s.debug { - fmt.Fprintf(os.Stderr, "\n") - } - } - return nil -} - -// captureOsArgs converts os.Args() into the format we use to store -// this info in the counter data file (counter data file "args" -// section is a generic key-value collection). See the 'args' section -// in internal/coverage/defs.go for more info. The args map -// is also used to capture GOOS + GOARCH values as well. -func captureOsArgs() map[string]string { - m := make(map[string]string) - m["argc"] = strconv.Itoa(len(os.Args)) - for k, a := range os.Args { - m[fmt.Sprintf("argv%d", k)] = a - } - m["GOOS"] = runtime.GOOS - m["GOARCH"] = runtime.GOARCH - return m -} - -// emitCounterDataFile emits the counter data portion of a -// coverage output file (to the file 's.cf'). -func (s *emitState) emitCounterDataFile(finalHash [16]byte, w io.Writer) error { - cfw := encodecounter.NewCoverageDataWriter(w, coverage.CtrULeb128) - if err := cfw.Write(finalHash, capturedOsArgs, s); err != nil { - return err - } - return nil -} - -// markProfileEmitted signals the runtime/coverage machinery that -// coverate data output files have already been written out, and there -// is no need to take any additional action at exit time. This -// function is called (via linknamed reference) from the -// coverage-related boilerplate code in _testmain.go emitted for go -// unit tests. -func markProfileEmitted(val bool) { - covProfileAlreadyEmitted = val -} - -func reportErrorInHardcodedList(slot, pkgID int32, fnID, nCtrs uint32) { - metaList := getCovMetaList() - pkgMap := getCovPkgMap() - - println("internal error in coverage meta-data tracking:") - println("encountered bad pkgID:", pkgID, " at slot:", slot, - " fnID:", fnID, " numCtrs:", nCtrs) - println("list of hard-coded runtime package IDs needs revising.") - println("[see the comment on the 'rtPkgs' var in ") - println(" <goroot>/src/internal/coverage/pkid.go]") - println("registered list:") - for k, b := range metaList { - print("slot: ", k, " path='", b.PkgPath, "' ") - if b.PkgID != -1 { - print(" hard-coded id: ", b.PkgID) - } - println("") - } - println("remap table:") - for from, to := range pkgMap { - println("from ", from, " to ", to) - } -} diff --git a/contrib/go/_std_1.21/src/runtime/coverage/hooks.go b/contrib/go/_std_1.21/src/runtime/coverage/hooks.go deleted file mode 100644 index a9fbf9d7dd1..00000000000 --- a/contrib/go/_std_1.21/src/runtime/coverage/hooks.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 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. - -package coverage - -import _ "unsafe" - -// initHook is invoked from the main package "init" routine in -// programs built with "-cover". This function is intended to be -// called only by the compiler. -// -// If 'istest' is false, it indicates we're building a regular program -// ("go build -cover ..."), in which case we immediately try to write -// out the meta-data file, and register emitCounterData as an exit -// hook. -// -// If 'istest' is true (indicating that the program in question is a -// Go test binary), then we tentatively queue up both emitMetaData and -// emitCounterData as exit hooks. In the normal case (e.g. regular "go -// test -cover" run) the testmain.go boilerplate will run at the end -// of the test, write out the coverage percentage, and then invoke -// markProfileEmitted() to indicate that no more work needs to be -// done. If however that call is never made, this is a sign that the -// test binary is being used as a replacement binary for the tool -// being tested, hence we do want to run exit hooks when the program -// terminates. -func initHook(istest bool) { - // Note: hooks are run in reverse registration order, so - // register the counter data hook before the meta-data hook - // (in the case where two hooks are needed). - runOnNonZeroExit := true - runtime_addExitHook(emitCounterData, runOnNonZeroExit) - if istest { - runtime_addExitHook(emitMetaData, runOnNonZeroExit) - } else { - emitMetaData() - } -} - -//go:linkname runtime_addExitHook runtime.addExitHook -func runtime_addExitHook(f func(), runOnNonZeroExit bool) diff --git a/contrib/go/_std_1.21/src/runtime/coverage/testsupport.go b/contrib/go/_std_1.21/src/runtime/coverage/testsupport.go deleted file mode 100644 index f169580618a..00000000000 --- a/contrib/go/_std_1.21/src/runtime/coverage/testsupport.go +++ /dev/null @@ -1,323 +0,0 @@ -// Copyright 2022 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. - -package coverage - -import ( - "encoding/json" - "fmt" - "internal/coverage" - "internal/coverage/calloc" - "internal/coverage/cformat" - "internal/coverage/cmerge" - "internal/coverage/decodecounter" - "internal/coverage/decodemeta" - "internal/coverage/pods" - "io" - "os" - "path/filepath" - "runtime/internal/atomic" - "strings" - "unsafe" -) - -// processCoverTestDir is called (via a linknamed reference) from -// testmain code when "go test -cover" is in effect. It is not -// intended to be used other than internally by the Go command's -// generated code. -func processCoverTestDir(dir string, cfile string, cm string, cpkg string) error { - return processCoverTestDirInternal(dir, cfile, cm, cpkg, os.Stdout) -} - -// processCoverTestDirInternal is an io.Writer version of processCoverTestDir, -// exposed for unit testing. -func processCoverTestDirInternal(dir string, cfile string, cm string, cpkg string, w io.Writer) error { - cmode := coverage.ParseCounterMode(cm) - if cmode == coverage.CtrModeInvalid { - return fmt.Errorf("invalid counter mode %q", cm) - } - - // Emit meta-data and counter data. - ml := getCovMetaList() - if len(ml) == 0 { - // This corresponds to the case where we have a package that - // contains test code but no functions (which is fine). In this - // case there is no need to emit anything. - } else { - if err := emitMetaDataToDirectory(dir, ml); err != nil { - return err - } - if err := emitCounterDataToDirectory(dir); err != nil { - return err - } - } - - // Collect pods from test run. For the majority of cases we would - // expect to see a single pod here, but allow for multiple pods in - // case the test harness is doing extra work to collect data files - // from builds that it kicks off as part of the testing. - podlist, err := pods.CollectPods([]string{dir}, false) - if err != nil { - return fmt.Errorf("reading from %s: %v", dir, err) - } - - // Open text output file if appropriate. - var tf *os.File - var tfClosed bool - if cfile != "" { - var err error - tf, err = os.Create(cfile) - if err != nil { - return fmt.Errorf("internal error: opening coverage data output file %q: %v", cfile, err) - } - defer func() { - if !tfClosed { - tfClosed = true - tf.Close() - } - }() - } - - // Read/process the pods. - ts := &tstate{ - cm: &cmerge.Merger{}, - cf: cformat.NewFormatter(cmode), - cmode: cmode, - } - // Generate the expected hash string based on the final meta-data - // hash for this test, then look only for pods that refer to that - // hash (just in case there are multiple instrumented executables - // in play). See issue #57924 for more on this. - hashstring := fmt.Sprintf("%x", finalHash) - importpaths := make(map[string]struct{}) - for _, p := range podlist { - if !strings.Contains(p.MetaFile, hashstring) { - continue - } - if err := ts.processPod(p, importpaths); err != nil { - return err - } - } - - metafilespath := filepath.Join(dir, coverage.MetaFilesFileName) - if _, err := os.Stat(metafilespath); err == nil { - if err := ts.readAuxMetaFiles(metafilespath, importpaths); err != nil { - return err - } - } - - // Emit percent. - if err := ts.cf.EmitPercent(w, cpkg, true, true); err != nil { - return err - } - - // Emit text output. - if tf != nil { - if err := ts.cf.EmitTextual(tf); err != nil { - return err - } - tfClosed = true - if err := tf.Close(); err != nil { - return fmt.Errorf("closing %s: %v", cfile, err) - } - } - - return nil -} - -type tstate struct { - calloc.BatchCounterAlloc - cm *cmerge.Merger - cf *cformat.Formatter - cmode coverage.CounterMode -} - -// processPod reads coverage counter data for a specific pod. -func (ts *tstate) processPod(p pods.Pod, importpaths map[string]struct{}) error { - // Open meta-data file - f, err := os.Open(p.MetaFile) - if err != nil { - return fmt.Errorf("unable to open meta-data file %s: %v", p.MetaFile, err) - } - defer func() { - f.Close() - }() - var mfr *decodemeta.CoverageMetaFileReader - mfr, err = decodemeta.NewCoverageMetaFileReader(f, nil) - if err != nil { - return fmt.Errorf("error reading meta-data file %s: %v", p.MetaFile, err) - } - newmode := mfr.CounterMode() - if newmode != ts.cmode { - return fmt.Errorf("internal error: counter mode clash: %q from test harness, %q from data file %s", ts.cmode.String(), newmode.String(), p.MetaFile) - } - newgran := mfr.CounterGranularity() - if err := ts.cm.SetModeAndGranularity(p.MetaFile, cmode, newgran); err != nil { - return err - } - - // A map to store counter data, indexed by pkgid/fnid tuple. - pmm := make(map[pkfunc][]uint32) - - // Helper to read a single counter data file. - readcdf := func(cdf string) error { - cf, err := os.Open(cdf) - if err != nil { - return fmt.Errorf("opening counter data file %s: %s", cdf, err) - } - defer cf.Close() - var cdr *decodecounter.CounterDataReader - cdr, err = decodecounter.NewCounterDataReader(cdf, cf) - if err != nil { - return fmt.Errorf("reading counter data file %s: %s", cdf, err) - } - var data decodecounter.FuncPayload - for { - ok, err := cdr.NextFunc(&data) - if err != nil { - return fmt.Errorf("reading counter data file %s: %v", cdf, err) - } - if !ok { - break - } - - // NB: sanity check on pkg and func IDs? - key := pkfunc{pk: data.PkgIdx, fcn: data.FuncIdx} - if prev, found := pmm[key]; found { - // Note: no overflow reporting here. - if err, _ := ts.cm.MergeCounters(data.Counters, prev); err != nil { - return fmt.Errorf("processing counter data file %s: %v", cdf, err) - } - } - c := ts.AllocateCounters(len(data.Counters)) - copy(c, data.Counters) - pmm[key] = c - } - return nil - } - - // Read counter data files. - for _, cdf := range p.CounterDataFiles { - if err := readcdf(cdf); err != nil { - return err - } - } - - // Visit meta-data file. - np := uint32(mfr.NumPackages()) - payload := []byte{} - for pkIdx := uint32(0); pkIdx < np; pkIdx++ { - var pd *decodemeta.CoverageMetaDataDecoder - pd, payload, err = mfr.GetPackageDecoder(pkIdx, payload) - if err != nil { - return fmt.Errorf("reading pkg %d from meta-file %s: %s", pkIdx, p.MetaFile, err) - } - ts.cf.SetPackage(pd.PackagePath()) - importpaths[pd.PackagePath()] = struct{}{} - var fd coverage.FuncDesc - nf := pd.NumFuncs() - for fnIdx := uint32(0); fnIdx < nf; fnIdx++ { - if err := pd.ReadFunc(fnIdx, &fd); err != nil { - return fmt.Errorf("reading meta-data file %s: %v", - p.MetaFile, err) - } - key := pkfunc{pk: pkIdx, fcn: fnIdx} - counters, haveCounters := pmm[key] - for i := 0; i < len(fd.Units); i++ { - u := fd.Units[i] - // Skip units with non-zero parent (no way to represent - // these in the existing format). - if u.Parent != 0 { - continue - } - count := uint32(0) - if haveCounters { - count = counters[i] - } - ts.cf.AddUnit(fd.Srcfile, fd.Funcname, fd.Lit, u, count) - } - } - } - return nil -} - -type pkfunc struct { - pk, fcn uint32 -} - -func (ts *tstate) readAuxMetaFiles(metafiles string, importpaths map[string]struct{}) error { - // Unmarshall the information on available aux metafiles into - // a MetaFileCollection struct. - var mfc coverage.MetaFileCollection - data, err := os.ReadFile(metafiles) - if err != nil { - return fmt.Errorf("error reading auxmetafiles file %q: %v", metafiles, err) - } - if err := json.Unmarshal(data, &mfc); err != nil { - return fmt.Errorf("error reading auxmetafiles file %q: %v", metafiles, err) - } - - // Walk through each available aux meta-file. If we've already - // seen the package path in question during the walk of the - // "regular" meta-data file, then we can skip the package, - // otherwise construct a dummy pod with the single meta-data file - // (no counters) and invoke processPod on it. - for i := range mfc.ImportPaths { - p := mfc.ImportPaths[i] - if _, ok := importpaths[p]; ok { - continue - } - var pod pods.Pod - pod.MetaFile = mfc.MetaFileFragments[i] - if err := ts.processPod(pod, importpaths); err != nil { - return err - } - } - return nil -} - -// snapshot returns a snapshot of coverage percentage at a moment of -// time within a running test, so as to support the testing.Coverage() -// function. This version doesn't examine coverage meta-data, so the -// result it returns will be less accurate (more "slop") due to the -// fact that we don't look at the meta data to see how many statements -// are associated with each counter. -func snapshot() float64 { - cl := getCovCounterList() - if len(cl) == 0 { - // no work to do here. - return 0.0 - } - - tot := uint64(0) - totExec := uint64(0) - for _, c := range cl { - sd := unsafe.Slice((*atomic.Uint32)(unsafe.Pointer(c.Counters)), c.Len) - tot += uint64(len(sd)) - for i := 0; i < len(sd); i++ { - // Skip ahead until the next non-zero value. - if sd[i].Load() == 0 { - continue - } - // We found a function that was executed. - nCtrs := sd[i+coverage.NumCtrsOffset].Load() - cst := i + coverage.FirstCtrOffset - - if cst+int(nCtrs) > len(sd) { - break - } - counters := sd[cst : cst+int(nCtrs)] - for i := range counters { - if counters[i].Load() != 0 { - totExec++ - } - } - i += coverage.FirstCtrOffset + int(nCtrs) - 1 - } - } - if tot == 0 { - return 0.0 - } - return float64(totExec) / float64(tot) -} diff --git a/contrib/go/_std_1.21/src/runtime/coverage/ya.make b/contrib/go/_std_1.21/src/runtime/coverage/ya.make deleted file mode 100644 index eca6740acdd..00000000000 --- a/contrib/go/_std_1.21/src/runtime/coverage/ya.make +++ /dev/null @@ -1,11 +0,0 @@ -GO_LIBRARY() -IF (OS_DARWIN AND ARCH_ARM64 OR OS_DARWIN AND ARCH_X86_64 OR OS_LINUX AND ARCH_AARCH64 OR OS_LINUX AND ARCH_X86_64 OR OS_WINDOWS AND ARCH_X86_64) - SRCS( - apis.go - dummy.s - emit.go - hooks.go - testsupport.go - ) -ENDIF() -END() diff --git a/contrib/go/_std_1.21/src/runtime/debug/ya.make b/contrib/go/_std_1.21/src/runtime/debug/ya.make index bdb1a4f46dc..e4d11f992bb 100644 --- a/contrib/go/_std_1.21/src/runtime/debug/ya.make +++ b/contrib/go/_std_1.21/src/runtime/debug/ya.make @@ -1,5 +1,5 @@ GO_LIBRARY() -IF (OS_DARWIN AND ARCH_ARM64 OR OS_DARWIN AND ARCH_X86_64 OR OS_LINUX AND ARCH_AARCH64 OR OS_LINUX AND ARCH_X86_64 OR OS_WINDOWS AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE) SRCS( debug.s garbage.go diff --git a/contrib/go/_std_1.21/src/runtime/internal/atomic/ya.make b/contrib/go/_std_1.21/src/runtime/internal/atomic/ya.make index 0f9ae515254..98d4f48681c 100644 --- a/contrib/go/_std_1.21/src/runtime/internal/atomic/ya.make +++ b/contrib/go/_std_1.21/src/runtime/internal/atomic/ya.make @@ -1,5 +1,5 @@ GO_LIBRARY() -IF (OS_DARWIN AND ARCH_ARM64 OR OS_LINUX AND ARCH_AARCH64) +IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE) SRCS( atomic_arm64.go atomic_arm64.s @@ -9,7 +9,7 @@ IF (OS_DARWIN AND ARCH_ARM64 OR OS_LINUX AND ARCH_AARCH64) types_64bit.go unaligned.go ) -ELSEIF (OS_DARWIN AND ARCH_X86_64 OR OS_LINUX AND ARCH_X86_64 OR OS_WINDOWS AND ARCH_X86_64) +ELSEIF (OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE) SRCS( atomic_amd64.go atomic_amd64.s diff --git a/contrib/go/_std_1.21/src/runtime/internal/math/ya.make b/contrib/go/_std_1.21/src/runtime/internal/math/ya.make index fad4a663189..dee4547765a 100644 --- a/contrib/go/_std_1.21/src/runtime/internal/math/ya.make +++ b/contrib/go/_std_1.21/src/runtime/internal/math/ya.make @@ -1,5 +1,5 @@ GO_LIBRARY() -IF (OS_DARWIN AND ARCH_ARM64 OR OS_DARWIN AND ARCH_X86_64 OR OS_LINUX AND ARCH_AARCH64 OR OS_LINUX AND ARCH_X86_64 OR OS_WINDOWS AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE) SRCS( math.go ) diff --git a/contrib/go/_std_1.21/src/runtime/internal/sys/ya.make b/contrib/go/_std_1.21/src/runtime/internal/sys/ya.make index dbec7c1b272..ac543894fa9 100644 --- a/contrib/go/_std_1.21/src/runtime/internal/sys/ya.make +++ b/contrib/go/_std_1.21/src/runtime/internal/sys/ya.make @@ -1,5 +1,14 @@ GO_LIBRARY() -IF (OS_DARWIN AND ARCH_ARM64 OR OS_DARWIN AND ARCH_X86_64 OR OS_LINUX AND ARCH_AARCH64 OR OS_LINUX AND ARCH_X86_64 OR OS_WINDOWS AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE) + SRCS( + consts.go + consts_race.go + intrinsics.go + nih.go + sys.go + zversion.go + ) +ELSEIF (OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE) SRCS( consts.go consts_norace.go diff --git a/contrib/go/_std_1.21/src/runtime/internal/syscall/ya.make b/contrib/go/_std_1.21/src/runtime/internal/syscall/ya.make index bf607c26402..2973f4e4c32 100644 --- a/contrib/go/_std_1.21/src/runtime/internal/syscall/ya.make +++ b/contrib/go/_std_1.21/src/runtime/internal/syscall/ya.make @@ -1,11 +1,11 @@ GO_LIBRARY() -IF (OS_LINUX AND ARCH_AARCH64) +IF (OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE) SRCS( asm_linux_arm64.s defs_linux_arm64.go syscall_linux.go ) -ELSEIF (OS_LINUX AND ARCH_X86_64) +ELSEIF (OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE) SRCS( asm_linux_amd64.s defs_linux_amd64.go diff --git a/contrib/go/_std_1.21/src/runtime/internal/ya.make b/contrib/go/_std_1.21/src/runtime/internal/ya.make deleted file mode 100644 index e69de29bb2d..00000000000 --- a/contrib/go/_std_1.21/src/runtime/internal/ya.make +++ /dev/null diff --git a/contrib/go/_std_1.21/src/runtime/metrics/description.go b/contrib/go/_std_1.21/src/runtime/metrics/description.go deleted file mode 100644 index 745691b24f9..00000000000 --- a/contrib/go/_std_1.21/src/runtime/metrics/description.go +++ /dev/null @@ -1,453 +0,0 @@ -// Copyright 2020 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. - -package metrics - -import "internal/godebugs" - -// Description describes a runtime metric. -type Description struct { - // Name is the full name of the metric which includes the unit. - // - // The format of the metric may be described by the following regular expression. - // - // ^(?P<name>/[^:]+):(?P<unit>[^:*/]+(?:[*/][^:*/]+)*)$ - // - // The format splits the name into two components, separated by a colon: a path which always - // starts with a /, and a machine-parseable unit. The name may contain any valid Unicode - // codepoint in between / characters, but by convention will try to stick to lowercase - // characters and hyphens. An example of such a path might be "/memory/heap/free". - // - // The unit is by convention a series of lowercase English unit names (singular or plural) - // without prefixes delimited by '*' or '/'. The unit names may contain any valid Unicode - // codepoint that is not a delimiter. - // Examples of units might be "seconds", "bytes", "bytes/second", "cpu-seconds", - // "byte*cpu-seconds", and "bytes/second/second". - // - // For histograms, multiple units may apply. For instance, the units of the buckets and - // the count. By convention, for histograms, the units of the count are always "samples" - // with the type of sample evident by the metric's name, while the unit in the name - // specifies the buckets' unit. - // - // A complete name might look like "/memory/heap/free:bytes". - Name string - - // Description is an English language sentence describing the metric. - Description string - - // Kind is the kind of value for this metric. - // - // The purpose of this field is to allow users to filter out metrics whose values are - // types which their application may not understand. - Kind ValueKind - - // Cumulative is whether or not the metric is cumulative. If a cumulative metric is just - // a single number, then it increases monotonically. If the metric is a distribution, - // then each bucket count increases monotonically. - // - // This flag thus indicates whether or not it's useful to compute a rate from this value. - Cumulative bool -} - -// The English language descriptions below must be kept in sync with the -// descriptions of each metric in doc.go by running 'go generate'. -var allDesc = []Description{ - { - Name: "/cgo/go-to-c-calls:calls", - Description: "Count of calls made from Go to C by the current process.", - Kind: KindUint64, - Cumulative: true, - }, - { - Name: "/cpu/classes/gc/mark/assist:cpu-seconds", - Description: "Estimated total CPU time goroutines spent performing GC tasks " + - "to assist the GC and prevent it from falling behind the application. " + - "This metric is an overestimate, and not directly comparable to " + - "system CPU time measurements. Compare only with other /cpu/classes " + - "metrics.", - Kind: KindFloat64, - Cumulative: true, - }, - { - Name: "/cpu/classes/gc/mark/dedicated:cpu-seconds", - Description: "Estimated total CPU time spent performing GC tasks on " + - "processors (as defined by GOMAXPROCS) dedicated to those tasks. " + - "This metric is an overestimate, and not directly comparable to " + - "system CPU time measurements. Compare only with other /cpu/classes " + - "metrics.", - Kind: KindFloat64, - Cumulative: true, - }, - { - Name: "/cpu/classes/gc/mark/idle:cpu-seconds", - Description: "Estimated total CPU time spent performing GC tasks on " + - "spare CPU resources that the Go scheduler could not otherwise find " + - "a use for. This should be subtracted from the total GC CPU time to " + - "obtain a measure of compulsory GC CPU time. " + - "This metric is an overestimate, and not directly comparable to " + - "system CPU time measurements. Compare only with other /cpu/classes " + - "metrics.", - Kind: KindFloat64, - Cumulative: true, - }, - { - Name: "/cpu/classes/gc/pause:cpu-seconds", - Description: "Estimated total CPU time spent with the application paused by " + - "the GC. Even if only one thread is running during the pause, this is " + - "computed as GOMAXPROCS times the pause latency because nothing else " + - "can be executing. This is the exact sum of samples in /gc/pause:seconds " + - "if each sample is multiplied by GOMAXPROCS at the time it is taken. " + - "This metric is an overestimate, and not directly comparable to " + - "system CPU time measurements. Compare only with other /cpu/classes " + - "metrics.", - Kind: KindFloat64, - Cumulative: true, - }, - { - Name: "/cpu/classes/gc/total:cpu-seconds", - Description: "Estimated total CPU time spent performing GC tasks. " + - "This metric is an overestimate, and not directly comparable to " + - "system CPU time measurements. Compare only with other /cpu/classes " + - "metrics. Sum of all metrics in /cpu/classes/gc.", - Kind: KindFloat64, - Cumulative: true, - }, - { - Name: "/cpu/classes/idle:cpu-seconds", - Description: "Estimated total available CPU time not spent executing any Go or Go runtime code. " + - "In other words, the part of /cpu/classes/total:cpu-seconds that was unused. " + - "This metric is an overestimate, and not directly comparable to " + - "system CPU time measurements. Compare only with other /cpu/classes " + - "metrics.", - Kind: KindFloat64, - Cumulative: true, - }, - { - Name: "/cpu/classes/scavenge/assist:cpu-seconds", - Description: "Estimated total CPU time spent returning unused memory to the " + - "underlying platform in response eagerly in response to memory pressure. " + - "This metric is an overestimate, and not directly comparable to " + - "system CPU time measurements. Compare only with other /cpu/classes " + - "metrics.", - Kind: KindFloat64, - Cumulative: true, - }, - { - Name: "/cpu/classes/scavenge/background:cpu-seconds", - Description: "Estimated total CPU time spent performing background tasks " + - "to return unused memory to the underlying platform. " + - "This metric is an overestimate, and not directly comparable to " + - "system CPU time measurements. Compare only with other /cpu/classes " + - "metrics.", - Kind: KindFloat64, - Cumulative: true, - }, - { - Name: "/cpu/classes/scavenge/total:cpu-seconds", - Description: "Estimated total CPU time spent performing tasks that return " + - "unused memory to the underlying platform. " + - "This metric is an overestimate, and not directly comparable to " + - "system CPU time measurements. Compare only with other /cpu/classes " + - "metrics. Sum of all metrics in /cpu/classes/scavenge.", - Kind: KindFloat64, - Cumulative: true, - }, - { - Name: "/cpu/classes/total:cpu-seconds", - Description: "Estimated total available CPU time for user Go code " + - "or the Go runtime, as defined by GOMAXPROCS. In other words, GOMAXPROCS " + - "integrated over the wall-clock duration this process has been executing for. " + - "This metric is an overestimate, and not directly comparable to " + - "system CPU time measurements. Compare only with other /cpu/classes " + - "metrics. Sum of all metrics in /cpu/classes.", - Kind: KindFloat64, - Cumulative: true, - }, - { - Name: "/cpu/classes/user:cpu-seconds", - Description: "Estimated total CPU time spent running user Go code. This may " + - "also include some small amount of time spent in the Go runtime. " + - "This metric is an overestimate, and not directly comparable to " + - "system CPU time measurements. Compare only with other /cpu/classes " + - "metrics.", - Kind: KindFloat64, - Cumulative: true, - }, - { - Name: "/gc/cycles/automatic:gc-cycles", - Description: "Count of completed GC cycles generated by the Go runtime.", - Kind: KindUint64, - Cumulative: true, - }, - { - Name: "/gc/cycles/forced:gc-cycles", - Description: "Count of completed GC cycles forced by the application.", - Kind: KindUint64, - Cumulative: true, - }, - { - Name: "/gc/cycles/total:gc-cycles", - Description: "Count of all completed GC cycles.", - Kind: KindUint64, - Cumulative: true, - }, - { - Name: "/gc/gogc:percent", - Description: "Heap size target percentage configured by the user, otherwise 100. This " + - "value is set by the GOGC environment variable, and the runtime/debug.SetGCPercent " + - "function.", - Kind: KindUint64, - }, - { - Name: "/gc/gomemlimit:bytes", - Description: "Go runtime memory limit configured by the user, otherwise " + - "math.MaxInt64. This value is set by the GOMEMLIMIT environment variable, and " + - "the runtime/debug.SetMemoryLimit function.", - Kind: KindUint64, - }, - { - Name: "/gc/heap/allocs-by-size:bytes", - Description: "Distribution of heap allocations by approximate size. " + - "Bucket counts increase monotonically. " + - "Note that this does not include tiny objects as defined by " + - "/gc/heap/tiny/allocs:objects, only tiny blocks.", - Kind: KindFloat64Histogram, - Cumulative: true, - }, - { - Name: "/gc/heap/allocs:bytes", - Description: "Cumulative sum of memory allocated to the heap by the application.", - Kind: KindUint64, - Cumulative: true, - }, - { - Name: "/gc/heap/allocs:objects", - Description: "Cumulative count of heap allocations triggered by the application. " + - "Note that this does not include tiny objects as defined by " + - "/gc/heap/tiny/allocs:objects, only tiny blocks.", - Kind: KindUint64, - Cumulative: true, - }, - { - Name: "/gc/heap/frees-by-size:bytes", - Description: "Distribution of freed heap allocations by approximate size. " + - "Bucket counts increase monotonically. " + - "Note that this does not include tiny objects as defined by " + - "/gc/heap/tiny/allocs:objects, only tiny blocks.", - Kind: KindFloat64Histogram, - Cumulative: true, - }, - { - Name: "/gc/heap/frees:bytes", - Description: "Cumulative sum of heap memory freed by the garbage collector.", - Kind: KindUint64, - Cumulative: true, - }, - { - Name: "/gc/heap/frees:objects", - Description: "Cumulative count of heap allocations whose storage was freed " + - "by the garbage collector. " + - "Note that this does not include tiny objects as defined by " + - "/gc/heap/tiny/allocs:objects, only tiny blocks.", - Kind: KindUint64, - Cumulative: true, - }, - { - Name: "/gc/heap/goal:bytes", - Description: "Heap size target for the end of the GC cycle.", - Kind: KindUint64, - }, - { - Name: "/gc/heap/live:bytes", - Description: "Heap memory occupied by live objects that were marked by the previous GC.", - Kind: KindUint64, - }, - { - Name: "/gc/heap/objects:objects", - Description: "Number of objects, live or unswept, occupying heap memory.", - Kind: KindUint64, - }, - { - Name: "/gc/heap/tiny/allocs:objects", - Description: "Count of small allocations that are packed together into blocks. " + - "These allocations are counted separately from other allocations " + - "because each individual allocation is not tracked by the runtime, " + - "only their block. Each block is already accounted for in " + - "allocs-by-size and frees-by-size.", - Kind: KindUint64, - Cumulative: true, - }, - { - Name: "/gc/limiter/last-enabled:gc-cycle", - Description: "GC cycle the last time the GC CPU limiter was enabled. " + - "This metric is useful for diagnosing the root cause of an out-of-memory " + - "error, because the limiter trades memory for CPU time when the GC's CPU " + - "time gets too high. This is most likely to occur with use of SetMemoryLimit. " + - "The first GC cycle is cycle 1, so a value of 0 indicates that it was never enabled.", - Kind: KindUint64, - }, - { - Name: "/gc/pauses:seconds", - Description: "Distribution of individual GC-related stop-the-world pause latencies. Bucket counts increase monotonically.", - Kind: KindFloat64Histogram, - Cumulative: true, - }, - { - Name: "/gc/scan/globals:bytes", - Description: "The total amount of global variable space that is scannable.", - Kind: KindUint64, - }, - { - Name: "/gc/scan/heap:bytes", - Description: "The total amount of heap space that is scannable.", - Kind: KindUint64, - }, - { - Name: "/gc/scan/stack:bytes", - Description: "The number of bytes of stack that were scanned last GC cycle.", - Kind: KindUint64, - }, - { - Name: "/gc/scan/total:bytes", - Description: "The total amount space that is scannable. Sum of all metrics in /gc/scan.", - Kind: KindUint64, - }, - { - Name: "/gc/stack/starting-size:bytes", - Description: "The stack size of new goroutines.", - Kind: KindUint64, - Cumulative: false, - }, - { - Name: "/memory/classes/heap/free:bytes", - Description: "Memory that is completely free and eligible to be returned to the underlying system, " + - "but has not been. This metric is the runtime's estimate of free address space that is backed by " + - "physical memory.", - Kind: KindUint64, - }, - { - Name: "/memory/classes/heap/objects:bytes", - Description: "Memory occupied by live objects and dead objects that have not yet been marked free by the garbage collector.", - Kind: KindUint64, - }, - { - Name: "/memory/classes/heap/released:bytes", - Description: "Memory that is completely free and has been returned to the underlying system. This " + - "metric is the runtime's estimate of free address space that is still mapped into the process, " + - "but is not backed by physical memory.", - Kind: KindUint64, - }, - { - Name: "/memory/classes/heap/stacks:bytes", - Description: "Memory allocated from the heap that is reserved for stack space, whether or not it is currently in-use. " + - "Currently, this represents all stack memory for goroutines. It also includes all OS thread stacks in non-cgo programs. " + - "Note that stacks may be allocated differently in the future, and this may change.", - Kind: KindUint64, - }, - { - Name: "/memory/classes/heap/unused:bytes", - Description: "Memory that is reserved for heap objects but is not currently used to hold heap objects.", - Kind: KindUint64, - }, - { - Name: "/memory/classes/metadata/mcache/free:bytes", - Description: "Memory that is reserved for runtime mcache structures, but not in-use.", - Kind: KindUint64, - }, - { - Name: "/memory/classes/metadata/mcache/inuse:bytes", - Description: "Memory that is occupied by runtime mcache structures that are currently being used.", - Kind: KindUint64, - }, - { - Name: "/memory/classes/metadata/mspan/free:bytes", - Description: "Memory that is reserved for runtime mspan structures, but not in-use.", - Kind: KindUint64, - }, - { - Name: "/memory/classes/metadata/mspan/inuse:bytes", - Description: "Memory that is occupied by runtime mspan structures that are currently being used.", - Kind: KindUint64, - }, - { - Name: "/memory/classes/metadata/other:bytes", - Description: "Memory that is reserved for or used to hold runtime metadata.", - Kind: KindUint64, - }, - { - Name: "/memory/classes/os-stacks:bytes", - Description: "Stack memory allocated by the underlying operating system. " + - "In non-cgo programs this metric is currently zero. This may change in the future." + - "In cgo programs this metric includes OS thread stacks allocated directly from the OS. " + - "Currently, this only accounts for one stack in c-shared and c-archive build modes, " + - "and other sources of stacks from the OS are not measured. This too may change in the future.", - Kind: KindUint64, - }, - { - Name: "/memory/classes/other:bytes", - Description: "Memory used by execution trace buffers, structures for debugging the runtime, finalizer and profiler specials, and more.", - Kind: KindUint64, - }, - { - Name: "/memory/classes/profiling/buckets:bytes", - Description: "Memory that is used by the stack trace hash map used for profiling.", - Kind: KindUint64, - }, - { - Name: "/memory/classes/total:bytes", - Description: "All memory mapped by the Go runtime into the current process as read-write. Note that this does not include memory mapped by code called via cgo or via the syscall package. Sum of all metrics in /memory/classes.", - Kind: KindUint64, - }, - { - Name: "/sched/gomaxprocs:threads", - Description: "The current runtime.GOMAXPROCS setting, or the number of operating system threads that can execute user-level Go code simultaneously.", - Kind: KindUint64, - }, - { - Name: "/sched/goroutines:goroutines", - Description: "Count of live goroutines.", - Kind: KindUint64, - }, - { - Name: "/sched/latencies:seconds", - Description: "Distribution of the time goroutines have spent in the scheduler in a runnable state before actually running. Bucket counts increase monotonically.", - Kind: KindFloat64Histogram, - Cumulative: true, - }, - { - Name: "/sync/mutex/wait/total:seconds", - Description: "Approximate cumulative time goroutines have spent blocked on a sync.Mutex or sync.RWMutex. This metric is useful for identifying global changes in lock contention. Collect a mutex or block profile using the runtime/pprof package for more detailed contention data.", - Kind: KindFloat64, - Cumulative: true, - }, -} - -func init() { - // Insert all the non-default-reporting GODEBUGs into the table, - // preserving the overall sort order. - i := 0 - for i < len(allDesc) && allDesc[i].Name < "/godebug/" { - i++ - } - more := make([]Description, i, len(allDesc)+len(godebugs.All)) - copy(more, allDesc) - for _, info := range godebugs.All { - if !info.Opaque { - more = append(more, Description{ - Name: "/godebug/non-default-behavior/" + info.Name + ":events", - Description: "The number of non-default behaviors executed by the " + - info.Package + " package " + "due to a non-default " + - "GODEBUG=" + info.Name + "=... setting.", - Kind: KindUint64, - Cumulative: true, - }) - } - } - allDesc = append(more, allDesc[i:]...) -} - -// All returns a slice of containing metric descriptions for all supported metrics. -func All() []Description { - return allDesc -} diff --git a/contrib/go/_std_1.21/src/runtime/metrics/doc.go b/contrib/go/_std_1.21/src/runtime/metrics/doc.go deleted file mode 100644 index 55d1f65f42d..00000000000 --- a/contrib/go/_std_1.21/src/runtime/metrics/doc.go +++ /dev/null @@ -1,400 +0,0 @@ -// Copyright 2020 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. - -// Note: run 'go generate' (which will run 'go test -generate') to update the "Supported metrics" list. -//go:generate go test -run=Docs -generate - -/* -Package metrics provides a stable interface to access implementation-defined -metrics exported by the Go runtime. This package is similar to existing functions -like [runtime.ReadMemStats] and [debug.ReadGCStats], but significantly more general. - -The set of metrics defined by this package may evolve as the runtime itself -evolves, and also enables variation across Go implementations, whose relevant -metric sets may not intersect. - -# Interface - -Metrics are designated by a string key, rather than, for example, a field name in -a struct. The full list of supported metrics is always available in the slice of -Descriptions returned by All. Each Description also includes useful information -about the metric. - -Thus, users of this API are encouraged to sample supported metrics defined by the -slice returned by All to remain compatible across Go versions. Of course, situations -arise where reading specific metrics is critical. For these cases, users are -encouraged to use build tags, and although metrics may be deprecated and removed, -users should consider this to be an exceptional and rare event, coinciding with a -very large change in a particular Go implementation. - -Each metric key also has a "kind" that describes the format of the metric's value. -In the interest of not breaking users of this package, the "kind" for a given metric -is guaranteed not to change. If it must change, then a new metric will be introduced -with a new key and a new "kind." - -# Metric key format - -As mentioned earlier, metric keys are strings. Their format is simple and well-defined, -designed to be both human and machine readable. It is split into two components, -separated by a colon: a rooted path and a unit. The choice to include the unit in -the key is motivated by compatibility: if a metric's unit changes, its semantics likely -did also, and a new key should be introduced. - -For more details on the precise definition of the metric key's path and unit formats, see -the documentation of the Name field of the Description struct. - -# A note about floats - -This package supports metrics whose values have a floating-point representation. In -order to improve ease-of-use, this package promises to never produce the following -classes of floating-point values: NaN, infinity. - -# Supported metrics - -Below is the full list of supported metrics, ordered lexicographically. - - /cgo/go-to-c-calls:calls - Count of calls made from Go to C by the current process. - - /cpu/classes/gc/mark/assist:cpu-seconds - Estimated total CPU time goroutines spent performing GC - tasks to assist the GC and prevent it from falling behind the - application. This metric is an overestimate, and not directly - comparable to system CPU time measurements. Compare only with - other /cpu/classes metrics. - - /cpu/classes/gc/mark/dedicated:cpu-seconds - Estimated total CPU time spent performing GC tasks on processors - (as defined by GOMAXPROCS) dedicated to those tasks. This metric - is an overestimate, and not directly comparable to system CPU - time measurements. Compare only with other /cpu/classes metrics. - - /cpu/classes/gc/mark/idle:cpu-seconds - Estimated total CPU time spent performing GC tasks on spare CPU - resources that the Go scheduler could not otherwise find a use - for. This should be subtracted from the total GC CPU time to - obtain a measure of compulsory GC CPU time. This metric is an - overestimate, and not directly comparable to system CPU time - measurements. Compare only with other /cpu/classes metrics. - - /cpu/classes/gc/pause:cpu-seconds - Estimated total CPU time spent with the application paused by - the GC. Even if only one thread is running during the pause, - this is computed as GOMAXPROCS times the pause latency because - nothing else can be executing. This is the exact sum of samples - in /gc/pause:seconds if each sample is multiplied by GOMAXPROCS - at the time it is taken. This metric is an overestimate, - and not directly comparable to system CPU time measurements. - Compare only with other /cpu/classes metrics. - - /cpu/classes/gc/total:cpu-seconds - Estimated total CPU time spent performing GC tasks. This metric - is an overestimate, and not directly comparable to system CPU - time measurements. Compare only with other /cpu/classes metrics. - Sum of all metrics in /cpu/classes/gc. - - /cpu/classes/idle:cpu-seconds - Estimated total available CPU time not spent executing - any Go or Go runtime code. In other words, the part of - /cpu/classes/total:cpu-seconds that was unused. This metric is - an overestimate, and not directly comparable to system CPU time - measurements. Compare only with other /cpu/classes metrics. - - /cpu/classes/scavenge/assist:cpu-seconds - Estimated total CPU time spent returning unused memory to the - underlying platform in response eagerly in response to memory - pressure. This metric is an overestimate, and not directly - comparable to system CPU time measurements. Compare only with - other /cpu/classes metrics. - - /cpu/classes/scavenge/background:cpu-seconds - Estimated total CPU time spent performing background tasks to - return unused memory to the underlying platform. This metric is - an overestimate, and not directly comparable to system CPU time - measurements. Compare only with other /cpu/classes metrics. - - /cpu/classes/scavenge/total:cpu-seconds - Estimated total CPU time spent performing tasks that return - unused memory to the underlying platform. This metric is an - overestimate, and not directly comparable to system CPU time - measurements. Compare only with other /cpu/classes metrics. - Sum of all metrics in /cpu/classes/scavenge. - - /cpu/classes/total:cpu-seconds - Estimated total available CPU time for user Go code or the Go - runtime, as defined by GOMAXPROCS. In other words, GOMAXPROCS - integrated over the wall-clock duration this process has been - executing for. This metric is an overestimate, and not directly - comparable to system CPU time measurements. Compare only with - other /cpu/classes metrics. Sum of all metrics in /cpu/classes. - - /cpu/classes/user:cpu-seconds - Estimated total CPU time spent running user Go code. This may - also include some small amount of time spent in the Go runtime. - This metric is an overestimate, and not directly comparable - to system CPU time measurements. Compare only with other - /cpu/classes metrics. - - /gc/cycles/automatic:gc-cycles - Count of completed GC cycles generated by the Go runtime. - - /gc/cycles/forced:gc-cycles - Count of completed GC cycles forced by the application. - - /gc/cycles/total:gc-cycles - Count of all completed GC cycles. - - /gc/gogc:percent - Heap size target percentage configured by the user, otherwise - 100. This value is set by the GOGC environment variable, and the - runtime/debug.SetGCPercent function. - - /gc/gomemlimit:bytes - Go runtime memory limit configured by the user, otherwise - math.MaxInt64. This value is set by the GOMEMLIMIT environment - variable, and the runtime/debug.SetMemoryLimit function. - - /gc/heap/allocs-by-size:bytes - Distribution of heap allocations by approximate size. - Bucket counts increase monotonically. Note that this does not - include tiny objects as defined by /gc/heap/tiny/allocs:objects, - only tiny blocks. - - /gc/heap/allocs:bytes - Cumulative sum of memory allocated to the heap by the - application. - - /gc/heap/allocs:objects - Cumulative count of heap allocations triggered by the - application. Note that this does not include tiny objects as - defined by /gc/heap/tiny/allocs:objects, only tiny blocks. - - /gc/heap/frees-by-size:bytes - Distribution of freed heap allocations by approximate size. - Bucket counts increase monotonically. Note that this does not - include tiny objects as defined by /gc/heap/tiny/allocs:objects, - only tiny blocks. - - /gc/heap/frees:bytes - Cumulative sum of heap memory freed by the garbage collector. - - /gc/heap/frees:objects - Cumulative count of heap allocations whose storage was freed - by the garbage collector. Note that this does not include tiny - objects as defined by /gc/heap/tiny/allocs:objects, only tiny - blocks. - - /gc/heap/goal:bytes - Heap size target for the end of the GC cycle. - - /gc/heap/live:bytes - Heap memory occupied by live objects that were marked by the - previous GC. - - /gc/heap/objects:objects - Number of objects, live or unswept, occupying heap memory. - - /gc/heap/tiny/allocs:objects - Count of small allocations that are packed together into blocks. - These allocations are counted separately from other allocations - because each individual allocation is not tracked by the - runtime, only their block. Each block is already accounted for - in allocs-by-size and frees-by-size. - - /gc/limiter/last-enabled:gc-cycle - GC cycle the last time the GC CPU limiter was enabled. - This metric is useful for diagnosing the root cause of an - out-of-memory error, because the limiter trades memory for CPU - time when the GC's CPU time gets too high. This is most likely - to occur with use of SetMemoryLimit. The first GC cycle is cycle - 1, so a value of 0 indicates that it was never enabled. - - /gc/pauses:seconds - Distribution of individual GC-related stop-the-world pause - latencies. Bucket counts increase monotonically. - - /gc/scan/globals:bytes - The total amount of global variable space that is scannable. - - /gc/scan/heap:bytes - The total amount of heap space that is scannable. - - /gc/scan/stack:bytes - The number of bytes of stack that were scanned last GC cycle. - - /gc/scan/total:bytes - The total amount space that is scannable. Sum of all metrics in - /gc/scan. - - /gc/stack/starting-size:bytes - The stack size of new goroutines. - - /godebug/non-default-behavior/execerrdot:events - The number of non-default behaviors executed by the os/exec - package due to a non-default GODEBUG=execerrdot=... setting. - - /godebug/non-default-behavior/gocachehash:events - The number of non-default behaviors executed by the cmd/go - package due to a non-default GODEBUG=gocachehash=... setting. - - /godebug/non-default-behavior/gocachetest:events - The number of non-default behaviors executed by the cmd/go - package due to a non-default GODEBUG=gocachetest=... setting. - - /godebug/non-default-behavior/gocacheverify:events - The number of non-default behaviors executed by the cmd/go - package due to a non-default GODEBUG=gocacheverify=... setting. - - /godebug/non-default-behavior/http2client:events - The number of non-default behaviors executed by the net/http - package due to a non-default GODEBUG=http2client=... setting. - - /godebug/non-default-behavior/http2server:events - The number of non-default behaviors executed by the net/http - package due to a non-default GODEBUG=http2server=... setting. - - /godebug/non-default-behavior/installgoroot:events - The number of non-default behaviors executed by the go/build - package due to a non-default GODEBUG=installgoroot=... setting. - - /godebug/non-default-behavior/jstmpllitinterp:events - The number of non-default behaviors executed by - the html/template package due to a non-default - GODEBUG=jstmpllitinterp=... setting. - - /godebug/non-default-behavior/multipartmaxheaders:events - The number of non-default behaviors executed by - the mime/multipart package due to a non-default - GODEBUG=multipartmaxheaders=... setting. - - /godebug/non-default-behavior/multipartmaxparts:events - The number of non-default behaviors executed by - the mime/multipart package due to a non-default - GODEBUG=multipartmaxparts=... setting. - - /godebug/non-default-behavior/multipathtcp:events - The number of non-default behaviors executed by the net package - due to a non-default GODEBUG=multipathtcp=... setting. - - /godebug/non-default-behavior/panicnil:events - The number of non-default behaviors executed by the runtime - package due to a non-default GODEBUG=panicnil=... setting. - - /godebug/non-default-behavior/randautoseed:events - The number of non-default behaviors executed by the math/rand - package due to a non-default GODEBUG=randautoseed=... setting. - - /godebug/non-default-behavior/tarinsecurepath:events - The number of non-default behaviors executed by the archive/tar - package due to a non-default GODEBUG=tarinsecurepath=... - setting. - - /godebug/non-default-behavior/tlsmaxrsasize:events - The number of non-default behaviors executed by the crypto/tls - package due to a non-default GODEBUG=tlsmaxrsasize=... setting. - - /godebug/non-default-behavior/x509sha1:events - The number of non-default behaviors executed by the crypto/x509 - package due to a non-default GODEBUG=x509sha1=... setting. - - /godebug/non-default-behavior/x509usefallbackroots:events - The number of non-default behaviors executed by the crypto/x509 - package due to a non-default GODEBUG=x509usefallbackroots=... - setting. - - /godebug/non-default-behavior/zipinsecurepath:events - The number of non-default behaviors executed by the archive/zip - package due to a non-default GODEBUG=zipinsecurepath=... - setting. - - /memory/classes/heap/free:bytes - Memory that is completely free and eligible to be returned to - the underlying system, but has not been. This metric is the - runtime's estimate of free address space that is backed by - physical memory. - - /memory/classes/heap/objects:bytes - Memory occupied by live objects and dead objects that have not - yet been marked free by the garbage collector. - - /memory/classes/heap/released:bytes - Memory that is completely free and has been returned to the - underlying system. This metric is the runtime's estimate of free - address space that is still mapped into the process, but is not - backed by physical memory. - - /memory/classes/heap/stacks:bytes - Memory allocated from the heap that is reserved for stack space, - whether or not it is currently in-use. Currently, this - represents all stack memory for goroutines. It also includes all - OS thread stacks in non-cgo programs. Note that stacks may be - allocated differently in the future, and this may change. - - /memory/classes/heap/unused:bytes - Memory that is reserved for heap objects but is not currently - used to hold heap objects. - - /memory/classes/metadata/mcache/free:bytes - Memory that is reserved for runtime mcache structures, but not - in-use. - - /memory/classes/metadata/mcache/inuse:bytes - Memory that is occupied by runtime mcache structures that are - currently being used. - - /memory/classes/metadata/mspan/free:bytes - Memory that is reserved for runtime mspan structures, but not - in-use. - - /memory/classes/metadata/mspan/inuse:bytes - Memory that is occupied by runtime mspan structures that are - currently being used. - - /memory/classes/metadata/other:bytes - Memory that is reserved for or used to hold runtime metadata. - - /memory/classes/os-stacks:bytes - Stack memory allocated by the underlying operating system. - In non-cgo programs this metric is currently zero. This may - change in the future.In cgo programs this metric includes - OS thread stacks allocated directly from the OS. Currently, - this only accounts for one stack in c-shared and c-archive build - modes, and other sources of stacks from the OS are not measured. - This too may change in the future. - - /memory/classes/other:bytes - Memory used by execution trace buffers, structures for debugging - the runtime, finalizer and profiler specials, and more. - - /memory/classes/profiling/buckets:bytes - Memory that is used by the stack trace hash map used for - profiling. - - /memory/classes/total:bytes - All memory mapped by the Go runtime into the current process - as read-write. Note that this does not include memory mapped - by code called via cgo or via the syscall package. Sum of all - metrics in /memory/classes. - - /sched/gomaxprocs:threads - The current runtime.GOMAXPROCS setting, or the number of - operating system threads that can execute user-level Go code - simultaneously. - - /sched/goroutines:goroutines - Count of live goroutines. - - /sched/latencies:seconds - Distribution of the time goroutines have spent in the scheduler - in a runnable state before actually running. Bucket counts - increase monotonically. - - /sync/mutex/wait/total:seconds - Approximate cumulative time goroutines have spent blocked - on a sync.Mutex or sync.RWMutex. This metric is useful for - identifying global changes in lock contention. Collect a mutex - or block profile using the runtime/pprof package for more - detailed contention data. -*/ -package metrics diff --git a/contrib/go/_std_1.21/src/runtime/metrics/histogram.go b/contrib/go/_std_1.21/src/runtime/metrics/histogram.go deleted file mode 100644 index 956422bf84e..00000000000 --- a/contrib/go/_std_1.21/src/runtime/metrics/histogram.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2020 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. - -package metrics - -// Float64Histogram represents a distribution of float64 values. -type Float64Histogram struct { - // Counts contains the weights for each histogram bucket. - // - // Given N buckets, Count[n] is the weight of the range - // [bucket[n], bucket[n+1]), for 0 <= n < N. - Counts []uint64 - - // Buckets contains the boundaries of the histogram buckets, in increasing order. - // - // Buckets[0] is the inclusive lower bound of the minimum bucket while - // Buckets[len(Buckets)-1] is the exclusive upper bound of the maximum bucket. - // Hence, there are len(Buckets)-1 counts. Furthermore, len(Buckets) != 1, always, - // since at least two boundaries are required to describe one bucket (and 0 - // boundaries are used to describe 0 buckets). - // - // Buckets[0] is permitted to have value -Inf and Buckets[len(Buckets)-1] is - // permitted to have value Inf. - // - // For a given metric name, the value of Buckets is guaranteed not to change - // between calls until program exit. - // - // This slice value is permitted to alias with other Float64Histograms' Buckets - // fields, so the values within should only ever be read. If they need to be - // modified, the user must make a copy. - Buckets []float64 -} diff --git a/contrib/go/_std_1.21/src/runtime/metrics/sample.go b/contrib/go/_std_1.21/src/runtime/metrics/sample.go deleted file mode 100644 index 4cf8cdf7994..00000000000 --- a/contrib/go/_std_1.21/src/runtime/metrics/sample.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2020 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. - -package metrics - -import ( - _ "runtime" // depends on the runtime via a linkname'd function - "unsafe" -) - -// Sample captures a single metric sample. -type Sample struct { - // Name is the name of the metric sampled. - // - // It must correspond to a name in one of the metric descriptions - // returned by All. - Name string - - // Value is the value of the metric sample. - Value Value -} - -// Implemented in the runtime. -func runtime_readMetrics(unsafe.Pointer, int, int) - -// Read populates each Value field in the given slice of metric samples. -// -// Desired metrics should be present in the slice with the appropriate name. -// The user of this API is encouraged to re-use the same slice between calls for -// efficiency, but is not required to do so. -// -// Note that re-use has some caveats. Notably, Values should not be read or -// manipulated while a Read with that value is outstanding; that is a data race. -// This property includes pointer-typed Values (for example, Float64Histogram) -// whose underlying storage will be reused by Read when possible. To safely use -// such values in a concurrent setting, all data must be deep-copied. -// -// It is safe to execute multiple Read calls concurrently, but their arguments -// must share no underlying memory. When in doubt, create a new []Sample from -// scratch, which is always safe, though may be inefficient. -// -// Sample values with names not appearing in All will have their Value populated -// as KindBad to indicate that the name is unknown. -func Read(m []Sample) { - runtime_readMetrics(unsafe.Pointer(&m[0]), len(m), cap(m)) -} diff --git a/contrib/go/_std_1.21/src/runtime/metrics/value.go b/contrib/go/_std_1.21/src/runtime/metrics/value.go deleted file mode 100644 index ed9a33d87cc..00000000000 --- a/contrib/go/_std_1.21/src/runtime/metrics/value.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2020 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. - -package metrics - -import ( - "math" - "unsafe" -) - -// ValueKind is a tag for a metric Value which indicates its type. -type ValueKind int - -const ( - // KindBad indicates that the Value has no type and should not be used. - KindBad ValueKind = iota - - // KindUint64 indicates that the type of the Value is a uint64. - KindUint64 - - // KindFloat64 indicates that the type of the Value is a float64. - KindFloat64 - - // KindFloat64Histogram indicates that the type of the Value is a *Float64Histogram. - KindFloat64Histogram -) - -// Value represents a metric value returned by the runtime. -type Value struct { - kind ValueKind - scalar uint64 // contains scalar values for scalar Kinds. - pointer unsafe.Pointer // contains non-scalar values. -} - -// Kind returns the tag representing the kind of value this is. -func (v Value) Kind() ValueKind { - return v.kind -} - -// Uint64 returns the internal uint64 value for the metric. -// -// If v.Kind() != KindUint64, this method panics. -func (v Value) Uint64() uint64 { - if v.kind != KindUint64 { - panic("called Uint64 on non-uint64 metric value") - } - return v.scalar -} - -// Float64 returns the internal float64 value for the metric. -// -// If v.Kind() != KindFloat64, this method panics. -func (v Value) Float64() float64 { - if v.kind != KindFloat64 { - panic("called Float64 on non-float64 metric value") - } - return math.Float64frombits(v.scalar) -} - -// Float64Histogram returns the internal *Float64Histogram value for the metric. -// -// If v.Kind() != KindFloat64Histogram, this method panics. -func (v Value) Float64Histogram() *Float64Histogram { - if v.kind != KindFloat64Histogram { - panic("called Float64Histogram on non-Float64Histogram metric value") - } - return (*Float64Histogram)(v.pointer) -} diff --git a/contrib/go/_std_1.21/src/runtime/metrics/ya.make b/contrib/go/_std_1.21/src/runtime/metrics/ya.make deleted file mode 100644 index 5d8109dda5a..00000000000 --- a/contrib/go/_std_1.21/src/runtime/metrics/ya.make +++ /dev/null @@ -1,11 +0,0 @@ -GO_LIBRARY() -IF (OS_DARWIN AND ARCH_ARM64 OR OS_DARWIN AND ARCH_X86_64 OR OS_LINUX AND ARCH_AARCH64 OR OS_LINUX AND ARCH_X86_64 OR OS_WINDOWS AND ARCH_X86_64) - SRCS( - description.go - doc.go - histogram.go - sample.go - value.go - ) -ENDIF() -END() diff --git a/contrib/go/_std_1.21/src/runtime/pprof/ya.make b/contrib/go/_std_1.21/src/runtime/pprof/ya.make index 5e4864eabf1..2edcd8c68f1 100644 --- a/contrib/go/_std_1.21/src/runtime/pprof/ya.make +++ b/contrib/go/_std_1.21/src/runtime/pprof/ya.make @@ -1,5 +1,5 @@ GO_LIBRARY() -IF (OS_DARWIN AND ARCH_ARM64 OR OS_DARWIN AND ARCH_X86_64 OR OS_LINUX AND ARCH_AARCH64 OR OS_LINUX AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE) SRCS( elf.go label.go @@ -13,7 +13,7 @@ IF (OS_DARWIN AND ARCH_ARM64 OR OS_DARWIN AND ARCH_X86_64 OR OS_LINUX AND ARCH_A protomem.go runtime.go ) -ELSEIF (OS_WINDOWS AND ARCH_X86_64) +ELSEIF (OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE) SRCS( elf.go label.go diff --git a/contrib/go/_std_1.21/src/runtime/race/doc.go b/contrib/go/_std_1.21/src/runtime/race/doc.go deleted file mode 100644 index 60a20df5bfb..00000000000 --- a/contrib/go/_std_1.21/src/runtime/race/doc.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2013 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. - -// Package race implements data race detection logic. -// No public interface is provided. -// For details about the race detector see -// https://golang.org/doc/articles/race_detector.html -package race - -//go:generate ./mkcgo.sh diff --git a/contrib/go/_std_1.21/src/runtime/race/internal/amd64v1/doc.go b/contrib/go/_std_1.21/src/runtime/race/internal/amd64v1/doc.go deleted file mode 100644 index ccb088cc46c..00000000000 --- a/contrib/go/_std_1.21/src/runtime/race/internal/amd64v1/doc.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2022 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. - -// This package holds the race detector .syso for -// amd64 architectures with GOAMD64<v3. - -//go:build amd64 && ((linux && !amd64.v3) || darwin || freebsd || netbsd || openbsd || windows) - -package amd64v1 diff --git a/contrib/go/_std_1.21/src/runtime/race/internal/amd64v1/ya.make b/contrib/go/_std_1.21/src/runtime/race/internal/amd64v1/ya.make deleted file mode 100644 index 785bdc265ba..00000000000 --- a/contrib/go/_std_1.21/src/runtime/race/internal/amd64v1/ya.make +++ /dev/null @@ -1,29 +0,0 @@ -GO_LIBRARY() - -IF (ARCH_X86_64) - SRCS( - doc.go - ) -ENDIF() - -IF (RACE) - IF (OS_DARWIN AND ARCH_X86_64) - SRCS( - race_darwin.syso - ) - ENDIF() - - IF (OS_LINUX AND ARCH_X86_64) - SRCS( - race_linux.syso - ) - ENDIF() - - IF (OS_WINDOWS AND ARCH_X86_64) - SRCS( - race_windows.syso - ) - ENDIF() -ENDIF() - -END() diff --git a/contrib/go/_std_1.21/src/runtime/race/internal/ya.make b/contrib/go/_std_1.21/src/runtime/race/internal/ya.make deleted file mode 100644 index e69de29bb2d..00000000000 --- a/contrib/go/_std_1.21/src/runtime/race/internal/ya.make +++ /dev/null diff --git a/contrib/go/_std_1.21/src/runtime/race/race_darwin_amd64.go b/contrib/go/_std_1.21/src/runtime/race/race_darwin_amd64.go deleted file mode 100644 index fbb838aa2e4..00000000000 --- a/contrib/go/_std_1.21/src/runtime/race/race_darwin_amd64.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2022 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. - -// Code generated by mkcgo.sh. DO NOT EDIT. - -//go:build race - -package race - -//go:cgo_import_dynamic _Block_object_assign _Block_object_assign "" -//go:cgo_import_dynamic _Block_object_dispose _Block_object_dispose "" -//go:cgo_import_dynamic _NSConcreteStackBlock _NSConcreteStackBlock "" -//go:cgo_import_dynamic _NSGetArgv _NSGetArgv "" -//go:cgo_import_dynamic _NSGetEnviron _NSGetEnviron "" -//go:cgo_import_dynamic _NSGetExecutablePath _NSGetExecutablePath "" -//go:cgo_import_dynamic __bzero __bzero "" -//go:cgo_import_dynamic __error __error "" -//go:cgo_import_dynamic __fork __fork "" -//go:cgo_import_dynamic __mmap __mmap "" -//go:cgo_import_dynamic __munmap __munmap "" -//go:cgo_import_dynamic __stack_chk_fail __stack_chk_fail "" -//go:cgo_import_dynamic __stack_chk_guard __stack_chk_guard "" -//go:cgo_import_dynamic _dyld_get_image_header _dyld_get_image_header "" -//go:cgo_import_dynamic _dyld_get_image_name _dyld_get_image_name "" -//go:cgo_import_dynamic _dyld_get_image_vmaddr_slide _dyld_get_image_vmaddr_slide "" -//go:cgo_import_dynamic _dyld_get_shared_cache_range _dyld_get_shared_cache_range "" -//go:cgo_import_dynamic _dyld_get_shared_cache_uuid _dyld_get_shared_cache_uuid "" -//go:cgo_import_dynamic _dyld_image_count _dyld_image_count "" -//go:cgo_import_dynamic _exit _exit "" -//go:cgo_import_dynamic abort abort "" -//go:cgo_import_dynamic arc4random_buf arc4random_buf "" -//go:cgo_import_dynamic close close "" -//go:cgo_import_dynamic dlsym dlsym "" -//go:cgo_import_dynamic dup dup "" -//go:cgo_import_dynamic dup2 dup2 "" -//go:cgo_import_dynamic dyld_shared_cache_iterate_text dyld_shared_cache_iterate_text "" -//go:cgo_import_dynamic execve execve "" -//go:cgo_import_dynamic exit exit "" -//go:cgo_import_dynamic fstat$INODE64 fstat$INODE64 "" -//go:cgo_import_dynamic ftruncate ftruncate "" -//go:cgo_import_dynamic getpid getpid "" -//go:cgo_import_dynamic getrlimit getrlimit "" -//go:cgo_import_dynamic gettimeofday gettimeofday "" -//go:cgo_import_dynamic getuid getuid "" -//go:cgo_import_dynamic grantpt grantpt "" -//go:cgo_import_dynamic ioctl ioctl "" -//go:cgo_import_dynamic isatty isatty "" -//go:cgo_import_dynamic lstat$INODE64 lstat$INODE64 "" -//go:cgo_import_dynamic mach_absolute_time mach_absolute_time "" -//go:cgo_import_dynamic mach_task_self_ mach_task_self_ "" -//go:cgo_import_dynamic mach_timebase_info mach_timebase_info "" -//go:cgo_import_dynamic mach_vm_region_recurse mach_vm_region_recurse "" -//go:cgo_import_dynamic madvise madvise "" -//go:cgo_import_dynamic malloc_num_zones malloc_num_zones "" -//go:cgo_import_dynamic malloc_zones malloc_zones "" -//go:cgo_import_dynamic memcpy memcpy "" -//go:cgo_import_dynamic memset_pattern16 memset_pattern16 "" -//go:cgo_import_dynamic mkdir mkdir "" -//go:cgo_import_dynamic mprotect mprotect "" -//go:cgo_import_dynamic open open "" -//go:cgo_import_dynamic pipe pipe "" -//go:cgo_import_dynamic posix_openpt posix_openpt "" -//go:cgo_import_dynamic posix_spawn posix_spawn "" -//go:cgo_import_dynamic posix_spawn_file_actions_addclose posix_spawn_file_actions_addclose "" -//go:cgo_import_dynamic posix_spawn_file_actions_adddup2 posix_spawn_file_actions_adddup2 "" -//go:cgo_import_dynamic posix_spawn_file_actions_destroy posix_spawn_file_actions_destroy "" -//go:cgo_import_dynamic posix_spawn_file_actions_init posix_spawn_file_actions_init "" -//go:cgo_import_dynamic posix_spawnattr_destroy posix_spawnattr_destroy "" -//go:cgo_import_dynamic posix_spawnattr_init posix_spawnattr_init "" -//go:cgo_import_dynamic posix_spawnattr_setflags posix_spawnattr_setflags "" -//go:cgo_import_dynamic pthread_attr_getstack pthread_attr_getstack "" -//go:cgo_import_dynamic pthread_create pthread_create "" -//go:cgo_import_dynamic pthread_get_stackaddr_np pthread_get_stackaddr_np "" -//go:cgo_import_dynamic pthread_get_stacksize_np pthread_get_stacksize_np "" -//go:cgo_import_dynamic pthread_getspecific pthread_getspecific "" -//go:cgo_import_dynamic pthread_join pthread_join "" -//go:cgo_import_dynamic pthread_self pthread_self "" -//go:cgo_import_dynamic pthread_sigmask pthread_sigmask "" -//go:cgo_import_dynamic pthread_threadid_np pthread_threadid_np "" -//go:cgo_import_dynamic read read "" -//go:cgo_import_dynamic readlink readlink "" -//go:cgo_import_dynamic realpath$DARWIN_EXTSN realpath$DARWIN_EXTSN "" -//go:cgo_import_dynamic rename rename "" -//go:cgo_import_dynamic sched_yield sched_yield "" -//go:cgo_import_dynamic setrlimit setrlimit "" -//go:cgo_import_dynamic sigaction sigaction "" -//go:cgo_import_dynamic stat$INODE64 stat$INODE64 "" -//go:cgo_import_dynamic sysconf sysconf "" -//go:cgo_import_dynamic sysctl sysctl "" -//go:cgo_import_dynamic sysctlbyname sysctlbyname "" -//go:cgo_import_dynamic task_info task_info "" -//go:cgo_import_dynamic tcgetattr tcgetattr "" -//go:cgo_import_dynamic tcsetattr tcsetattr "" -//go:cgo_import_dynamic unlink unlink "" -//go:cgo_import_dynamic unlockpt unlockpt "" -//go:cgo_import_dynamic usleep usleep "" -//go:cgo_import_dynamic vm_region_64 vm_region_64 "" -//go:cgo_import_dynamic vm_region_recurse_64 vm_region_recurse_64 "" -//go:cgo_import_dynamic waitpid waitpid "" -//go:cgo_import_dynamic write write "" diff --git a/contrib/go/_std_1.21/src/runtime/race/race_darwin_arm64.go b/contrib/go/_std_1.21/src/runtime/race/race_darwin_arm64.go deleted file mode 100644 index fe8584c3224..00000000000 --- a/contrib/go/_std_1.21/src/runtime/race/race_darwin_arm64.go +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2022 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. - -// Code generated by mkcgo.sh. DO NOT EDIT. - -//go:build race - -package race - -//go:cgo_import_dynamic _NSGetArgv _NSGetArgv "" -//go:cgo_import_dynamic _NSGetEnviron _NSGetEnviron "" -//go:cgo_import_dynamic _NSGetExecutablePath _NSGetExecutablePath "" -//go:cgo_import_dynamic __error __error "" -//go:cgo_import_dynamic __fork __fork "" -//go:cgo_import_dynamic __mmap __mmap "" -//go:cgo_import_dynamic __munmap __munmap "" -//go:cgo_import_dynamic __stack_chk_fail __stack_chk_fail "" -//go:cgo_import_dynamic __stack_chk_guard __stack_chk_guard "" -//go:cgo_import_dynamic _dyld_get_image_header _dyld_get_image_header "" -//go:cgo_import_dynamic _dyld_get_image_name _dyld_get_image_name "" -//go:cgo_import_dynamic _dyld_get_image_vmaddr_slide _dyld_get_image_vmaddr_slide "" -//go:cgo_import_dynamic _dyld_image_count _dyld_image_count "" -//go:cgo_import_dynamic _exit _exit "" -//go:cgo_import_dynamic abort abort "" -//go:cgo_import_dynamic arc4random_buf arc4random_buf "" -//go:cgo_import_dynamic bzero bzero "" -//go:cgo_import_dynamic close close "" -//go:cgo_import_dynamic dlsym dlsym "" -//go:cgo_import_dynamic dup dup "" -//go:cgo_import_dynamic dup2 dup2 "" -//go:cgo_import_dynamic execve execve "" -//go:cgo_import_dynamic exit exit "" -//go:cgo_import_dynamic fstat fstat "" -//go:cgo_import_dynamic ftruncate ftruncate "" -//go:cgo_import_dynamic getpid getpid "" -//go:cgo_import_dynamic getrlimit getrlimit "" -//go:cgo_import_dynamic gettimeofday gettimeofday "" -//go:cgo_import_dynamic getuid getuid "" -//go:cgo_import_dynamic grantpt grantpt "" -//go:cgo_import_dynamic ioctl ioctl "" -//go:cgo_import_dynamic isatty isatty "" -//go:cgo_import_dynamic lstat lstat "" -//go:cgo_import_dynamic mach_absolute_time mach_absolute_time "" -//go:cgo_import_dynamic mach_task_self_ mach_task_self_ "" -//go:cgo_import_dynamic mach_timebase_info mach_timebase_info "" -//go:cgo_import_dynamic mach_vm_region_recurse mach_vm_region_recurse "" -//go:cgo_import_dynamic madvise madvise "" -//go:cgo_import_dynamic malloc_num_zones malloc_num_zones "" -//go:cgo_import_dynamic malloc_zones malloc_zones "" -//go:cgo_import_dynamic memcpy memcpy "" -//go:cgo_import_dynamic memset_pattern16 memset_pattern16 "" -//go:cgo_import_dynamic mkdir mkdir "" -//go:cgo_import_dynamic mprotect mprotect "" -//go:cgo_import_dynamic open open "" -//go:cgo_import_dynamic pipe pipe "" -//go:cgo_import_dynamic posix_openpt posix_openpt "" -//go:cgo_import_dynamic posix_spawn posix_spawn "" -//go:cgo_import_dynamic posix_spawn_file_actions_addclose posix_spawn_file_actions_addclose "" -//go:cgo_import_dynamic posix_spawn_file_actions_adddup2 posix_spawn_file_actions_adddup2 "" -//go:cgo_import_dynamic posix_spawn_file_actions_destroy posix_spawn_file_actions_destroy "" -//go:cgo_import_dynamic posix_spawn_file_actions_init posix_spawn_file_actions_init "" -//go:cgo_import_dynamic posix_spawnattr_destroy posix_spawnattr_destroy "" -//go:cgo_import_dynamic posix_spawnattr_init posix_spawnattr_init "" -//go:cgo_import_dynamic posix_spawnattr_setflags posix_spawnattr_setflags "" -//go:cgo_import_dynamic pthread_attr_getstack pthread_attr_getstack "" -//go:cgo_import_dynamic pthread_create pthread_create "" -//go:cgo_import_dynamic pthread_get_stackaddr_np pthread_get_stackaddr_np "" -//go:cgo_import_dynamic pthread_get_stacksize_np pthread_get_stacksize_np "" -//go:cgo_import_dynamic pthread_getspecific pthread_getspecific "" -//go:cgo_import_dynamic pthread_join pthread_join "" -//go:cgo_import_dynamic pthread_self pthread_self "" -//go:cgo_import_dynamic pthread_sigmask pthread_sigmask "" -//go:cgo_import_dynamic pthread_threadid_np pthread_threadid_np "" -//go:cgo_import_dynamic read read "" -//go:cgo_import_dynamic readlink readlink "" -//go:cgo_import_dynamic realpath$DARWIN_EXTSN realpath$DARWIN_EXTSN "" -//go:cgo_import_dynamic rename rename "" -//go:cgo_import_dynamic sched_yield sched_yield "" -//go:cgo_import_dynamic setrlimit setrlimit "" -//go:cgo_import_dynamic sigaction sigaction "" -//go:cgo_import_dynamic stat stat "" -//go:cgo_import_dynamic sysconf sysconf "" -//go:cgo_import_dynamic sysctl sysctl "" -//go:cgo_import_dynamic sysctlbyname sysctlbyname "" -//go:cgo_import_dynamic task_info task_info "" -//go:cgo_import_dynamic tcgetattr tcgetattr "" -//go:cgo_import_dynamic tcsetattr tcsetattr "" -//go:cgo_import_dynamic unlink unlink "" -//go:cgo_import_dynamic unlockpt unlockpt "" -//go:cgo_import_dynamic usleep usleep "" -//go:cgo_import_dynamic vm_region_64 vm_region_64 "" -//go:cgo_import_dynamic vm_region_recurse_64 vm_region_recurse_64 "" -//go:cgo_import_dynamic waitpid waitpid "" -//go:cgo_import_dynamic write write "" diff --git a/contrib/go/_std_1.21/src/runtime/race/race_darwin_arm64.syso b/contrib/go/_std_1.21/src/runtime/race/race_darwin_arm64.syso Binary files differdeleted file mode 100644 index 4a23df2725c..00000000000 --- a/contrib/go/_std_1.21/src/runtime/race/race_darwin_arm64.syso +++ /dev/null diff --git a/contrib/go/_std_1.21/src/runtime/race/race_linux_arm64.syso b/contrib/go/_std_1.21/src/runtime/race/race_linux_arm64.syso Binary files differdeleted file mode 100644 index c8b3f48ca75..00000000000 --- a/contrib/go/_std_1.21/src/runtime/race/race_linux_arm64.syso +++ /dev/null diff --git a/contrib/go/_std_1.21/src/runtime/race/race_v1_amd64.go b/contrib/go/_std_1.21/src/runtime/race/race_v1_amd64.go deleted file mode 100644 index 7c40db1dcf7..00000000000 --- a/contrib/go/_std_1.21/src/runtime/race/race_v1_amd64.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2022 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 && !amd64.v3) || darwin || freebsd || netbsd || openbsd || windows - -package race - -import _ "runtime/race/internal/amd64v1" diff --git a/contrib/go/_std_1.21/src/runtime/race/ya.make b/contrib/go/_std_1.21/src/runtime/race/ya.make deleted file mode 100644 index 0663618efe5..00000000000 --- a/contrib/go/_std_1.21/src/runtime/race/ya.make +++ /dev/null @@ -1,51 +0,0 @@ -GO_LIBRARY() - -NO_COMPILER_WARNINGS() - -SRCS( - doc.go -) - -IF (ARCH_X86_64) - SRCS( - race_v1_amd64.go - ) -ENDIF() - -IF (OS_DARWIN) - IF (ARCH_X86_64) - SRCS( - race_darwin_amd64.go - ) - ENDIF() - IF (ARCH_ARM64) - SRCS( - race_darwin_arm64.go - race_darwin_arm64.syso - ) - ENDIF() -ENDIF() - -IF (OS_LINUX) - IF (ARCH_ARM64) - SRCS( - race_linux_arm64.syso - ) - ENDIF() -ENDIF() - -IF (RACE) - IF (CGO_ENABLED OR OS_DARWIN) - CGO_SRCS( - race.go - ) - ENDIF() -ENDIF() - -END() - -IF (ARCH_X86_64) - RECURSE( - internal - ) -ENDIF() diff --git a/contrib/go/_std_1.21/src/runtime/trace/ya.make b/contrib/go/_std_1.21/src/runtime/trace/ya.make index 08531f15307..bacf4189a92 100644 --- a/contrib/go/_std_1.21/src/runtime/trace/ya.make +++ b/contrib/go/_std_1.21/src/runtime/trace/ya.make @@ -1,5 +1,5 @@ GO_LIBRARY() -IF (OS_DARWIN AND ARCH_ARM64 OR OS_DARWIN AND ARCH_X86_64 OR OS_LINUX AND ARCH_AARCH64 OR OS_LINUX AND ARCH_X86_64 OR OS_WINDOWS AND ARCH_X86_64) +IF (OS_DARWIN AND ARCH_ARM64 AND RACE OR OS_DARWIN AND ARCH_ARM64 AND NOT RACE OR OS_DARWIN AND ARCH_X86_64 AND RACE OR OS_DARWIN AND ARCH_X86_64 AND NOT RACE OR OS_LINUX AND ARCH_AARCH64 AND RACE OR OS_LINUX AND ARCH_AARCH64 AND NOT RACE OR OS_LINUX AND ARCH_X86_64 AND RACE OR OS_LINUX AND ARCH_X86_64 AND NOT RACE OR OS_WINDOWS AND ARCH_X86_64 AND RACE OR OS_WINDOWS AND ARCH_X86_64 AND NOT RACE) SRCS( annotation.go trace.go diff --git a/contrib/go/_std_1.21/src/runtime/ya.make b/contrib/go/_std_1.21/src/runtime/ya.make index 4d1e67d15d0..1befd1835e3 100644 --- a/contrib/go/_std_1.21/src/runtime/ya.make +++ b/contrib/go/_std_1.21/src/runtime/ya.make @@ -1,346 +1,1554 @@ GO_LIBRARY() - -SRCS( - alg.go - arena.go - asan0.go - asm.s - atomic_pointer.go - cgo.go - cgocall.go - cgocallback.go - cgocheck.go - chan.go - checkptr.go - compiler.go - complex.go - covercounter.go - covermeta.go - cpuflags.go - cpuprof.go - debug.go - debugcall.go - debuglog.go - debuglog_off.go - env_posix.go - error.go - exithook.go - extern.go - fastlog2.go - fastlog2table.go - float.go - hash64.go - heapdump.go - histogram.go - iface.go - lfstack.go - lockrank.go - lockrank_off.go - malloc.go - map.go - map_fast32.go - map_fast64.go - map_faststr.go - mbarrier.go - mbitmap.go - mcache.go - mcentral.go - mcheckmark.go - mem.go - metrics.go - mfinal.go - mfixalloc.go - mgc.go - mgclimit.go - mgcmark.go - mgcpacer.go - mgcscavenge.go - mgcstack.go - mgcsweep.go - mgcwork.go - mheap.go - minmax.go - mpagealloc.go - mpagealloc_64bit.go - mpagecache.go - mpallocbits.go - mprof.go - mranges.go - msan0.go - msize.go - mspanset.go - mstats.go - mwbbuf.go - netpoll.go - os_nonopenbsd.go - pagetrace_off.go - panic.go - pinner.go - plugin.go - preempt.go - print.go - proc.go - profbuf.go - proflabel.go - rdebug.go - runtime.go - runtime1.go - runtime2.go - runtime_boring.go - rwmutex.go - select.go - sema.go - sigqueue.go - sizeclasses.go - slice.go - softfloat64.go - stack.go - stkframe.go - string.go - stubs.go - symtab.go - symtabinl.go - sys_nonppc64x.go - tagptr.go - tagptr_64bit.go - time.go - time_nofake.go - trace.go - traceback.go - type.go - typekind.go - unsafe.go - utf8.go - write_err.go -) - -IF (ARCH_X86_64) +IF (OS_DARWIN AND ARCH_ARM64 AND RACE) SRCS( - asm_amd64.s - cpuflags_amd64.go - cputicks.go - duff_amd64.s - memclr_amd64.s - memmove_amd64.s - preempt_amd64.s - stubs_amd64.go - sys_x86.go - test_amd64.go - test_amd64.s + alg.go + arena.go + asan0.go + asm.s + asm_arm64.s + atomic_arm64.s + atomic_pointer.go + cgo.go + cgocall.go + cgocallback.go + cgocheck.go + chan.go + checkptr.go + compiler.go + complex.go + covercounter.go + covermeta.go + cpuflags.go + cpuflags_arm64.go + cpuprof.go + create_file_unix.go + debug.go + debugcall.go + debuglog.go + debuglog_off.go + defs_darwin_arm64.go + duff_arm64.s + env_posix.go + error.go + exithook.go + extern.go + fastlog2.go + fastlog2table.go + float.go + hash64.go + heapdump.go + histogram.go + iface.go + lfstack.go + lock_sema.go + lockrank.go + lockrank_off.go + malloc.go + map.go + map_fast32.go + map_fast64.go + map_faststr.go + mbarrier.go + mbitmap.go + mcache.go + mcentral.go + mcheckmark.go + mem.go + mem_darwin.go + memclr_arm64.s + memmove_arm64.s + metrics.go + mfinal.go + mfixalloc.go + mgc.go + mgclimit.go + mgcmark.go + mgcpacer.go + mgcscavenge.go + mgcstack.go + mgcsweep.go + mgcwork.go + mheap.go + minmax.go + mpagealloc.go + mpagealloc_64bit.go + mpagecache.go + mpallocbits.go + mprof.go + mranges.go + msan0.go + msize.go + mspanset.go + mstats.go + mwbbuf.go + nbpipe_pipe.go + netpoll.go + netpoll_kqueue.go + nonwindows_stub.go + os_darwin.go + os_darwin_arm64.go + os_nonopenbsd.go + os_unix.go + os_unix_nonlinux.go + pagetrace_off.go + panic.go + pinner.go + plugin.go + preempt.go + preempt_arm64.s + preempt_nonwindows.go + print.go + proc.go + profbuf.go + proflabel.go + race.go + race_arm64.s + rdebug.go + retry.go + rt0_darwin_arm64.s + runtime.go + runtime1.go + runtime2.go + runtime_boring.go + rwmutex.go + security_issetugid.go + security_unix.go + select.go + sema.go + signal_arm64.go + signal_darwin.go + signal_darwin_arm64.go + signal_unix.go + sigqueue.go + sizeclasses.go + slice.go + softfloat64.go + stack.go + stkframe.go + string.go + stubs.go + stubs_arm64.go + stubs_nonlinux.go + symtab.go + symtabinl.go + sys_arm64.go + sys_darwin.go + sys_darwin_arm64.go + sys_darwin_arm64.s + sys_libc.go + sys_nonppc64x.go + tagptr.go + tagptr_64bit.go + test_stubs.go + time.go + time_nofake.go + timestub.go + tls_arm64.s + tls_stub.go + trace.go + traceback.go + type.go + typekind.go + unsafe.go + utf8.go + vdso_in_none.go + write_err.go ) - -ENDIF() - -IF (ARCH_ARM64) +ELSEIF (OS_DARWIN AND ARCH_ARM64 AND NOT RACE) SRCS( - asm_arm64.s - atomic_arm64.s - cpuflags_arm64.go - duff_arm64.s - memclr_arm64.s - memmove_arm64.s - preempt_arm64.s - stubs_arm64.go - sys_arm64.go - test_stubs.go - tls_arm64.s - tls_stub.go + alg.go + arena.go + asan0.go + asm.s + asm_arm64.s + atomic_arm64.s + atomic_pointer.go + cgo.go + cgocall.go + cgocallback.go + cgocheck.go + chan.go + checkptr.go + compiler.go + complex.go + covercounter.go + covermeta.go + cpuflags.go + cpuflags_arm64.go + cpuprof.go + create_file_unix.go + debug.go + debugcall.go + debuglog.go + debuglog_off.go + defs_darwin_arm64.go + duff_arm64.s + env_posix.go + error.go + exithook.go + extern.go + fastlog2.go + fastlog2table.go + float.go + hash64.go + heapdump.go + histogram.go + iface.go + lfstack.go + lock_sema.go + lockrank.go + lockrank_off.go + malloc.go + map.go + map_fast32.go + map_fast64.go + map_faststr.go + mbarrier.go + mbitmap.go + mcache.go + mcentral.go + mcheckmark.go + mem.go + mem_darwin.go + memclr_arm64.s + memmove_arm64.s + metrics.go + mfinal.go + mfixalloc.go + mgc.go + mgclimit.go + mgcmark.go + mgcpacer.go + mgcscavenge.go + mgcstack.go + mgcsweep.go + mgcwork.go + mheap.go + minmax.go + mpagealloc.go + mpagealloc_64bit.go + mpagecache.go + mpallocbits.go + mprof.go + mranges.go + msan0.go + msize.go + mspanset.go + mstats.go + mwbbuf.go + nbpipe_pipe.go + netpoll.go + netpoll_kqueue.go + nonwindows_stub.go + os_darwin.go + os_darwin_arm64.go + os_nonopenbsd.go + os_unix.go + os_unix_nonlinux.go + pagetrace_off.go + panic.go + pinner.go + plugin.go + preempt.go + preempt_arm64.s + preempt_nonwindows.go + print.go + proc.go + profbuf.go + proflabel.go + race0.go + rdebug.go + retry.go + rt0_darwin_arm64.s + runtime.go + runtime1.go + runtime2.go + runtime_boring.go + rwmutex.go + security_issetugid.go + security_unix.go + select.go + sema.go + signal_arm64.go + signal_darwin.go + signal_darwin_arm64.go + signal_unix.go + sigqueue.go + sizeclasses.go + slice.go + softfloat64.go + stack.go + stkframe.go + string.go + stubs.go + stubs_arm64.go + stubs_nonlinux.go + symtab.go + symtabinl.go + sys_arm64.go + sys_darwin.go + sys_darwin_arm64.go + sys_darwin_arm64.s + sys_libc.go + sys_nonppc64x.go + tagptr.go + tagptr_64bit.go + test_stubs.go + time.go + time_nofake.go + timestub.go + tls_arm64.s + tls_stub.go + trace.go + traceback.go + type.go + typekind.go + unsafe.go + utf8.go + vdso_in_none.go + write_err.go ) -ENDIF() - -IF (OS_LINUX) +ELSEIF (OS_DARWIN AND ARCH_X86_64 AND RACE) SRCS( - cgo_mmap.go - cgo_sigaction.go - create_file_unix.go - lock_futex.go - mem_linux.go - nbpipe_pipe2.go - netpoll_epoll.go - nonwindows_stub.go - os_linux.go - os_linux_generic.go - os_unix.go - preempt_nonwindows.go - retry.go - security_linux.go - security_unix.go - signal_unix.go - sigqueue_note.go - sigtab_linux_generic.go - stubs2.go - stubs3.go - stubs_linux.go - vdso_elf64.go - vdso_linux.go + alg.go + arena.go + asan0.go + asm.s + asm_amd64.s + atomic_pointer.go + cgo.go + cgocall.go + cgocallback.go + cgocheck.go + chan.go + checkptr.go + compiler.go + complex.go + covercounter.go + covermeta.go + cpuflags.go + cpuflags_amd64.go + cpuprof.go + cputicks.go + create_file_unix.go + debug.go + debugcall.go + debuglog.go + debuglog_off.go + defs_darwin_amd64.go + duff_amd64.s + env_posix.go + error.go + exithook.go + extern.go + fastlog2.go + fastlog2table.go + float.go + hash64.go + heapdump.go + histogram.go + iface.go + lfstack.go + lock_sema.go + lockrank.go + lockrank_off.go + malloc.go + map.go + map_fast32.go + map_fast64.go + map_faststr.go + mbarrier.go + mbitmap.go + mcache.go + mcentral.go + mcheckmark.go + mem.go + mem_darwin.go + memclr_amd64.s + memmove_amd64.s + metrics.go + mfinal.go + mfixalloc.go + mgc.go + mgclimit.go + mgcmark.go + mgcpacer.go + mgcscavenge.go + mgcstack.go + mgcsweep.go + mgcwork.go + mheap.go + minmax.go + mpagealloc.go + mpagealloc_64bit.go + mpagecache.go + mpallocbits.go + mprof.go + mranges.go + msan0.go + msize.go + mspanset.go + mstats.go + mwbbuf.go + nbpipe_pipe.go + netpoll.go + netpoll_kqueue.go + nonwindows_stub.go + os_darwin.go + os_nonopenbsd.go + os_unix.go + os_unix_nonlinux.go + pagetrace_off.go + panic.go + pinner.go + plugin.go + preempt.go + preempt_amd64.s + preempt_nonwindows.go + print.go + proc.go + profbuf.go + proflabel.go + race.go + race_amd64.s + rdebug.go + retry.go + rt0_darwin_amd64.s + runtime.go + runtime1.go + runtime2.go + runtime_boring.go + rwmutex.go + security_issetugid.go + security_unix.go + select.go + sema.go + signal_amd64.go + signal_darwin.go + signal_darwin_amd64.go + signal_unix.go + sigqueue.go + sizeclasses.go + slice.go + softfloat64.go + stack.go + stkframe.go + string.go + stubs.go + stubs_amd64.go + stubs_nonlinux.go + symtab.go + symtabinl.go + sys_darwin.go + sys_darwin_amd64.s + sys_libc.go + sys_nonppc64x.go + sys_x86.go + tagptr.go + tagptr_64bit.go + test_amd64.go + test_amd64.s + time.go + time_nofake.go + timestub.go + tls_stub.go + trace.go + traceback.go + type.go + typekind.go + unsafe.go + utf8.go + vdso_in_none.go + write_err.go ) - -ENDIF() - -IF (OS_LINUX AND ARCH_X86_64) +ELSEIF (OS_DARWIN AND ARCH_X86_64 AND NOT RACE) SRCS( - defs_linux_amd64.go - os_linux_noauxv.go - os_linux_x86.go - rt0_linux_amd64.s - signal_amd64.go - signal_linux_amd64.go - sys_linux_amd64.s - time_linux_amd64.s - timeasm.go - tls_stub.go - vdso_linux_amd64.go + alg.go + arena.go + asan0.go + asm.s + asm_amd64.s + atomic_pointer.go + cgo.go + cgocall.go + cgocallback.go + cgocheck.go + chan.go + checkptr.go + compiler.go + complex.go + covercounter.go + covermeta.go + cpuflags.go + cpuflags_amd64.go + cpuprof.go + cputicks.go + create_file_unix.go + debug.go + debugcall.go + debuglog.go + debuglog_off.go + defs_darwin_amd64.go + duff_amd64.s + env_posix.go + error.go + exithook.go + extern.go + fastlog2.go + fastlog2table.go + float.go + hash64.go + heapdump.go + histogram.go + iface.go + lfstack.go + lock_sema.go + lockrank.go + lockrank_off.go + malloc.go + map.go + map_fast32.go + map_fast64.go + map_faststr.go + mbarrier.go + mbitmap.go + mcache.go + mcentral.go + mcheckmark.go + mem.go + mem_darwin.go + memclr_amd64.s + memmove_amd64.s + metrics.go + mfinal.go + mfixalloc.go + mgc.go + mgclimit.go + mgcmark.go + mgcpacer.go + mgcscavenge.go + mgcstack.go + mgcsweep.go + mgcwork.go + mheap.go + minmax.go + mpagealloc.go + mpagealloc_64bit.go + mpagecache.go + mpallocbits.go + mprof.go + mranges.go + msan0.go + msize.go + mspanset.go + mstats.go + mwbbuf.go + nbpipe_pipe.go + netpoll.go + netpoll_kqueue.go + nonwindows_stub.go + os_darwin.go + os_nonopenbsd.go + os_unix.go + os_unix_nonlinux.go + pagetrace_off.go + panic.go + pinner.go + plugin.go + preempt.go + preempt_amd64.s + preempt_nonwindows.go + print.go + proc.go + profbuf.go + proflabel.go + race0.go + rdebug.go + retry.go + rt0_darwin_amd64.s + runtime.go + runtime1.go + runtime2.go + runtime_boring.go + rwmutex.go + security_issetugid.go + security_unix.go + select.go + sema.go + signal_amd64.go + signal_darwin.go + signal_darwin_amd64.go + signal_unix.go + sigqueue.go + sizeclasses.go + slice.go + softfloat64.go + stack.go + stkframe.go + string.go + stubs.go + stubs_amd64.go + stubs_nonlinux.go + symtab.go + symtabinl.go + sys_darwin.go + sys_darwin_amd64.s + sys_libc.go + sys_nonppc64x.go + sys_x86.go + tagptr.go + tagptr_64bit.go + test_amd64.go + test_amd64.s + time.go + time_nofake.go + timestub.go + tls_stub.go + trace.go + traceback.go + type.go + typekind.go + unsafe.go + utf8.go + vdso_in_none.go + write_err.go ) -ENDIF() - -IF (OS_LINUX AND ARCH_ARM64) +ELSEIF (OS_LINUX AND ARCH_AARCH64 AND RACE) SRCS( - defs_linux_arm64.go - os_linux_arm64.go - rt0_linux_arm64.s - signal_arm64.go - signal_linux_arm64.go - sys_linux_arm64.s - timestub.go - timestub2.go - vdso_linux_arm64.go + alg.go + arena.go + asan0.go + asm.s + asm_arm64.s + atomic_arm64.s + atomic_pointer.go + cgo.go + cgo_mmap.go + cgo_sigaction.go + cgocall.go + cgocallback.go + cgocheck.go + chan.go + checkptr.go + compiler.go + complex.go + covercounter.go + covermeta.go + cpuflags.go + cpuflags_arm64.go + cpuprof.go + create_file_unix.go + debug.go + debugcall.go + debuglog.go + debuglog_off.go + defs_linux_arm64.go + duff_arm64.s + env_posix.go + error.go + exithook.go + extern.go + fastlog2.go + fastlog2table.go + float.go + hash64.go + heapdump.go + histogram.go + iface.go + lfstack.go + lock_futex.go + lockrank.go + lockrank_off.go + malloc.go + map.go + map_fast32.go + map_fast64.go + map_faststr.go + mbarrier.go + mbitmap.go + mcache.go + mcentral.go + mcheckmark.go + mem.go + mem_linux.go + memclr_arm64.s + memmove_arm64.s + metrics.go + mfinal.go + mfixalloc.go + mgc.go + mgclimit.go + mgcmark.go + mgcpacer.go + mgcscavenge.go + mgcstack.go + mgcsweep.go + mgcwork.go + mheap.go + minmax.go + mpagealloc.go + mpagealloc_64bit.go + mpagecache.go + mpallocbits.go + mprof.go + mranges.go + msan0.go + msize.go + mspanset.go + mstats.go + mwbbuf.go + nbpipe_pipe2.go + netpoll.go + netpoll_epoll.go + nonwindows_stub.go + os_linux.go + os_linux_arm64.go + os_linux_generic.go + os_nonopenbsd.go + os_unix.go + pagetrace_off.go + panic.go + pinner.go + plugin.go + preempt.go + preempt_arm64.s + preempt_nonwindows.go + print.go + proc.go + profbuf.go + proflabel.go + race.go + race_arm64.s + rdebug.go + retry.go + rt0_linux_arm64.s + runtime.go + runtime1.go + runtime2.go + runtime_boring.go + rwmutex.go + security_linux.go + security_unix.go + select.go + sema.go + signal_arm64.go + signal_linux_arm64.go + signal_unix.go + sigqueue.go + sigqueue_note.go + sigtab_linux_generic.go + sizeclasses.go + slice.go + softfloat64.go + stack.go + stkframe.go + string.go + stubs.go + stubs2.go + stubs3.go + stubs_arm64.go + stubs_linux.go + symtab.go + symtabinl.go + sys_arm64.go + sys_linux_arm64.s + sys_nonppc64x.go + tagptr.go + tagptr_64bit.go + test_stubs.go + time.go + time_nofake.go + timestub.go + timestub2.go + tls_arm64.s + tls_stub.go + trace.go + traceback.go + type.go + typekind.go + unsafe.go + utf8.go + vdso_elf64.go + vdso_linux.go + vdso_linux_arm64.go + write_err.go ) -ENDIF() - -IF (OS_DARWIN) +ELSEIF (OS_LINUX AND ARCH_AARCH64 AND NOT RACE) SRCS( - create_file_unix.go - lock_sema.go - mem_darwin.go - nbpipe_pipe.go - netpoll_kqueue.go - nonwindows_stub.go - os_darwin.go - os_unix.go - os_unix_nonlinux.go - preempt_nonwindows.go - retry.go - security_issetugid.go - security_unix.go - signal_darwin.go - signal_unix.go - stubs_nonlinux.go - sys_darwin.go - sys_libc.go - timestub.go - vdso_in_none.go + alg.go + arena.go + asan0.go + asm.s + asm_arm64.s + atomic_arm64.s + atomic_pointer.go + cgo.go + cgo_mmap.go + cgo_sigaction.go + cgocall.go + cgocallback.go + cgocheck.go + chan.go + checkptr.go + compiler.go + complex.go + covercounter.go + covermeta.go + cpuflags.go + cpuflags_arm64.go + cpuprof.go + create_file_unix.go + debug.go + debugcall.go + debuglog.go + debuglog_off.go + defs_linux_arm64.go + duff_arm64.s + env_posix.go + error.go + exithook.go + extern.go + fastlog2.go + fastlog2table.go + float.go + hash64.go + heapdump.go + histogram.go + iface.go + lfstack.go + lock_futex.go + lockrank.go + lockrank_off.go + malloc.go + map.go + map_fast32.go + map_fast64.go + map_faststr.go + mbarrier.go + mbitmap.go + mcache.go + mcentral.go + mcheckmark.go + mem.go + mem_linux.go + memclr_arm64.s + memmove_arm64.s + metrics.go + mfinal.go + mfixalloc.go + mgc.go + mgclimit.go + mgcmark.go + mgcpacer.go + mgcscavenge.go + mgcstack.go + mgcsweep.go + mgcwork.go + mheap.go + minmax.go + mpagealloc.go + mpagealloc_64bit.go + mpagecache.go + mpallocbits.go + mprof.go + mranges.go + msan0.go + msize.go + mspanset.go + mstats.go + mwbbuf.go + nbpipe_pipe2.go + netpoll.go + netpoll_epoll.go + nonwindows_stub.go + os_linux.go + os_linux_arm64.go + os_linux_generic.go + os_nonopenbsd.go + os_unix.go + pagetrace_off.go + panic.go + pinner.go + plugin.go + preempt.go + preempt_arm64.s + preempt_nonwindows.go + print.go + proc.go + profbuf.go + proflabel.go + race0.go + rdebug.go + retry.go + rt0_linux_arm64.s + runtime.go + runtime1.go + runtime2.go + runtime_boring.go + rwmutex.go + security_linux.go + security_unix.go + select.go + sema.go + signal_arm64.go + signal_linux_arm64.go + signal_unix.go + sigqueue.go + sigqueue_note.go + sigtab_linux_generic.go + sizeclasses.go + slice.go + softfloat64.go + stack.go + stkframe.go + string.go + stubs.go + stubs2.go + stubs3.go + stubs_arm64.go + stubs_linux.go + symtab.go + symtabinl.go + sys_arm64.go + sys_linux_arm64.s + sys_nonppc64x.go + tagptr.go + tagptr_64bit.go + test_stubs.go + time.go + time_nofake.go + timestub.go + timestub2.go + tls_arm64.s + tls_stub.go + trace.go + traceback.go + type.go + typekind.go + unsafe.go + utf8.go + vdso_elf64.go + vdso_linux.go + vdso_linux_arm64.go + write_err.go ) -ENDIF() - -IF (OS_DARWIN AND ARCH_X86_64) +ELSEIF (OS_LINUX AND ARCH_X86_64 AND RACE) SRCS( - defs_darwin_amd64.go - rt0_darwin_amd64.s - signal_amd64.go - signal_darwin_amd64.go - sys_darwin_amd64.s - tls_stub.go + alg.go + arena.go + asan0.go + asm.s + asm_amd64.s + atomic_pointer.go + cgo.go + cgo_mmap.go + cgo_sigaction.go + cgocall.go + cgocallback.go + cgocheck.go + chan.go + checkptr.go + compiler.go + complex.go + covercounter.go + covermeta.go + cpuflags.go + cpuflags_amd64.go + cpuprof.go + cputicks.go + create_file_unix.go + debug.go + debugcall.go + debuglog.go + debuglog_off.go + defs_linux_amd64.go + duff_amd64.s + env_posix.go + error.go + exithook.go + extern.go + fastlog2.go + fastlog2table.go + float.go + hash64.go + heapdump.go + histogram.go + iface.go + lfstack.go + lock_futex.go + lockrank.go + lockrank_off.go + malloc.go + map.go + map_fast32.go + map_fast64.go + map_faststr.go + mbarrier.go + mbitmap.go + mcache.go + mcentral.go + mcheckmark.go + mem.go + mem_linux.go + memclr_amd64.s + memmove_amd64.s + metrics.go + mfinal.go + mfixalloc.go + mgc.go + mgclimit.go + mgcmark.go + mgcpacer.go + mgcscavenge.go + mgcstack.go + mgcsweep.go + mgcwork.go + mheap.go + minmax.go + mpagealloc.go + mpagealloc_64bit.go + mpagecache.go + mpallocbits.go + mprof.go + mranges.go + msan0.go + msize.go + mspanset.go + mstats.go + mwbbuf.go + nbpipe_pipe2.go + netpoll.go + netpoll_epoll.go + nonwindows_stub.go + os_linux.go + os_linux_generic.go + os_linux_noauxv.go + os_linux_x86.go + os_nonopenbsd.go + os_unix.go + pagetrace_off.go + panic.go + pinner.go + plugin.go + preempt.go + preempt_amd64.s + preempt_nonwindows.go + print.go + proc.go + profbuf.go + proflabel.go + race.go + race_amd64.s + rdebug.go + retry.go + rt0_linux_amd64.s + runtime.go + runtime1.go + runtime2.go + runtime_boring.go + rwmutex.go + security_linux.go + security_unix.go + select.go + sema.go + signal_amd64.go + signal_linux_amd64.go + signal_unix.go + sigqueue.go + sigqueue_note.go + sigtab_linux_generic.go + sizeclasses.go + slice.go + softfloat64.go + stack.go + stkframe.go + string.go + stubs.go + stubs2.go + stubs3.go + stubs_amd64.go + stubs_linux.go + symtab.go + symtabinl.go + sys_linux_amd64.s + sys_nonppc64x.go + sys_x86.go + tagptr.go + tagptr_64bit.go + test_amd64.go + test_amd64.s + time.go + time_linux_amd64.s + time_nofake.go + timeasm.go + tls_stub.go + trace.go + traceback.go + type.go + typekind.go + unsafe.go + utf8.go + vdso_elf64.go + vdso_linux.go + vdso_linux_amd64.go + write_err.go ) -ENDIF() - -IF (OS_DARWIN AND ARCH_ARM64) +ELSEIF (OS_LINUX AND ARCH_X86_64 AND NOT RACE) SRCS( - defs_darwin_arm64.go - os_darwin_arm64.go - rt0_darwin_arm64.s - signal_arm64.go - signal_darwin_arm64.go - sys_darwin_arm64.go - sys_darwin_arm64.s + alg.go + arena.go + asan0.go + asm.s + asm_amd64.s + atomic_pointer.go + cgo.go + cgo_mmap.go + cgo_sigaction.go + cgocall.go + cgocallback.go + cgocheck.go + chan.go + checkptr.go + compiler.go + complex.go + covercounter.go + covermeta.go + cpuflags.go + cpuflags_amd64.go + cpuprof.go + cputicks.go + create_file_unix.go + debug.go + debugcall.go + debuglog.go + debuglog_off.go + defs_linux_amd64.go + duff_amd64.s + env_posix.go + error.go + exithook.go + extern.go + fastlog2.go + fastlog2table.go + float.go + hash64.go + heapdump.go + histogram.go + iface.go + lfstack.go + lock_futex.go + lockrank.go + lockrank_off.go + malloc.go + map.go + map_fast32.go + map_fast64.go + map_faststr.go + mbarrier.go + mbitmap.go + mcache.go + mcentral.go + mcheckmark.go + mem.go + mem_linux.go + memclr_amd64.s + memmove_amd64.s + metrics.go + mfinal.go + mfixalloc.go + mgc.go + mgclimit.go + mgcmark.go + mgcpacer.go + mgcscavenge.go + mgcstack.go + mgcsweep.go + mgcwork.go + mheap.go + minmax.go + mpagealloc.go + mpagealloc_64bit.go + mpagecache.go + mpallocbits.go + mprof.go + mranges.go + msan0.go + msize.go + mspanset.go + mstats.go + mwbbuf.go + nbpipe_pipe2.go + netpoll.go + netpoll_epoll.go + nonwindows_stub.go + os_linux.go + os_linux_generic.go + os_linux_noauxv.go + os_linux_x86.go + os_nonopenbsd.go + os_unix.go + pagetrace_off.go + panic.go + pinner.go + plugin.go + preempt.go + preempt_amd64.s + preempt_nonwindows.go + print.go + proc.go + profbuf.go + proflabel.go + race0.go + rdebug.go + retry.go + rt0_linux_amd64.s + runtime.go + runtime1.go + runtime2.go + runtime_boring.go + rwmutex.go + security_linux.go + security_unix.go + select.go + sema.go + signal_amd64.go + signal_linux_amd64.go + signal_unix.go + sigqueue.go + sigqueue_note.go + sigtab_linux_generic.go + sizeclasses.go + slice.go + softfloat64.go + stack.go + stkframe.go + string.go + stubs.go + stubs2.go + stubs3.go + stubs_amd64.go + stubs_linux.go + symtab.go + symtabinl.go + sys_linux_amd64.s + sys_nonppc64x.go + sys_x86.go + tagptr.go + tagptr_64bit.go + test_amd64.go + test_amd64.s + time.go + time_linux_amd64.s + time_nofake.go + timeasm.go + tls_stub.go + trace.go + traceback.go + type.go + typekind.go + unsafe.go + utf8.go + vdso_elf64.go + vdso_linux.go + vdso_linux_amd64.go + write_err.go ) -ENDIF() - -IF (OS_WINDOWS) +ELSEIF (OS_WINDOWS AND ARCH_X86_64 AND RACE) SRCS( - auxv_none.go - create_file_nounix.go - defs_windows.go - lock_sema.go - mem_windows.go - netpoll_windows.go - os_windows.go - security_nonunix.go - signal_windows.go - sigqueue_note.go - stubs3.go - stubs_nonlinux.go - syscall_windows.go - timeasm.go - vdso_in_none.go - zcallback_windows.go + alg.go + arena.go + asan0.go + asm.s + asm_amd64.s + atomic_pointer.go + auxv_none.go + cgo.go + cgocall.go + cgocallback.go + cgocheck.go + chan.go + checkptr.go + compiler.go + complex.go + covercounter.go + covermeta.go + cpuflags.go + cpuflags_amd64.go + cpuprof.go + cputicks.go + create_file_nounix.go + debug.go + debugcall.go + debuglog.go + debuglog_off.go + defs_windows.go + defs_windows_amd64.go + duff_amd64.s + env_posix.go + error.go + exithook.go + extern.go + fastlog2.go + fastlog2table.go + float.go + hash64.go + heapdump.go + histogram.go + iface.go + lfstack.go + lock_sema.go + lockrank.go + lockrank_off.go + malloc.go + map.go + map_fast32.go + map_fast64.go + map_faststr.go + mbarrier.go + mbitmap.go + mcache.go + mcentral.go + mcheckmark.go + mem.go + mem_windows.go + memclr_amd64.s + memmove_amd64.s + metrics.go + mfinal.go + mfixalloc.go + mgc.go + mgclimit.go + mgcmark.go + mgcpacer.go + mgcscavenge.go + mgcstack.go + mgcsweep.go + mgcwork.go + mheap.go + minmax.go + mpagealloc.go + mpagealloc_64bit.go + mpagecache.go + mpallocbits.go + mprof.go + mranges.go + msan0.go + msize.go + mspanset.go + mstats.go + mwbbuf.go + netpoll.go + netpoll_windows.go + os_nonopenbsd.go + os_windows.go + pagetrace_off.go + panic.go + pinner.go + plugin.go + preempt.go + preempt_amd64.s + print.go + proc.go + profbuf.go + proflabel.go + race.go + race_amd64.s + rdebug.go + rt0_windows_amd64.s + runtime.go + runtime1.go + runtime2.go + runtime_boring.go + rwmutex.go + security_nonunix.go + select.go + sema.go + signal_windows.go + sigqueue.go + sigqueue_note.go + sizeclasses.go + slice.go + softfloat64.go + stack.go + stkframe.go + string.go + stubs.go + stubs3.go + stubs_amd64.go + stubs_nonlinux.go + symtab.go + symtabinl.go + sys_nonppc64x.go + sys_windows_amd64.s + sys_x86.go + syscall_windows.go + tagptr.go + tagptr_64bit.go + test_amd64.go + test_amd64.s + time.go + time_nofake.go + time_windows_amd64.s + timeasm.go + tls_windows_amd64.go + trace.go + traceback.go + type.go + typekind.go + unsafe.go + utf8.go + vdso_in_none.go + write_err.go + zcallback_windows.go + zcallback_windows.s ) -ENDIF() - -IF (OS_WINDOWS AND ARCH_X86_64) +ELSEIF (OS_WINDOWS AND ARCH_X86_64 AND NOT RACE) SRCS( - defs_windows_amd64.go - rt0_windows_amd64.s - sys_windows_amd64.s - time_windows_amd64.s - tls_windows_amd64.go - zcallback_windows.s + alg.go + arena.go + asan0.go + asm.s + asm_amd64.s + atomic_pointer.go + auxv_none.go + cgo.go + cgocall.go + cgocallback.go + cgocheck.go + chan.go + checkptr.go + compiler.go + complex.go + covercounter.go + covermeta.go + cpuflags.go + cpuflags_amd64.go + cpuprof.go + cputicks.go + create_file_nounix.go + debug.go + debugcall.go + debuglog.go + debuglog_off.go + defs_windows.go + defs_windows_amd64.go + duff_amd64.s + env_posix.go + error.go + exithook.go + extern.go + fastlog2.go + fastlog2table.go + float.go + hash64.go + heapdump.go + histogram.go + iface.go + lfstack.go + lock_sema.go + lockrank.go + lockrank_off.go + malloc.go + map.go + map_fast32.go + map_fast64.go + map_faststr.go + mbarrier.go + mbitmap.go + mcache.go + mcentral.go + mcheckmark.go + mem.go + mem_windows.go + memclr_amd64.s + memmove_amd64.s + metrics.go + mfinal.go + mfixalloc.go + mgc.go + mgclimit.go + mgcmark.go + mgcpacer.go + mgcscavenge.go + mgcstack.go + mgcsweep.go + mgcwork.go + mheap.go + minmax.go + mpagealloc.go + mpagealloc_64bit.go + mpagecache.go + mpallocbits.go + mprof.go + mranges.go + msan0.go + msize.go + mspanset.go + mstats.go + mwbbuf.go + netpoll.go + netpoll_windows.go + os_nonopenbsd.go + os_windows.go + pagetrace_off.go + panic.go + pinner.go + plugin.go + preempt.go + preempt_amd64.s + print.go + proc.go + profbuf.go + proflabel.go + race0.go + rdebug.go + rt0_windows_amd64.s + runtime.go + runtime1.go + runtime2.go + runtime_boring.go + rwmutex.go + security_nonunix.go + select.go + sema.go + signal_windows.go + sigqueue.go + sigqueue_note.go + sizeclasses.go + slice.go + softfloat64.go + stack.go + stkframe.go + string.go + stubs.go + stubs3.go + stubs_amd64.go + stubs_nonlinux.go + symtab.go + symtabinl.go + sys_nonppc64x.go + sys_windows_amd64.s + sys_x86.go + syscall_windows.go + tagptr.go + tagptr_64bit.go + test_amd64.go + test_amd64.s + time.go + time_nofake.go + time_windows_amd64.s + timeasm.go + tls_windows_amd64.go + trace.go + traceback.go + type.go + typekind.go + unsafe.go + utf8.go + vdso_in_none.go + write_err.go + zcallback_windows.go + zcallback_windows.s ) ENDIF() - -IF (OS_WINDOWS AND ARCH_ARM64) - SRCS( - defs_windows_arm64.go - os_windows_arm64.go - rt0_windows_arm64.s - sys_windows_arm64.s - time_windows_arm64.s - zcallback_windows_arm64.s - ) -ENDIF() - -IF (CGO_ENABLED OR OS_DARWIN) - IF (RACE) - SRCS( - race.go - ) - - IF (ARCH_ARM64) - SRCS( - race_arm64.s - ) - ENDIF() - - IF (ARCH_X86_64) - SRCS( - race_amd64.s - ) - ENDIF() - ELSE() - SRCS( - race0.go - ) - ENDIF() -ELSE() - SRCS( - race0.go - ) -ENDIF() - END() - -RECURSE( - coverage - debug - internal - metrics - pprof - race - trace -) - -IF (CGO_ENABLED) - RECURSE( - cgo - ) -ENDIF() - |
