$46 GRAYBYTE WORDPRESS FILE MANAGER $49

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/usr/lib/golang/src/runtime/

HOME
Current File : /usr/lib/golang/src/runtime//mprof.go
// Copyright 2009 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.

// Malloc profiling.
// Patterned after tcmalloc's algorithms; shorter code.

package runtime

import (
	"internal/abi"
	"internal/goarch"
	"internal/profilerecord"
	"internal/runtime/atomic"
	"internal/runtime/sys"
	"unsafe"
)

// NOTE(rsc): Everything here could use cas if contention became an issue.
var (
	// profInsertLock protects changes to the start of all *bucket linked lists
	profInsertLock mutex
	// profBlockLock protects the contents of every blockRecord struct
	profBlockLock mutex
	// profMemActiveLock protects the active field of every memRecord struct
	profMemActiveLock mutex
	// profMemFutureLock is a set of locks that protect the respective elements
	// of the future array of every memRecord struct
	profMemFutureLock [len(memRecord{}.future)]mutex
)

// All memory allocations are local and do not escape outside of the profiler.
// The profiler is forbidden from referring to garbage-collected memory.

const (
	// profile types
	memProfile bucketType = 1 + iota
	blockProfile
	mutexProfile

	// size of bucket hash table
	buckHashSize = 179999

	// maxSkip is to account for deferred inline expansion
	// when using frame pointer unwinding. We record the stack
	// with "physical" frame pointers but handle skipping "logical"
	// frames at some point after collecting the stack. So
	// we need extra space in order to avoid getting fewer than the
	// desired maximum number of frames after expansion.
	// This should be at least as large as the largest skip value
	// used for profiling; otherwise stacks may be truncated inconsistently
	maxSkip = 6

	// maxProfStackDepth is the highest valid value for debug.profstackdepth.
	// It's used for the bucket.stk func.
	// TODO(fg): can we get rid of this?
	maxProfStackDepth = 1024
)

type bucketType int

// A bucket holds per-call-stack profiling information.
// The representation is a bit sleazy, inherited from C.
// This struct defines the bucket header. It is followed in
// memory by the stack words and then the actual record
// data, either a memRecord or a blockRecord.
//
// Per-call-stack profiling information.
// Lookup by hashing call stack into a linked-list hash table.
//
// None of the fields in this bucket header are modified after
// creation, including its next and allnext links.
//
// No heap pointers.
type bucket struct {
	_       sys.NotInHeap
	next    *bucket
	allnext *bucket
	typ     bucketType // memBucket or blockBucket (includes mutexProfile)
	hash    uintptr
	size    uintptr
	nstk    uintptr
}

// A memRecord is the bucket data for a bucket of type memProfile,
// part of the memory profile.
type memRecord struct {
	// The following complex 3-stage scheme of stats accumulation
	// is required to obtain a consistent picture of mallocs and frees
	// for some point in time.
	// The problem is that mallocs come in real time, while frees
	// come only after a GC during concurrent sweeping. So if we would
	// naively count them, we would get a skew toward mallocs.
	//
	// Hence, we delay information to get consistent snapshots as
	// of mark termination. Allocations count toward the next mark
	// termination's snapshot, while sweep frees count toward the
	// previous mark termination's snapshot:
	//
	//              MT          MT          MT          MT
	//             .·|         .·|         .·|         .·|
	//          .·˙  |      .·˙  |      .·˙  |      .·˙  |
	//       .·˙     |   .·˙     |   .·˙     |   .·˙     |
	//    .·˙        |.·˙        |.·˙        |.·˙        |
	//
	//       alloc → ▲ ← free
	//               ┠┅┅┅┅┅┅┅┅┅┅┅P
	//       C+2     →    C+1    →  C
	//
	//                   alloc → ▲ ← free
	//                           ┠┅┅┅┅┅┅┅┅┅┅┅P
	//                   C+2     →    C+1    →  C
	//
	// Since we can't publish a consistent snapshot until all of
	// the sweep frees are accounted for, we wait until the next
	// mark termination ("MT" above) to publish the previous mark
	// termination's snapshot ("P" above). To do this, allocation
	// and free events are accounted to *future* heap profile
	// cycles ("C+n" above) and we only publish a cycle once all
	// of the events from that cycle must be done. Specifically:
	//
	// Mallocs are accounted to cycle C+2.
	// Explicit frees are accounted to cycle C+2.
	// GC frees (done during sweeping) are accounted to cycle C+1.
	//
	// After mark termination, we increment the global heap
	// profile cycle counter and accumulate the stats from cycle C
	// into the active profile.

	// active is the currently published profile. A profiling
	// cycle can be accumulated into active once its complete.
	active memRecordCycle

	// future records the profile events we're counting for cycles
	// that have not yet been published. This is ring buffer
	// indexed by the global heap profile cycle C and stores
	// cycles C, C+1, and C+2. Unlike active, these counts are
	// only for a single cycle; they are not cumulative across
	// cycles.
	//
	// We store cycle C here because there's a window between when
	// C becomes the active cycle and when we've flushed it to
	// active.
	future [3]memRecordCycle
}

// memRecordCycle
type memRecordCycle struct {
	allocs, frees           uintptr
	alloc_bytes, free_bytes uintptr
}

// add accumulates b into a. It does not zero b.
func (a *memRecordCycle) add(b *memRecordCycle) {
	a.allocs += b.allocs
	a.frees += b.frees
	a.alloc_bytes += b.alloc_bytes
	a.free_bytes += b.free_bytes
}

// A blockRecord is the bucket data for a bucket of type blockProfile,
// which is used in blocking and mutex profiles.
type blockRecord struct {
	count  float64
	cycles int64
}

var (
	mbuckets atomic.UnsafePointer // *bucket, memory profile buckets
	bbuckets atomic.UnsafePointer // *bucket, blocking profile buckets
	xbuckets atomic.UnsafePointer // *bucket, mutex profile buckets
	buckhash atomic.UnsafePointer // *buckhashArray

	mProfCycle mProfCycleHolder
)

type buckhashArray [buckHashSize]atomic.UnsafePointer // *bucket

const mProfCycleWrap = uint32(len(memRecord{}.future)) * (2 << 24)

// mProfCycleHolder holds the global heap profile cycle number (wrapped at
// mProfCycleWrap, stored starting at bit 1), and a flag (stored at bit 0) to
// indicate whether future[cycle] in all buckets has been queued to flush into
// the active profile.
type mProfCycleHolder struct {
	value atomic.Uint32
}

// read returns the current cycle count.
func (c *mProfCycleHolder) read() (cycle uint32) {
	v := c.value.Load()
	cycle = v >> 1
	return cycle
}

// setFlushed sets the flushed flag. It returns the current cycle count and the
// previous value of the flushed flag.
func (c *mProfCycleHolder) setFlushed() (cycle uint32, alreadyFlushed bool) {
	for {
		prev := c.value.Load()
		cycle = prev >> 1
		alreadyFlushed = (prev & 0x1) != 0
		next := prev | 0x1
		if c.value.CompareAndSwap(prev, next) {
			return cycle, alreadyFlushed
		}
	}
}

// increment increases the cycle count by one, wrapping the value at
// mProfCycleWrap. It clears the flushed flag.
func (c *mProfCycleHolder) increment() {
	// We explicitly wrap mProfCycle rather than depending on
	// uint wraparound because the memRecord.future ring does not
	// itself wrap at a power of two.
	for {
		prev := c.value.Load()
		cycle := prev >> 1
		cycle = (cycle + 1) % mProfCycleWrap
		next := cycle << 1
		if c.value.CompareAndSwap(prev, next) {
			break
		}
	}
}

// newBucket allocates a bucket with the given type and number of stack entries.
func newBucket(typ bucketType, nstk int) *bucket {
	size := unsafe.Sizeof(bucket{}) + uintptr(nstk)*unsafe.Sizeof(uintptr(0))
	switch typ {
	default:
		throw("invalid profile bucket type")
	case memProfile:
		size += unsafe.Sizeof(memRecord{})
	case blockProfile, mutexProfile:
		size += unsafe.Sizeof(blockRecord{})
	}

	b := (*bucket)(persistentalloc(size, 0, &memstats.buckhash_sys))
	b.typ = typ
	b.nstk = uintptr(nstk)
	return b
}

// stk returns the slice in b holding the stack. The caller can assume that the
// backing array is immutable.
func (b *bucket) stk() []uintptr {
	stk := (*[maxProfStackDepth]uintptr)(add(unsafe.Pointer(b), unsafe.Sizeof(*b)))
	if b.nstk > maxProfStackDepth {
		// prove that slicing works; otherwise a failure requires a P
		throw("bad profile stack count")
	}
	return stk[:b.nstk:b.nstk]
}

// mp returns the memRecord associated with the memProfile bucket b.
func (b *bucket) mp() *memRecord {
	if b.typ != memProfile {
		throw("bad use of bucket.mp")
	}
	data := add(unsafe.Pointer(b), unsafe.Sizeof(*b)+b.nstk*unsafe.Sizeof(uintptr(0)))
	return (*memRecord)(data)
}

// bp returns the blockRecord associated with the blockProfile bucket b.
func (b *bucket) bp() *blockRecord {
	if b.typ != blockProfile && b.typ != mutexProfile {
		throw("bad use of bucket.bp")
	}
	data := add(unsafe.Pointer(b), unsafe.Sizeof(*b)+b.nstk*unsafe.Sizeof(uintptr(0)))
	return (*blockRecord)(data)
}

// Return the bucket for stk[0:nstk], allocating new bucket if needed.
func stkbucket(typ bucketType, size uintptr, stk []uintptr, alloc bool) *bucket {
	bh := (*buckhashArray)(buckhash.Load())
	if bh == nil {
		lock(&profInsertLock)
		// check again under the lock
		bh = (*buckhashArray)(buckhash.Load())
		if bh == nil {
			bh = (*buckhashArray)(sysAlloc(unsafe.Sizeof(buckhashArray{}), &memstats.buckhash_sys, "profiler hash buckets"))
			if bh == nil {
				throw("runtime: cannot allocate memory")
			}
			buckhash.StoreNoWB(unsafe.Pointer(bh))
		}
		unlock(&profInsertLock)
	}

	// Hash stack.
	var h uintptr
	for _, pc := range stk {
		h += pc
		h += h << 10
		h ^= h >> 6
	}
	// hash in size
	h += size
	h += h << 10
	h ^= h >> 6
	// finalize
	h += h << 3
	h ^= h >> 11

	i := int(h % buckHashSize)
	// first check optimistically, without the lock
	for b := (*bucket)(bh[i].Load()); b != nil; b = b.next {
		if b.typ == typ && b.hash == h && b.size == size && eqslice(b.stk(), stk) {
			return b
		}
	}

	if !alloc {
		return nil
	}

	lock(&profInsertLock)
	// check again under the insertion lock
	for b := (*bucket)(bh[i].Load()); b != nil; b = b.next {
		if b.typ == typ && b.hash == h && b.size == size && eqslice(b.stk(), stk) {
			unlock(&profInsertLock)
			return b
		}
	}

	// Create new bucket.
	b := newBucket(typ, len(stk))
	copy(b.stk(), stk)
	b.hash = h
	b.size = size

	var allnext *atomic.UnsafePointer
	if typ == memProfile {
		allnext = &mbuckets
	} else if typ == mutexProfile {
		allnext = &xbuckets
	} else {
		allnext = &bbuckets
	}

	b.next = (*bucket)(bh[i].Load())
	b.allnext = (*bucket)(allnext.Load())

	bh[i].StoreNoWB(unsafe.Pointer(b))
	allnext.StoreNoWB(unsafe.Pointer(b))

	unlock(&profInsertLock)
	return b
}

func eqslice(x, y []uintptr) bool {
	if len(x) != len(y) {
		return false
	}
	for i, xi := range x {
		if xi != y[i] {
			return false
		}
	}
	return true
}

// mProf_NextCycle publishes the next heap profile cycle and creates a
// fresh heap profile cycle. This operation is fast and can be done
// during STW. The caller must call mProf_Flush before calling
// mProf_NextCycle again.
//
// This is called by mark termination during STW so allocations and
// frees after the world is started again count towards a new heap
// profiling cycle.
func mProf_NextCycle() {
	mProfCycle.increment()
}

// mProf_Flush flushes the events from the current heap profiling
// cycle into the active profile. After this it is safe to start a new
// heap profiling cycle with mProf_NextCycle.
//
// This is called by GC after mark termination starts the world. In
// contrast with mProf_NextCycle, this is somewhat expensive, but safe
// to do concurrently.
func mProf_Flush() {
	cycle, alreadyFlushed := mProfCycle.setFlushed()
	if alreadyFlushed {
		return
	}

	index := cycle % uint32(len(memRecord{}.future))
	lock(&profMemActiveLock)
	lock(&profMemFutureLock[index])
	mProf_FlushLocked(index)
	unlock(&profMemFutureLock[index])
	unlock(&profMemActiveLock)
}

// mProf_FlushLocked flushes the events from the heap profiling cycle at index
// into the active profile. The caller must hold the lock for the active profile
// (profMemActiveLock) and for the profiling cycle at index
// (profMemFutureLock[index]).
func mProf_FlushLocked(index uint32) {
	assertLockHeld(&profMemActiveLock)
	assertLockHeld(&profMemFutureLock[index])
	head := (*bucket)(mbuckets.Load())
	for b := head; b != nil; b = b.allnext {
		mp := b.mp()

		// Flush cycle C into the published profile and clear
		// it for reuse.
		mpc := &mp.future[index]
		mp.active.add(mpc)
		*mpc = memRecordCycle{}
	}
}

// mProf_PostSweep records that all sweep frees for this GC cycle have
// completed. This has the effect of publishing the heap profile
// snapshot as of the last mark termination without advancing the heap
// profile cycle.
func mProf_PostSweep() {
	// Flush cycle C+1 to the active profile so everything as of
	// the last mark termination becomes visible. *Don't* advance
	// the cycle, since we're still accumulating allocs in cycle
	// C+2, which have to become C+1 in the next mark termination
	// and so on.
	cycle := mProfCycle.read() + 1

	index := cycle % uint32(len(memRecord{}.future))
	lock(&profMemActiveLock)
	lock(&profMemFutureLock[index])
	mProf_FlushLocked(index)
	unlock(&profMemFutureLock[index])
	unlock(&profMemActiveLock)
}

// Called by malloc to record a profiled block.
func mProf_Malloc(mp *m, p unsafe.Pointer, size uintptr) {
	if mp.profStack == nil {
		// mp.profStack is nil if we happen to sample an allocation during the
		// initialization of mp. This case is rare, so we just ignore such
		// allocations. Change MemProfileRate to 1 if you need to reproduce such
		// cases for testing purposes.
		return
	}
	// Only use the part of mp.profStack we need and ignore the extra space
	// reserved for delayed inline expansion with frame pointer unwinding.
	nstk := callers(5, mp.profStack[:debug.profstackdepth])
	index := (mProfCycle.read() + 2) % uint32(len(memRecord{}.future))

	b := stkbucket(memProfile, size, mp.profStack[:nstk], true)
	mr := b.mp()
	mpc := &mr.future[index]

	lock(&profMemFutureLock[index])
	mpc.allocs++
	mpc.alloc_bytes += size
	unlock(&profMemFutureLock[index])

	// Setprofilebucket locks a bunch of other mutexes, so we call it outside of
	// the profiler locks. This reduces potential contention and chances of
	// deadlocks. Since the object must be alive during the call to
	// mProf_Malloc, it's fine to do this non-atomically.
	systemstack(func() {
		setprofilebucket(p, b)
	})
}

// Called when freeing a profiled block.
func mProf_Free(b *bucket, size uintptr) {
	index := (mProfCycle.read() + 1) % uint32(len(memRecord{}.future))

	mp := b.mp()
	mpc := &mp.future[index]

	lock(&profMemFutureLock[index])
	mpc.frees++
	mpc.free_bytes += size
	unlock(&profMemFutureLock[index])
}

var blockprofilerate uint64 // in CPU ticks

// SetBlockProfileRate controls the fraction of goroutine blocking events
// that are reported in the blocking profile. The profiler aims to sample
// an average of one blocking event per rate nanoseconds spent blocked.
//
// To include every blocking event in the profile, pass rate = 1.
// To turn off profiling entirely, pass rate <= 0.
func SetBlockProfileRate(rate int) {
	var r int64
	if rate <= 0 {
		r = 0 // disable profiling
	} else if rate == 1 {
		r = 1 // profile everything
	} else {
		// convert ns to cycles, use float64 to prevent overflow during multiplication
		r = int64(float64(rate) * float64(ticksPerSecond()) / (1000 * 1000 * 1000))
		if r == 0 {
			r = 1
		}
	}

	atomic.Store64(&blockprofilerate, uint64(r))
}

func blockevent(cycles int64, skip int) {
	if cycles <= 0 {
		cycles = 1
	}

	rate := int64(atomic.Load64(&blockprofilerate))
	if blocksampled(cycles, rate) {
		saveblockevent(cycles, rate, skip+1, blockProfile)
	}
}

// blocksampled returns true for all events where cycles >= rate. Shorter
// events have a cycles/rate random chance of returning true.
func blocksampled(cycles, rate int64) bool {
	if rate <= 0 || (rate > cycles && cheaprand64()%rate > cycles) {
		return false
	}
	return true
}

// saveblockevent records a profile event of the type specified by which.
// cycles is the quantity associated with this event and rate is the sampling rate,
// used to adjust the cycles value in the manner determined by the profile type.
// skip is the number of frames to omit from the traceback associated with the event.
// The traceback will be recorded from the stack of the goroutine associated with the current m.
// skip should be positive if this event is recorded from the current stack
// (e.g. when this is not called from a system stack)
func saveblockevent(cycles, rate int64, skip int, which bucketType) {
	if debug.profstackdepth == 0 {
		// profstackdepth is set to 0 by the user, so mp.profStack is nil and we
		// can't record a stack trace.
		return
	}
	if skip > maxSkip {
		print("requested skip=", skip)
		throw("invalid skip value")
	}
	gp := getg()
	mp := acquirem() // we must not be preempted while accessing profstack

	var nstk int
	if tracefpunwindoff() || gp.m.hasCgoOnStack() {
		if gp.m.curg == nil || gp.m.curg == gp {
			nstk = callers(skip, mp.profStack)
		} else {
			nstk = gcallers(gp.m.curg, skip, mp.profStack)
		}
	} else {
		if gp.m.curg == nil || gp.m.curg == gp {
			if skip > 0 {
				// We skip one fewer frame than the provided value for frame
				// pointer unwinding because the skip value includes the current
				// frame, whereas the saved frame pointer will give us the
				// caller's return address first (so, not including
				// saveblockevent)
				skip -= 1
			}
			nstk = fpTracebackPartialExpand(skip, unsafe.Pointer(getfp()), mp.profStack)
		} else {
			mp.profStack[0] = gp.m.curg.sched.pc
			nstk = 1 + fpTracebackPartialExpand(skip, unsafe.Pointer(gp.m.curg.sched.bp), mp.profStack[1:])
		}
	}

	saveBlockEventStack(cycles, rate, mp.profStack[:nstk], which)
	releasem(mp)
}

// fpTracebackPartialExpand records a call stack obtained starting from fp.
// This function will skip the given number of frames, properly accounting for
// inlining, and save remaining frames as "physical" return addresses. The
// consumer should later use CallersFrames or similar to expand inline frames.
func fpTracebackPartialExpand(skip int, fp unsafe.Pointer, pcBuf []uintptr) int {
	var n int
	lastFuncID := abi.FuncIDNormal
	skipOrAdd := func(retPC uintptr) bool {
		if skip > 0 {
			skip--
		} else if n < len(pcBuf) {
			pcBuf[n] = retPC
			n++
		}
		return n < len(pcBuf)
	}
	for n < len(pcBuf) && fp != nil {
		// return addr sits one word above the frame pointer
		pc := *(*uintptr)(unsafe.Pointer(uintptr(fp) + goarch.PtrSize))

		if skip > 0 {
			callPC := pc - 1
			fi := findfunc(callPC)
			u, uf := newInlineUnwinder(fi, callPC)
			for ; uf.valid(); uf = u.next(uf) {
				sf := u.srcFunc(uf)
				if sf.funcID == abi.FuncIDWrapper && elideWrapperCalling(lastFuncID) {
					// ignore wrappers
				} else if more := skipOrAdd(uf.pc + 1); !more {
					return n
				}
				lastFuncID = sf.funcID
			}
		} else {
			// We've skipped the desired number of frames, so no need
			// to perform further inline expansion now.
			pcBuf[n] = pc
			n++
		}

		// follow the frame pointer to the next one
		fp = unsafe.Pointer(*(*uintptr)(fp))
	}
	return n
}

// mLockProfile holds information about the runtime-internal lock contention
// experienced and caused by this M, to report in metrics and profiles.
//
// These measurements are subject to some notable constraints: First, the fast
// path for lock and unlock must remain very fast, with a minimal critical
// section. Second, the critical section during contention has to remain small
// too, so low levels of contention are less likely to snowball into large ones.
// The reporting code cannot acquire new locks until the M has released all
// other locks, which means no memory allocations and encourages use of
// (temporary) M-local storage.
//
// The M has space for storing one call stack that caused contention, and the
// magnitude of that contention. It also has space to store the magnitude of
// additional contention the M caused, since it might encounter several
// contention events before it releases all of its locks and is thus able to
// transfer the locally buffered call stack and magnitude into the profile.
//
// The M collects the call stack when it unlocks the contended lock. The
// traceback takes place outside of the lock's critical section.
//
// The profile for contention on sync.Mutex blames the caller of Unlock for the
// amount of contention experienced by the callers of Lock which had to wait.
// When there are several critical sections, this allows identifying which of
// them is responsible. We must match that reporting behavior for contention on
// runtime-internal locks.
//
// When the M unlocks its last mutex, it transfers the locally buffered call
// stack and magnitude into the profile. As part of that step, it also transfers
// any "additional contention" time to the profile. Any lock contention that it
// experiences while adding samples to the profile will be recorded later as
// "additional contention" and not include a call stack, to avoid an echo.
type mLockProfile struct {
	waitTime   atomic.Int64 // (nanotime) total time this M has spent waiting in runtime.lockWithRank. Read by runtime/metrics.
	stack      []uintptr    // call stack at the point of this M's unlock call, when other Ms had to wait
	cycles     int64        // (cputicks) cycles attributable to "stack"
	cyclesLost int64        // (cputicks) contention for which we weren't able to record a call stack
	haveStack  bool         // stack and cycles are to be added to the mutex profile (even if cycles is 0)
	disabled   bool         // attribute all time to "lost"
}

func (prof *mLockProfile) start() int64 {
	if cheaprandn(gTrackingPeriod) == 0 {
		return nanotime()
	}
	return 0
}

func (prof *mLockProfile) end(start int64) {
	if start != 0 {
		prof.waitTime.Add((nanotime() - start) * gTrackingPeriod)
	}
}

// recordUnlock prepares data for later addition to the mutex contention
// profile. The M may hold arbitrary locks during this call.
//
// From unlock2, we might not be holding a p in this code.
//
//go:nowritebarrierrec
func (prof *mLockProfile) recordUnlock(cycles int64) {
	if cycles < 0 {
		cycles = 0
	}

	if prof.disabled {
		// We're experiencing contention while attempting to report contention.
		// Make a note of its magnitude, but don't allow it to be the sole cause
		// of another contention report.
		prof.cyclesLost += cycles
		return
	}

	if prev := prof.cycles; prev > 0 {
		// We can only store one call stack for runtime-internal lock contention
		// on this M, and we've already got one. Decide which should stay, and
		// add the other to the report for runtime._LostContendedRuntimeLock.
		if cycles == 0 {
			return
		}
		prevScore := uint64(cheaprand64()) % uint64(prev)
		thisScore := uint64(cheaprand64()) % uint64(cycles)
		if prevScore > thisScore {
			prof.cyclesLost += cycles
			return
		} else {
			prof.cyclesLost += prev
		}
	}
	prof.captureStack()
	prof.cycles = cycles
}

func (prof *mLockProfile) captureStack() {
	if debug.profstackdepth == 0 {
		// profstackdepth is set to 0 by the user, so mp.profStack is nil and we
		// can't record a stack trace.
		return
	}

	skip := 4 // runtime.(*mLockProfile).recordUnlock runtime.unlock2Wake runtime.unlock2 runtime.unlockWithRank
	if staticLockRanking {
		// When static lock ranking is enabled, we'll always be on the system
		// stack at this point. There will be a runtime.unlockWithRank.func1
		// frame, and if the call to runtime.unlock took place on a user stack
		// then there'll also be a runtime.systemstack frame. To keep stack
		// traces somewhat consistent whether or not static lock ranking is
		// enabled, we'd like to skip those. But it's hard to tell how long
		// we've been on the system stack so accept an extra frame in that case,
		// with a leaf of "runtime.unlockWithRank runtime.unlock" instead of
		// "runtime.unlock".
		skip += 1 // runtime.unlockWithRank.func1
	}
	prof.haveStack = true

	prof.stack[0] = logicalStackSentinel

	var nstk int
	gp := getg()
	sp := sys.GetCallerSP()
	pc := sys.GetCallerPC()
	systemstack(func() {
		var u unwinder
		u.initAt(pc, sp, 0, gp, unwindSilentErrors|unwindJumpStack)
		nstk = 1 + tracebackPCs(&u, skip, prof.stack[1:])
	})
	if nstk < len(prof.stack) {
		prof.stack[nstk] = 0
	}
}

// store adds the M's local record to the mutex contention profile.
//
// From unlock2, we might not be holding a p in this code.
//
//go:nowritebarrierrec
func (prof *mLockProfile) store() {
	if gp := getg(); gp.m.locks == 1 && gp.m.mLockProfile.haveStack {
		prof.storeSlow()
	}
}

func (prof *mLockProfile) storeSlow() {
	// Report any contention we experience within this function as "lost"; it's
	// important that the act of reporting a contention event not lead to a
	// reportable contention event. This also means we can use prof.stack
	// without copying, since it won't change during this function.
	mp := acquirem()
	prof.disabled = true

	nstk := int(debug.profstackdepth)
	for i := 0; i < nstk; i++ {
		if pc := prof.stack[i]; pc == 0 {
			nstk = i
			break
		}
	}

	cycles, lost := prof.cycles, prof.cyclesLost
	prof.cycles, prof.cyclesLost = 0, 0
	prof.haveStack = false

	rate := int64(atomic.Load64(&mutexprofilerate))
	saveBlockEventStack(cycles, rate, prof.stack[:nstk], mutexProfile)
	if lost > 0 {
		lostStk := [...]uintptr{
			logicalStackSentinel,
			abi.FuncPCABIInternal(_LostContendedRuntimeLock) + sys.PCQuantum,
		}
		saveBlockEventStack(lost, rate, lostStk[:], mutexProfile)
	}

	prof.disabled = false
	releasem(mp)
}

func saveBlockEventStack(cycles, rate int64, stk []uintptr, which bucketType) {
	b := stkbucket(which, 0, stk, true)
	bp := b.bp()

	lock(&profBlockLock)
	// We want to up-scale the count and cycles according to the
	// probability that the event was sampled. For block profile events,
	// the sample probability is 1 if cycles >= rate, and cycles / rate
	// otherwise. For mutex profile events, the sample probability is 1 / rate.
	// We scale the events by 1 / (probability the event was sampled).
	if which == blockProfile && cycles < rate {
		// Remove sampling bias, see discussion on http://golang.org/cl/299991.
		bp.count += float64(rate) / float64(cycles)
		bp.cycles += rate
	} else if which == mutexProfile {
		bp.count += float64(rate)
		bp.cycles += rate * cycles
	} else {
		bp.count++
		bp.cycles += cycles
	}
	unlock(&profBlockLock)
}

var mutexprofilerate uint64 // fraction sampled

// SetMutexProfileFraction controls the fraction of mutex contention events
// that are reported in the mutex profile. On average 1/rate events are
// reported. The previous rate is returned.
//
// To turn off profiling entirely, pass rate 0.
// To just read the current rate, pass rate < 0.
// (For n>1 the details of sampling may change.)
func SetMutexProfileFraction(rate int) int {
	if rate < 0 {
		return int(mutexprofilerate)
	}
	old := mutexprofilerate
	atomic.Store64(&mutexprofilerate, uint64(rate))
	return int(old)
}

//go:linkname mutexevent sync.event
func mutexevent(cycles int64, skip int) {
	if cycles < 0 {
		cycles = 0
	}
	rate := int64(atomic.Load64(&mutexprofilerate))
	if rate > 0 && cheaprand64()%rate == 0 {
		saveblockevent(cycles, rate, skip+1, mutexProfile)
	}
}

// Go interface to profile data.

// A StackRecord describes a single execution stack.
type StackRecord struct {
	Stack0 [32]uintptr // stack trace for this record; ends at first 0 entry
}

// Stack returns the stack trace associated with the record,
// a prefix of r.Stack0.
func (r *StackRecord) Stack() []uintptr {
	for i, v := range r.Stack0 {
		if v == 0 {
			return r.Stack0[0:i]
		}
	}
	return r.Stack0[0:]
}

// MemProfileRate controls the fraction of memory allocations
// that are recorded and reported in the memory profile.
// The profiler aims to sample an average of
// one allocation per MemProfileRate bytes allocated.
//
// To include every allocated block in the profile, set MemProfileRate to 1.
// To turn off profiling entirely, set MemProfileRate to 0.
//
// The tools that process the memory profiles assume that the
// profile rate is constant across the lifetime of the program
// and equal to the current value. Programs that change the
// memory profiling rate should do so just once, as early as
// possible in the execution of the program (for example,
// at the beginning of main).
var MemProfileRate int = 512 * 1024

// disableMemoryProfiling is set by the linker if memory profiling
// is not used and the link type guarantees nobody else could use it
// elsewhere.
// We check if the runtime.memProfileInternal symbol is present.
var disableMemoryProfiling bool

// A MemProfileRecord describes the live objects allocated
// by a particular call sequence (stack trace).
type MemProfileRecord struct {
	AllocBytes, FreeBytes     int64       // number of bytes allocated, freed
	AllocObjects, FreeObjects int64       // number of objects allocated, freed
	Stack0                    [32]uintptr // stack trace for this record; ends at first 0 entry
}

// InUseBytes returns the number of bytes in use (AllocBytes - FreeBytes).
func (r *MemProfileRecord) InUseBytes() int64 { return r.AllocBytes - r.FreeBytes }

// InUseObjects returns the number of objects in use (AllocObjects - FreeObjects).
func (r *MemProfileRecord) InUseObjects() int64 {
	return r.AllocObjects - r.FreeObjects
}

// Stack returns the stack trace associated with the record,
// a prefix of r.Stack0.
func (r *MemProfileRecord) Stack() []uintptr {
	for i, v := range r.Stack0 {
		if v == 0 {
			return r.Stack0[0:i]
		}
	}
	return r.Stack0[0:]
}

// MemProfile returns a profile of memory allocated and freed per allocation
// site.
//
// MemProfile returns n, the number of records in the current memory profile.
// If len(p) >= n, MemProfile copies the profile into p and returns n, true.
// If len(p) < n, MemProfile does not change p and returns n, false.
//
// If inuseZero is true, the profile includes allocation records
// where r.AllocBytes > 0 but r.AllocBytes == r.FreeBytes.
// These are sites where memory was allocated, but it has all
// been released back to the runtime.
//
// The returned profile may be up to two garbage collection cycles old.
// This is to avoid skewing the profile toward allocations; because
// allocations happen in real time but frees are delayed until the garbage
// collector performs sweeping, the profile only accounts for allocations
// that have had a chance to be freed by the garbage collector.
//
// Most clients should use the runtime/pprof package or
// the testing package's -test.memprofile flag instead
// of calling MemProfile directly.
func MemProfile(p []MemProfileRecord, inuseZero bool) (n int, ok bool) {
	return memProfileInternal(len(p), inuseZero, func(r profilerecord.MemProfileRecord) {
		copyMemProfileRecord(&p[0], r)
		p = p[1:]
	})
}

// memProfileInternal returns the number of records n in the profile. If there
// are less than size records, copyFn is invoked for each record, and ok returns
// true.
//
// The linker set disableMemoryProfiling to true to disable memory profiling
// if this function is not reachable. Mark it noinline to ensure the symbol exists.
// (This function is big and normally not inlined anyway.)
// See also disableMemoryProfiling above and cmd/link/internal/ld/lib.go:linksetup.
//
//go:noinline
func memProfileInternal(size int, inuseZero bool, copyFn func(profilerecord.MemProfileRecord)) (n int, ok bool) {
	cycle := mProfCycle.read()
	// If we're between mProf_NextCycle and mProf_Flush, take care
	// of flushing to the active profile so we only have to look
	// at the active profile below.
	index := cycle % uint32(len(memRecord{}.future))
	lock(&profMemActiveLock)
	lock(&profMemFutureLock[index])
	mProf_FlushLocked(index)
	unlock(&profMemFutureLock[index])
	clear := true
	head := (*bucket)(mbuckets.Load())
	for b := head; b != nil; b = b.allnext {
		mp := b.mp()
		if inuseZero || mp.active.alloc_bytes != mp.active.free_bytes {
			n++
		}
		if mp.active.allocs != 0 || mp.active.frees != 0 {
			clear = false
		}
	}
	if clear {
		// Absolutely no data, suggesting that a garbage collection
		// has not yet happened. In order to allow profiling when
		// garbage collection is disabled from the beginning of execution,
		// accumulate all of the cycles, and recount buckets.
		n = 0
		for b := head; b != nil; b = b.allnext {
			mp := b.mp()
			for c := range mp.future {
				lock(&profMemFutureLock[c])
				mp.active.add(&mp.future[c])
				mp.future[c] = memRecordCycle{}
				unlock(&profMemFutureLock[c])
			}
			if inuseZero || mp.active.alloc_bytes != mp.active.free_bytes {
				n++
			}
		}
	}
	if n <= size {
		ok = true
		for b := head; b != nil; b = b.allnext {
			mp := b.mp()
			if inuseZero || mp.active.alloc_bytes != mp.active.free_bytes {
				r := profilerecord.MemProfileRecord{
					AllocBytes:   int64(mp.active.alloc_bytes),
					FreeBytes:    int64(mp.active.free_bytes),
					AllocObjects: int64(mp.active.allocs),
					FreeObjects:  int64(mp.active.frees),
					Stack:        b.stk(),
				}
				copyFn(r)
			}
		}
	}
	unlock(&profMemActiveLock)
	return
}

func copyMemProfileRecord(dst *MemProfileRecord, src profilerecord.MemProfileRecord) {
	dst.AllocBytes = src.AllocBytes
	dst.FreeBytes = src.FreeBytes
	dst.AllocObjects = src.AllocObjects
	dst.FreeObjects = src.FreeObjects
	if raceenabled {
		racewriterangepc(unsafe.Pointer(&dst.Stack0[0]), unsafe.Sizeof(dst.Stack0), sys.GetCallerPC(), abi.FuncPCABIInternal(MemProfile))
	}
	if msanenabled {
		msanwrite(unsafe.Pointer(&dst.Stack0[0]), unsafe.Sizeof(dst.Stack0))
	}
	if asanenabled {
		asanwrite(unsafe.Pointer(&dst.Stack0[0]), unsafe.Sizeof(dst.Stack0))
	}
	i := copy(dst.Stack0[:], src.Stack)
	clear(dst.Stack0[i:])
}

//go:linkname pprof_memProfileInternal
func pprof_memProfileInternal(p []profilerecord.MemProfileRecord, inuseZero bool) (n int, ok bool) {
	return memProfileInternal(len(p), inuseZero, func(r profilerecord.MemProfileRecord) {
		p[0] = r
		p = p[1:]
	})
}

func iterate_memprof(fn func(*bucket, uintptr, *uintptr, uintptr, uintptr, uintptr)) {
	lock(&profMemActiveLock)
	head := (*bucket)(mbuckets.Load())
	for b := head; b != nil; b = b.allnext {
		mp := b.mp()
		fn(b, b.nstk, &b.stk()[0], b.size, mp.active.allocs, mp.active.frees)
	}
	unlock(&profMemActiveLock)
}

// BlockProfileRecord describes blocking events originated
// at a particular call sequence (stack trace).
type BlockProfileRecord struct {
	Count  int64
	Cycles int64
	StackRecord
}

// BlockProfile returns n, the number of records in the current blocking profile.
// If len(p) >= n, BlockProfile copies the profile into p and returns n, true.
// If len(p) < n, BlockProfile does not change p and returns n, false.
//
// Most clients should use the [runtime/pprof] package or
// the [testing] package's -test.blockprofile flag instead
// of calling BlockProfile directly.
func BlockProfile(p []BlockProfileRecord) (n int, ok bool) {
	var m int
	n, ok = blockProfileInternal(len(p), func(r profilerecord.BlockProfileRecord) {
		copyBlockProfileRecord(&p[m], r)
		m++
	})
	if ok {
		expandFrames(p[:n])
	}
	return
}

func expandFrames(p []BlockProfileRecord) {
	expandedStack := makeProfStack()
	for i := range p {
		cf := CallersFrames(p[i].Stack())
		j := 0
		for j < len(expandedStack) {
			f, more := cf.Next()
			// f.PC is a "call PC", but later consumers will expect
			// "return PCs"
			expandedStack[j] = f.PC + 1
			j++
			if !more {
				break
			}
		}
		k := copy(p[i].Stack0[:], expandedStack[:j])
		clear(p[i].Stack0[k:])
	}
}

// blockProfileInternal returns the number of records n in the profile. If there
// are less than size records, copyFn is invoked for each record, and ok returns
// true.
func blockProfileInternal(size int, copyFn func(profilerecord.BlockProfileRecord)) (n int, ok bool) {
	lock(&profBlockLock)
	head := (*bucket)(bbuckets.Load())
	for b := head; b != nil; b = b.allnext {
		n++
	}
	if n <= size {
		ok = true
		for b := head; b != nil; b = b.allnext {
			bp := b.bp()
			r := profilerecord.BlockProfileRecord{
				Count:  int64(bp.count),
				Cycles: bp.cycles,
				Stack:  b.stk(),
			}
			// Prevent callers from having to worry about division by zero errors.
			// See discussion on http://golang.org/cl/299991.
			if r.Count == 0 {
				r.Count = 1
			}
			copyFn(r)
		}
	}
	unlock(&profBlockLock)
	return
}

// copyBlockProfileRecord copies the sample values and call stack from src to dst.
// The call stack is copied as-is. The caller is responsible for handling inline
// expansion, needed when the call stack was collected with frame pointer unwinding.
func copyBlockProfileRecord(dst *BlockProfileRecord, src profilerecord.BlockProfileRecord) {
	dst.Count = src.Count
	dst.Cycles = src.Cycles
	if raceenabled {
		racewriterangepc(unsafe.Pointer(&dst.Stack0[0]), unsafe.Sizeof(dst.Stack0), sys.GetCallerPC(), abi.FuncPCABIInternal(BlockProfile))
	}
	if msanenabled {
		msanwrite(unsafe.Pointer(&dst.Stack0[0]), unsafe.Sizeof(dst.Stack0))
	}
	if asanenabled {
		asanwrite(unsafe.Pointer(&dst.Stack0[0]), unsafe.Sizeof(dst.Stack0))
	}
	// We just copy the stack here without inline expansion
	// (needed if frame pointer unwinding is used)
	// since this function is called under the profile lock,
	// and doing something that might allocate can violate lock ordering.
	i := copy(dst.Stack0[:], src.Stack)
	clear(dst.Stack0[i:])
}

//go:linkname pprof_blockProfileInternal
func pprof_blockProfileInternal(p []profilerecord.BlockProfileRecord) (n int, ok bool) {
	return blockProfileInternal(len(p), func(r profilerecord.BlockProfileRecord) {
		p[0] = r
		p = p[1:]
	})
}

// MutexProfile returns n, the number of records in the current mutex profile.
// If len(p) >= n, MutexProfile copies the profile into p and returns n, true.
// Otherwise, MutexProfile does not change p, and returns n, false.
//
// Most clients should use the [runtime/pprof] package
// instead of calling MutexProfile directly.
func MutexProfile(p []BlockProfileRecord) (n int, ok bool) {
	var m int
	n, ok = mutexProfileInternal(len(p), func(r profilerecord.BlockProfileRecord) {
		copyBlockProfileRecord(&p[m], r)
		m++
	})
	if ok {
		expandFrames(p[:n])
	}
	return
}

// mutexProfileInternal returns the number of records n in the profile. If there
// are less than size records, copyFn is invoked for each record, and ok returns
// true.
func mutexProfileInternal(size int, copyFn func(profilerecord.BlockProfileRecord)) (n int, ok bool) {
	lock(&profBlockLock)
	head := (*bucket)(xbuckets.Load())
	for b := head; b != nil; b = b.allnext {
		n++
	}
	if n <= size {
		ok = true
		for b := head; b != nil; b = b.allnext {
			bp := b.bp()
			r := profilerecord.BlockProfileRecord{
				Count:  int64(bp.count),
				Cycles: bp.cycles,
				Stack:  b.stk(),
			}
			copyFn(r)
		}
	}
	unlock(&profBlockLock)
	return
}

//go:linkname pprof_mutexProfileInternal
func pprof_mutexProfileInternal(p []profilerecord.BlockProfileRecord) (n int, ok bool) {
	return mutexProfileInternal(len(p), func(r profilerecord.BlockProfileRecord) {
		p[0] = r
		p = p[1:]
	})
}

// ThreadCreateProfile returns n, the number of records in the thread creation profile.
// If len(p) >= n, ThreadCreateProfile copies the profile into p and returns n, true.
// If len(p) < n, ThreadCreateProfile does not change p and returns n, false.
//
// Most clients should use the runtime/pprof package instead
// of calling ThreadCreateProfile directly.
func ThreadCreateProfile(p []StackRecord) (n int, ok bool) {
	return threadCreateProfileInternal(len(p), func(r profilerecord.StackRecord) {
		i := copy(p[0].Stack0[:], r.Stack)
		clear(p[0].Stack0[i:])
		p = p[1:]
	})
}

// threadCreateProfileInternal returns the number of records n in the profile.
// If there are less than size records, copyFn is invoked for each record, and
// ok returns true.
func threadCreateProfileInternal(size int, copyFn func(profilerecord.StackRecord)) (n int, ok bool) {
	first := (*m)(atomic.Loadp(unsafe.Pointer(&allm)))
	for mp := first; mp != nil; mp = mp.alllink {
		n++
	}
	if n <= size {
		ok = true
		for mp := first; mp != nil; mp = mp.alllink {
			r := profilerecord.StackRecord{Stack: mp.createstack[:]}
			copyFn(r)
		}
	}
	return
}

//go:linkname pprof_threadCreateInternal
func pprof_threadCreateInternal(p []profilerecord.StackRecord) (n int, ok bool) {
	return threadCreateProfileInternal(len(p), func(r profilerecord.StackRecord) {
		p[0] = r
		p = p[1:]
	})
}

//go:linkname pprof_goroutineProfileWithLabels
func pprof_goroutineProfileWithLabels(p []profilerecord.StackRecord, labels []unsafe.Pointer) (n int, ok bool) {
	return goroutineProfileWithLabels(p, labels)
}

// labels may be nil. If labels is non-nil, it must have the same length as p.
func goroutineProfileWithLabels(p []profilerecord.StackRecord, labels []unsafe.Pointer) (n int, ok bool) {
	if labels != nil && len(labels) != len(p) {
		labels = nil
	}

	return goroutineProfileWithLabelsConcurrent(p, labels)
}

var goroutineProfile = struct {
	sema    uint32
	active  bool
	offset  atomic.Int64
	records []profilerecord.StackRecord
	labels  []unsafe.Pointer
}{
	sema: 1,
}

// goroutineProfileState indicates the status of a goroutine's stack for the
// current in-progress goroutine profile. Goroutines' stacks are initially
// "Absent" from the profile, and end up "Satisfied" by the time the profile is
// complete. While a goroutine's stack is being captured, its
// goroutineProfileState will be "InProgress" and it will not be able to run
// until the capture completes and the state moves to "Satisfied".
//
// Some goroutines (the finalizer goroutine, which at various times can be
// either a "system" or a "user" goroutine, and the goroutine that is
// coordinating the profile, any goroutines created during the profile) move
// directly to the "Satisfied" state.
type goroutineProfileState uint32

const (
	goroutineProfileAbsent goroutineProfileState = iota
	goroutineProfileInProgress
	goroutineProfileSatisfied
)

type goroutineProfileStateHolder atomic.Uint32

func (p *goroutineProfileStateHolder) Load() goroutineProfileState {
	return goroutineProfileState((*atomic.Uint32)(p).Load())
}

func (p *goroutineProfileStateHolder) Store(value goroutineProfileState) {
	(*atomic.Uint32)(p).Store(uint32(value))
}

func (p *goroutineProfileStateHolder) CompareAndSwap(old, new goroutineProfileState) bool {
	return (*atomic.Uint32)(p).CompareAndSwap(uint32(old), uint32(new))
}

func goroutineProfileWithLabelsConcurrent(p []profilerecord.StackRecord, labels []unsafe.Pointer) (n int, ok bool) {
	if len(p) == 0 {
		// An empty slice is obviously too small. Return a rough
		// allocation estimate without bothering to STW. As long as
		// this is close, then we'll only need to STW once (on the next
		// call).
		return int(gcount()), false
	}

	semacquire(&goroutineProfile.sema)

	ourg := getg()

	pcbuf := makeProfStack() // see saveg() for explanation
	stw := stopTheWorld(stwGoroutineProfile)
	// Using gcount while the world is stopped should give us a consistent view
	// of the number of live goroutines, minus the number of goroutines that are
	// alive and permanently marked as "system". But to make this count agree
	// with what we'd get from isSystemGoroutine, we need special handling for
	// goroutines that can vary between user and system to ensure that the count
	// doesn't change during the collection. So, check the finalizer goroutine
	// and cleanup goroutines in particular.
	n = int(gcount())
	if fingStatus.Load()&fingRunningFinalizer != 0 {
		n++
	}
	n += int(gcCleanups.running.Load())

	if n > len(p) {
		// There's not enough space in p to store the whole profile, so (per the
		// contract of runtime.GoroutineProfile) we're not allowed to write to p
		// at all and must return n, false.
		startTheWorld(stw)
		semrelease(&goroutineProfile.sema)
		return n, false
	}

	// Save current goroutine.
	sp := sys.GetCallerSP()
	pc := sys.GetCallerPC()
	systemstack(func() {
		saveg(pc, sp, ourg, &p[0], pcbuf)
	})
	if labels != nil {
		labels[0] = ourg.labels
	}
	ourg.goroutineProfiled.Store(goroutineProfileSatisfied)
	goroutineProfile.offset.Store(1)

	// Prepare for all other goroutines to enter the profile. Aside from ourg,
	// every goroutine struct in the allgs list has its goroutineProfiled field
	// cleared. Any goroutine created from this point on (while
	// goroutineProfile.active is set) will start with its goroutineProfiled
	// field set to goroutineProfileSatisfied.
	goroutineProfile.active = true
	goroutineProfile.records = p
	goroutineProfile.labels = labels
	startTheWorld(stw)

	// Visit each goroutine that existed as of the startTheWorld call above.
	//
	// New goroutines may not be in this list, but we didn't want to know about
	// them anyway. If they do appear in this list (via reusing a dead goroutine
	// struct, or racing to launch between the world restarting and us getting
	// the list), they will already have their goroutineProfiled field set to
	// goroutineProfileSatisfied before their state transitions out of _Gdead.
	//
	// Any goroutine that the scheduler tries to execute concurrently with this
	// call will start by adding itself to the profile (before the act of
	// executing can cause any changes in its stack).
	forEachGRace(func(gp1 *g) {
		tryRecordGoroutineProfile(gp1, pcbuf, Gosched)
	})

	stw = stopTheWorld(stwGoroutineProfileCleanup)
	endOffset := goroutineProfile.offset.Swap(0)
	goroutineProfile.active = false
	goroutineProfile.records = nil
	goroutineProfile.labels = nil
	startTheWorld(stw)

	// Restore the invariant that every goroutine struct in allgs has its
	// goroutineProfiled field cleared.
	forEachGRace(func(gp1 *g) {
		gp1.goroutineProfiled.Store(goroutineProfileAbsent)
	})

	if raceenabled {
		raceacquire(unsafe.Pointer(&labelSync))
	}

	if n != int(endOffset) {
		// It's a big surprise that the number of goroutines changed while we
		// were collecting the profile. But probably better to return a
		// truncated profile than to crash the whole process.
		//
		// For instance, needm moves a goroutine out of the _Gdead state and so
		// might be able to change the goroutine count without interacting with
		// the scheduler. For code like that, the race windows are small and the
		// combination of features is uncommon, so it's hard to be (and remain)
		// sure we've caught them all.
	}

	semrelease(&goroutineProfile.sema)
	return n, true
}

// tryRecordGoroutineProfileWB asserts that write barriers are allowed and calls
// tryRecordGoroutineProfile.
//
//go:yeswritebarrierrec
func tryRecordGoroutineProfileWB(gp1 *g) {
	if getg().m.p.ptr() == nil {
		throw("no P available, write barriers are forbidden")
	}
	tryRecordGoroutineProfile(gp1, nil, osyield)
}

// tryRecordGoroutineProfile ensures that gp1 has the appropriate representation
// in the current goroutine profile: either that it should not be profiled, or
// that a snapshot of its call stack and labels are now in the profile.
func tryRecordGoroutineProfile(gp1 *g, pcbuf []uintptr, yield func()) {
	if readgstatus(gp1) == _Gdead {
		// Dead goroutines should not appear in the profile. Goroutines that
		// start while profile collection is active will get goroutineProfiled
		// set to goroutineProfileSatisfied before transitioning out of _Gdead,
		// so here we check _Gdead first.
		return
	}

	for {
		prev := gp1.goroutineProfiled.Load()
		if prev == goroutineProfileSatisfied {
			// This goroutine is already in the profile (or is new since the
			// start of collection, so shouldn't appear in the profile).
			break
		}
		if prev == goroutineProfileInProgress {
			// Something else is adding gp1 to the goroutine profile right now.
			// Give that a moment to finish.
			yield()
			continue
		}

		// While we have gp1.goroutineProfiled set to
		// goroutineProfileInProgress, gp1 may appear _Grunnable but will not
		// actually be able to run. Disable preemption for ourselves, to make
		// sure we finish profiling gp1 right away instead of leaving it stuck
		// in this limbo.
		mp := acquirem()
		if gp1.goroutineProfiled.CompareAndSwap(goroutineProfileAbsent, goroutineProfileInProgress) {
			doRecordGoroutineProfile(gp1, pcbuf)
			gp1.goroutineProfiled.Store(goroutineProfileSatisfied)
		}
		releasem(mp)
	}
}

// doRecordGoroutineProfile writes gp1's call stack and labels to an in-progress
// goroutine profile. Preemption is disabled.
//
// This may be called via tryRecordGoroutineProfile in two ways: by the
// goroutine that is coordinating the goroutine profile (running on its own
// stack), or from the scheduler in preparation to execute gp1 (running on the
// system stack).
func doRecordGoroutineProfile(gp1 *g, pcbuf []uintptr) {
	if isSystemGoroutine(gp1, false) {
		// System goroutines should not appear in the profile.
		// Check this here and not in tryRecordGoroutineProfile because isSystemGoroutine
		// may change on a goroutine while it is executing, so while the scheduler might
		// see a system goroutine, goroutineProfileWithLabelsConcurrent might not, and
		// this inconsistency could cause invariants to be violated, such as trying to
		// record the stack of a running goroutine below. In short, we still want system
		// goroutines to participate in the same state machine on gp1.goroutineProfiled as
		// everything else, we just don't record the stack in the profile.
		return
	}
	if readgstatus(gp1) == _Grunning {
		print("doRecordGoroutineProfile gp1=", gp1.goid, "\n")
		throw("cannot read stack of running goroutine")
	}

	offset := int(goroutineProfile.offset.Add(1)) - 1

	if offset >= len(goroutineProfile.records) {
		// Should be impossible, but better to return a truncated profile than
		// to crash the entire process at this point. Instead, deal with it in
		// goroutineProfileWithLabelsConcurrent where we have more context.
		return
	}

	// saveg calls gentraceback, which may call cgo traceback functions. When
	// called from the scheduler, this is on the system stack already so
	// traceback.go:cgoContextPCs will avoid calling back into the scheduler.
	//
	// When called from the goroutine coordinating the profile, we still have
	// set gp1.goroutineProfiled to goroutineProfileInProgress and so are still
	// preventing it from being truly _Grunnable. So we'll use the system stack
	// to avoid schedule delays.
	systemstack(func() { saveg(^uintptr(0), ^uintptr(0), gp1, &goroutineProfile.records[offset], pcbuf) })

	if goroutineProfile.labels != nil {
		goroutineProfile.labels[offset] = gp1.labels
	}
}

func goroutineProfileWithLabelsSync(p []profilerecord.StackRecord, labels []unsafe.Pointer) (n int, ok bool) {
	gp := getg()

	isOK := func(gp1 *g) bool {
		// Checking isSystemGoroutine here makes GoroutineProfile
		// consistent with both NumGoroutine and Stack.
		return gp1 != gp && readgstatus(gp1) != _Gdead && !isSystemGoroutine(gp1, false)
	}

	pcbuf := makeProfStack() // see saveg() for explanation
	stw := stopTheWorld(stwGoroutineProfile)

	// World is stopped, no locking required.
	n = 1
	forEachGRace(func(gp1 *g) {
		if isOK(gp1) {
			n++
		}
	})

	if n <= len(p) {
		ok = true
		r, lbl := p, labels

		// Save current goroutine.
		sp := sys.GetCallerSP()
		pc := sys.GetCallerPC()
		systemstack(func() {
			saveg(pc, sp, gp, &r[0], pcbuf)
		})
		r = r[1:]

		// If we have a place to put our goroutine labelmap, insert it there.
		if labels != nil {
			lbl[0] = gp.labels
			lbl = lbl[1:]
		}

		// Save other goroutines.
		forEachGRace(func(gp1 *g) {
			if !isOK(gp1) {
				return
			}

			if len(r) == 0 {
				// Should be impossible, but better to return a
				// truncated profile than to crash the entire process.
				return
			}
			// saveg calls gentraceback, which may call cgo traceback functions.
			// The world is stopped, so it cannot use cgocall (which will be
			// blocked at exitsyscall). Do it on the system stack so it won't
			// call into the schedular (see traceback.go:cgoContextPCs).
			systemstack(func() { saveg(^uintptr(0), ^uintptr(0), gp1, &r[0], pcbuf) })
			if labels != nil {
				lbl[0] = gp1.labels
				lbl = lbl[1:]
			}
			r = r[1:]
		})
	}

	if raceenabled {
		raceacquire(unsafe.Pointer(&labelSync))
	}

	startTheWorld(stw)
	return n, ok
}

// GoroutineProfile returns n, the number of records in the active goroutine stack profile.
// If len(p) >= n, GoroutineProfile copies the profile into p and returns n, true.
// If len(p) < n, GoroutineProfile does not change p and returns n, false.
//
// Most clients should use the [runtime/pprof] package instead
// of calling GoroutineProfile directly.
func GoroutineProfile(p []StackRecord) (n int, ok bool) {
	records := make([]profilerecord.StackRecord, len(p))
	n, ok = goroutineProfileInternal(records)
	if !ok {
		return
	}
	for i, mr := range records[0:n] {
		l := copy(p[i].Stack0[:], mr.Stack)
		clear(p[i].Stack0[l:])
	}
	return
}

func goroutineProfileInternal(p []profilerecord.StackRecord) (n int, ok bool) {
	return goroutineProfileWithLabels(p, nil)
}

func saveg(pc, sp uintptr, gp *g, r *profilerecord.StackRecord, pcbuf []uintptr) {
	// To reduce memory usage, we want to allocate a r.Stack that is just big
	// enough to hold gp's stack trace. Naively we might achieve this by
	// recording our stack trace into mp.profStack, and then allocating a
	// r.Stack of the right size. However, mp.profStack is also used for
	// allocation profiling, so it could get overwritten if the slice allocation
	// gets profiled. So instead we record the stack trace into a temporary
	// pcbuf which is usually given to us by our caller. When it's not, we have
	// to allocate one here. This will only happen for goroutines that were in a
	// syscall when the goroutine profile started or for goroutines that manage
	// to execute before we finish iterating over all the goroutines.
	if pcbuf == nil {
		pcbuf = makeProfStack()
	}

	var u unwinder
	u.initAt(pc, sp, 0, gp, unwindSilentErrors)
	n := tracebackPCs(&u, 0, pcbuf)
	r.Stack = make([]uintptr, n)
	copy(r.Stack, pcbuf)
}

// Stack formats a stack trace of the calling goroutine into buf
// and returns the number of bytes written to buf.
// If all is true, Stack formats stack traces of all other goroutines
// into buf after the trace for the current goroutine.
func Stack(buf []byte, all bool) int {
	var stw worldStop
	if all {
		stw = stopTheWorld(stwAllGoroutinesStack)
	}

	n := 0
	if len(buf) > 0 {
		gp := getg()
		sp := sys.GetCallerSP()
		pc := sys.GetCallerPC()
		systemstack(func() {
			g0 := getg()
			// Force traceback=1 to override GOTRACEBACK setting,
			// so that Stack's results are consistent.
			// GOTRACEBACK is only about crash dumps.
			g0.m.traceback = 1
			g0.writebuf = buf[0:0:len(buf)]
			goroutineheader(gp)
			traceback(pc, sp, 0, gp)
			if all {
				tracebackothers(gp)
			}
			g0.m.traceback = 0
			n = len(g0.writebuf)
			g0.writebuf = nil
		})
	}

	if all {
		startTheWorld(stw)
	}
	return n
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
16 Dec 2025 9.30 PM
root / root
0755
asan
--
16 Dec 2025 9.30 PM
root / root
0755
cgo
--
16 Dec 2025 9.30 PM
root / root
0755
coverage
--
16 Dec 2025 9.30 PM
root / root
0755
debug
--
16 Dec 2025 9.30 PM
root / root
0755
metrics
--
16 Dec 2025 9.30 PM
root / root
0755
msan
--
16 Dec 2025 9.30 PM
root / root
0755
pprof
--
16 Dec 2025 9.30 PM
root / root
0755
race
--
16 Dec 2025 9.34 PM
root / root
0755
trace
--
16 Dec 2025 9.30 PM
root / root
0755
HACKING.md
16.996 KB
4 Dec 2025 6.06 PM
root / root
0644
Makefile
0.174 KB
4 Dec 2025 6.06 PM
root / root
0644
alg.go
11.129 KB
4 Dec 2025 6.06 PM
root / root
0644
arena.go
38.046 KB
4 Dec 2025 6.06 PM
root / root
0644
asan.go
1.998 KB
4 Dec 2025 6.06 PM
root / root
0644
asan0.go
0.989 KB
4 Dec 2025 6.06 PM
root / root
0644
asan_amd64.s
3.342 KB
4 Dec 2025 6.06 PM
root / root
0644
asan_arm64.s
3.04 KB
4 Dec 2025 6.06 PM
root / root
0644
asan_loong64.s
3.013 KB
4 Dec 2025 6.06 PM
root / root
0644
asan_ppc64le.s
3.625 KB
4 Dec 2025 6.06 PM
root / root
0644
asan_riscv64.s
2.789 KB
4 Dec 2025 6.06 PM
root / root
0644
asm.s
0.377 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_386.s
42.975 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_amd64.h
0.616 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_amd64.s
60.331 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_arm.s
31.931 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_arm64.s
44.624 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_loong64.s
34.597 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_mips64x.s
24.202 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_mipsx.s
26.186 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_ppc64x.h
1.933 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_ppc64x.s
45.254 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_riscv64.h
0.522 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_riscv64.s
27.11 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_s390x.s
27.919 KB
4 Dec 2025 6.06 PM
root / root
0644
asm_wasm.s
13.101 KB
4 Dec 2025 6.06 PM
root / root
0644
atomic_arm64.s
0.253 KB
4 Dec 2025 6.06 PM
root / root
0644
atomic_loong64.s
0.267 KB
4 Dec 2025 6.06 PM
root / root
0644
atomic_mips64x.s
0.293 KB
4 Dec 2025 6.06 PM
root / root
0644
atomic_mipsx.s
0.256 KB
4 Dec 2025 6.06 PM
root / root
0644
atomic_pointer.go
3.979 KB
4 Dec 2025 6.06 PM
root / root
0644
atomic_ppc64x.s
0.427 KB
4 Dec 2025 6.06 PM
root / root
0644
atomic_riscv64.s
0.269 KB
4 Dec 2025 6.06 PM
root / root
0644
auxv_none.go
0.291 KB
4 Dec 2025 6.06 PM
root / root
0644
badlinkname.go
0.646 KB
4 Dec 2025 6.06 PM
root / root
0644
badlinkname_linux.go
0.494 KB
4 Dec 2025 6.06 PM
root / root
0644
cgo.go
3.613 KB
4 Dec 2025 6.06 PM
root / root
0644
cgo_mmap.go
2.423 KB
4 Dec 2025 6.06 PM
root / root
0644
cgo_ppc64x.go
0.408 KB
4 Dec 2025 6.06 PM
root / root
0644
cgo_sigaction.go
3.273 KB
4 Dec 2025 6.06 PM
root / root
0644
cgocall.go
25.173 KB
4 Dec 2025 6.06 PM
root / root
0644
cgocallback.go
0.31 KB
4 Dec 2025 6.06 PM
root / root
0644
cgocheck.go
5.46 KB
4 Dec 2025 6.06 PM
root / root
0644
cgroup_linux.go
3.582 KB
4 Dec 2025 6.06 PM
root / root
0644
cgroup_stubs.go
0.591 KB
4 Dec 2025 6.06 PM
root / root
0644
chan.go
26.842 KB
4 Dec 2025 6.06 PM
root / root
0644
checkptr.go
3.574 KB
4 Dec 2025 6.06 PM
root / root
0644
compiler.go
0.4 KB
4 Dec 2025 6.06 PM
root / root
0644
complex.go
1.591 KB
4 Dec 2025 6.06 PM
root / root
0644
coro.go
8.315 KB
4 Dec 2025 6.06 PM
root / root
0644
covercounter.go
0.723 KB
4 Dec 2025 6.06 PM
root / root
0644
covermeta.go
0.589 KB
4 Dec 2025 6.06 PM
root / root
0644
cpuflags.go
0.999 KB
4 Dec 2025 6.06 PM
root / root
0644
cpuflags_amd64.go
1.092 KB
4 Dec 2025 6.06 PM
root / root
0644
cpuflags_arm64.go
0.305 KB
4 Dec 2025 6.06 PM
root / root
0644
cpuprof.go
8.523 KB
4 Dec 2025 6.06 PM
root / root
0644
cputicks.go
0.427 KB
4 Dec 2025 6.06 PM
root / root
0644
create_file_nounix.go
0.298 KB
4 Dec 2025 6.06 PM
root / root
0644
create_file_unix.go
0.359 KB
4 Dec 2025 6.06 PM
root / root
0644
debug.go
8.235 KB
4 Dec 2025 6.06 PM
root / root
0644
debugcall.go
7.132 KB
4 Dec 2025 6.06 PM
root / root
0644
debuglog.go
20.045 KB
4 Dec 2025 6.06 PM
root / root
0644
debuglog_off.go
0.432 KB
4 Dec 2025 6.06 PM
root / root
0644
debuglog_on.go
1.441 KB
4 Dec 2025 6.06 PM
root / root
0644
defs1_linux.go
0.825 KB
4 Dec 2025 6.06 PM
root / root
0644
defs1_netbsd_386.go
2.999 KB
4 Dec 2025 6.06 PM
root / root
0644
defs1_netbsd_amd64.go
3.229 KB
4 Dec 2025 6.06 PM
root / root
0644
defs1_netbsd_arm.go
3.116 KB
4 Dec 2025 6.06 PM
root / root
0644
defs1_netbsd_arm64.go
3.341 KB
4 Dec 2025 6.06 PM
root / root
0644
defs1_solaris_amd64.go
4.014 KB
4 Dec 2025 6.06 PM
root / root
0644
defs2_linux.go
3.218 KB
4 Dec 2025 6.06 PM
root / root
0644
defs3_linux.go
1.092 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_aix.go
4.175 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_aix_ppc64.go
3.625 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_arm_linux.go
2.67 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_darwin.go
4.297 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_darwin_amd64.go
6.434 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_darwin_arm64.go
4.257 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_dragonfly.go
2.851 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_dragonfly_amd64.go
3.499 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_freebsd.go
4.075 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_freebsd_386.go
4.614 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_freebsd_amd64.go
4.883 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_freebsd_arm.go
4.005 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_freebsd_arm64.go
4.269 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_freebsd_riscv64.go
4.279 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_illumos_amd64.go
0.278 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux.go
2.922 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_386.go
4.195 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_amd64.go
4.703 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_arm.go
3.888 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_arm64.go
3.62 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_loong64.go
3.451 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_mips64x.go
3.601 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_mipsx.go
3.602 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_ppc64.go
3.688 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_ppc64le.go
3.688 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_riscv64.go
3.814 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_linux_s390x.go
3.162 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_netbsd.go
2.947 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_netbsd_386.go
0.835 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_netbsd_amd64.go
1.012 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_netbsd_arm.go
0.746 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_openbsd.go
3.058 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_openbsd_386.go
2.911 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_openbsd_amd64.go
3.111 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_openbsd_arm.go
3.026 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_openbsd_arm64.go
2.778 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_openbsd_mips64.go
2.755 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_openbsd_ppc64.go
3.001 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_openbsd_riscv64.go
2.891 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_plan9_386.go
1.627 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_plan9_amd64.go
1.816 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_plan9_arm.go
1.73 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_solaris.go
3.319 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_solaris_amd64.go
0.98 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_windows.go
2.534 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_windows_386.go
2.491 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_windows_amd64.go
3.394 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_windows_arm.go
2.956 KB
4 Dec 2025 6.06 PM
root / root
0644
defs_windows_arm64.go
3.455 KB
4 Dec 2025 6.06 PM
root / root
0644
duff_386.s
8.236 KB
4 Dec 2025 6.06 PM
root / root
0644
duff_amd64.s
5.637 KB
4 Dec 2025 6.06 PM
root / root
0644
duff_arm.s
7.111 KB
4 Dec 2025 6.06 PM
root / root
0644
duff_arm64.s
5.273 KB
4 Dec 2025 6.06 PM
root / root
0644
duff_loong64.s
11.902 KB
4 Dec 2025 6.06 PM
root / root
0644
duff_mips64x.s
11.282 KB
4 Dec 2025 6.06 PM
root / root
0644
duff_ppc64x.s
7.056 KB
4 Dec 2025 6.06 PM
root / root
0644
duff_riscv64.s
11.402 KB
4 Dec 2025 6.06 PM
root / root
0644
duff_s390x.s
0.495 KB
4 Dec 2025 6.06 PM
root / root
0644
env_plan9.go
3.019 KB
4 Dec 2025 6.06 PM
root / root
0644
env_posix.go
2.131 KB
4 Dec 2025 6.06 PM
root / root
0644
error.go
10.387 KB
4 Dec 2025 6.06 PM
root / root
0644
extern.go
19.966 KB
4 Dec 2025 6.06 PM
root / root
0644
fastlog2.go
1.22 KB
4 Dec 2025 6.06 PM
root / root
0644
fastlog2table.go
0.883 KB
4 Dec 2025 6.06 PM
root / root
0644
fds_nonunix.go
0.25 KB
4 Dec 2025 6.06 PM
root / root
0644
fds_unix.go
1.27 KB
4 Dec 2025 6.06 PM
root / root
0644
fedora.go
0.242 KB
4 Dec 2025 6.06 PM
root / root
0644
float.go
2.922 KB
4 Dec 2025 6.06 PM
root / root
0644
funcdata.h
2.526 KB
4 Dec 2025 6.06 PM
root / root
0644
go_tls.h
0.357 KB
4 Dec 2025 6.06 PM
root / root
0644
hash32.go
1.584 KB
4 Dec 2025 6.06 PM
root / root
0644
hash64.go
1.894 KB
4 Dec 2025 6.06 PM
root / root
0644
heapdump.go
17.623 KB
4 Dec 2025 6.06 PM
root / root
0644
histogram.go
7.297 KB
4 Dec 2025 6.06 PM
root / root
0644
iface.go
21.337 KB
4 Dec 2025 6.06 PM
root / root
0644
ints.s
9.863 KB
4 Dec 2025 6.06 PM
root / root
0644
lfstack.go
1.686 KB
4 Dec 2025 6.06 PM
root / root
0644
libfuzzer.go
6.342 KB
4 Dec 2025 6.06 PM
root / root
0644
libfuzzer_amd64.s
5.026 KB
4 Dec 2025 6.06 PM
root / root
0644
libfuzzer_arm64.s
3.152 KB
4 Dec 2025 6.06 PM
root / root
0644
libfuzzer_loong64.s
3.24 KB
4 Dec 2025 6.06 PM
root / root
0644
linkname.go
0.786 KB
4 Dec 2025 6.06 PM
root / root
0644
linkname_swiss.go
6.674 KB
4 Dec 2025 6.06 PM
root / root
0644
linkname_unix.go
0.26 KB
4 Dec 2025 6.06 PM
root / root
0644
lock_futex.go
3.077 KB
4 Dec 2025 6.06 PM
root / root
0644
lock_js.go
7.078 KB
4 Dec 2025 6.06 PM
root / root
0644
lock_sema.go
4.146 KB
4 Dec 2025 6.06 PM
root / root
0644
lock_spinbit.go
14.618 KB
4 Dec 2025 6.06 PM
root / root
0644
lock_wasip1.go
2.063 KB
4 Dec 2025 6.06 PM
root / root
0644
lockrank.go
24.401 KB
4 Dec 2025 6.06 PM
root / root
0644
lockrank_off.go
1.299 KB
4 Dec 2025 6.06 PM
root / root
0644
lockrank_on.go
10.562 KB
4 Dec 2025 6.06 PM
root / root
0644
malloc.go
71.77 KB
4 Dec 2025 6.06 PM
root / root
0644
map_fast32_noswiss.go
13.967 KB
4 Dec 2025 6.06 PM
root / root
0644
map_fast32_swiss.go
1.712 KB
4 Dec 2025 6.06 PM
root / root
0644
map_fast64_noswiss.go
14.181 KB
4 Dec 2025 6.06 PM
root / root
0644
map_fast64_swiss.go
1.745 KB
4 Dec 2025 6.06 PM
root / root
0644
map_faststr_noswiss.go
15.409 KB
4 Dec 2025 6.06 PM
root / root
0644
map_faststr_swiss.go
1.327 KB
4 Dec 2025 6.06 PM
root / root
0644
map_noswiss.go
57.593 KB
4 Dec 2025 6.06 PM
root / root
0644
map_swiss.go
10.174 KB
4 Dec 2025 6.06 PM
root / root
0644
mbarrier.go
15.26 KB
4 Dec 2025 6.06 PM
root / root
0644
mbitmap.go
61.238 KB
4 Dec 2025 6.06 PM
root / root
0644
mcache.go
10.449 KB
4 Dec 2025 6.06 PM
root / root
0644
mcentral.go
7.837 KB
4 Dec 2025 6.06 PM
root / root
0644
mcheckmark.go
9.268 KB
4 Dec 2025 6.06 PM
root / root
0644
mcleanup.go
23.188 KB
4 Dec 2025 6.06 PM
root / root
0644
mem.go
7.337 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_aix.go
2.038 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_bsd.go
2.244 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_darwin.go
1.987 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_js.go
0.446 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_linux.go
5.222 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_nonsbrk.go
0.344 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_plan9.go
0.437 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_sbrk.go
6.113 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_wasip1.go
0.383 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_wasm.go
0.57 KB
4 Dec 2025 6.06 PM
root / root
0644
mem_windows.go
3.905 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_386.s
2.381 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_amd64.s
4.906 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_arm.s
2.604 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_arm64.s
3.684 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_loong64.s
6.951 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_mips64x.s
1.722 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_mipsx.s
1.324 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_plan9_386.s
0.96 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_plan9_amd64.s
0.499 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_ppc64x.s
4.438 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_riscv64.s
1.705 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_s390x.s
3.558 KB
4 Dec 2025 6.06 PM
root / root
0644
memclr_wasm.s
0.474 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_386.s
4.419 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_amd64.s
12.874 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_arm.s
5.897 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_arm64.s
5.955 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_loong64.s
11.653 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_mips64x.s
1.826 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_mipsx.s
4.396 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_plan9_386.s
3.063 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_plan9_amd64.s
3.041 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_ppc64x.s
4.858 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_riscv64.s
5.461 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_s390x.s
2.918 KB
4 Dec 2025 6.06 PM
root / root
0644
memmove_wasm.s
0.468 KB
4 Dec 2025 6.06 PM
root / root
0644
metrics.go
25.988 KB
4 Dec 2025 6.06 PM
root / root
0644
mfinal.go
19.779 KB
4 Dec 2025 6.06 PM
root / root
0644
mfixalloc.go
3.127 KB
4 Dec 2025 6.06 PM
root / root
0644
mgc.go
64.943 KB
4 Dec 2025 6.06 PM
root / root
0644
mgclimit.go
17.241 KB
4 Dec 2025 6.06 PM
root / root
0644
mgcmark.go
55.107 KB
4 Dec 2025 6.06 PM
root / root
0644
mgcmark_greenteagc.go
27.73 KB
4 Dec 2025 6.06 PM
root / root
0644
mgcmark_nogreenteagc.go
2.204 KB
4 Dec 2025 6.06 PM
root / root
0644
mgcpacer.go
56.521 KB
4 Dec 2025 6.06 PM
root / root
0644
mgcscavenge.go
52.258 KB
4 Dec 2025 6.06 PM
root / root
0644
mgcstack.go
10.585 KB
4 Dec 2025 6.06 PM
root / root
0644
mgcsweep.go
32.938 KB
4 Dec 2025 6.06 PM
root / root
0644
mgcwork.go
14.936 KB
4 Dec 2025 6.06 PM
root / root
0644
mheap.go
97.843 KB
4 Dec 2025 6.06 PM
root / root
0644
minmax.go
1.458 KB
4 Dec 2025 6.06 PM
root / root
0644
mkduff.go
8.029 KB
4 Dec 2025 6.06 PM
root / root
0644
mkfastlog2table.go
3.075 KB
4 Dec 2025 6.06 PM
root / root
0644
mklockrank.go
9.474 KB
4 Dec 2025 6.06 PM
root / root
0644
mkpreempt.go
14.839 KB
4 Dec 2025 6.06 PM
root / root
0644
mmap.go
0.824 KB
4 Dec 2025 6.06 PM
root / root
0644
mpagealloc.go
39.259 KB
4 Dec 2025 6.06 PM
root / root
0644
mpagealloc_32bit.go
4.609 KB
4 Dec 2025 6.06 PM
root / root
0644
mpagealloc_64bit.go
9.406 KB
4 Dec 2025 6.06 PM
root / root
0644
mpagecache.go
5.593 KB
4 Dec 2025 6.06 PM
root / root
0644
mpallocbits.go
12.526 KB
4 Dec 2025 6.06 PM
root / root
0644
mprof.go
54.017 KB
4 Dec 2025 6.06 PM
root / root
0644
mranges.go
14.455 KB
4 Dec 2025 6.06 PM
root / root
0644
msan.go
1.622 KB
4 Dec 2025 6.06 PM
root / root
0644
msan0.go
0.708 KB
4 Dec 2025 6.06 PM
root / root
0644
msan_amd64.s
2.415 KB
4 Dec 2025 6.06 PM
root / root
0644
msan_arm64.s
2.091 KB
4 Dec 2025 6.06 PM
root / root
0644
msan_loong64.s
2.066 KB
4 Dec 2025 6.06 PM
root / root
0644
msize.go
1.351 KB
4 Dec 2025 6.06 PM
root / root
0644
mspanset.go
13.307 KB
4 Dec 2025 6.06 PM
root / root
0644
mstats.go
33.924 KB
4 Dec 2025 6.06 PM
root / root
0644
mwbbuf.go
8.184 KB
4 Dec 2025 6.06 PM
root / root
0644
nbpipe_pipe.go
0.396 KB
4 Dec 2025 6.06 PM
root / root
0644
nbpipe_pipe2.go
0.336 KB
4 Dec 2025 6.06 PM
root / root
0644
net_plan9.go
0.63 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll.go
20.81 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_aix.go
5.166 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_epoll.go
4.697 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_fake.go
0.648 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_kqueue.go
4.691 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_kqueue_event.go
1.778 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_kqueue_pipe.go
2.143 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_solaris.go
11.311 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_stub.go
1.579 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_wasip1.go
6.004 KB
4 Dec 2025 6.06 PM
root / root
0644
netpoll_windows.go
9.491 KB
4 Dec 2025 6.06 PM
root / root
0644
nonwindows_stub.go
0.939 KB
4 Dec 2025 6.06 PM
root / root
0644
note_js.go
1.343 KB
4 Dec 2025 6.06 PM
root / root
0644
note_other.go
1.191 KB
4 Dec 2025 6.06 PM
root / root
0644
os2_aix.go
20.961 KB
4 Dec 2025 6.06 PM
root / root
0644
os2_freebsd.go
0.295 KB
4 Dec 2025 6.06 PM
root / root
0644
os2_openbsd.go
0.289 KB
4 Dec 2025 6.06 PM
root / root
0644
os2_plan9.go
1.481 KB
4 Dec 2025 6.06 PM
root / root
0644
os2_solaris.go
0.313 KB
4 Dec 2025 6.06 PM
root / root
0644
os3_plan9.go
3.977 KB
4 Dec 2025 6.06 PM
root / root
0644
os3_solaris.go
17.703 KB
4 Dec 2025 6.06 PM
root / root
0644
os_aix.go
9.052 KB
4 Dec 2025 6.06 PM
root / root
0644
os_android.go
0.452 KB
4 Dec 2025 6.06 PM
root / root
0644
os_darwin.go
11.864 KB
4 Dec 2025 6.06 PM
root / root
0644
os_darwin_arm64.go
0.321 KB
4 Dec 2025 6.06 PM
root / root
0644
os_dragonfly.go
7.312 KB
4 Dec 2025 6.06 PM
root / root
0644
os_freebsd.go
11.729 KB
4 Dec 2025 6.06 PM
root / root
0644
os_freebsd2.go
0.589 KB
4 Dec 2025 6.06 PM
root / root
0644
os_freebsd_amd64.go
0.643 KB
4 Dec 2025 6.06 PM
root / root
0644
os_freebsd_arm.go
1.466 KB
4 Dec 2025 6.06 PM
root / root
0644
os_freebsd_arm64.go
0.313 KB
4 Dec 2025 6.06 PM
root / root
0644
os_freebsd_noauxv.go
0.235 KB
4 Dec 2025 6.06 PM
root / root
0644
os_freebsd_riscv64.go
0.193 KB
4 Dec 2025 6.06 PM
root / root
0644
os_illumos.go
3.931 KB
4 Dec 2025 6.06 PM
root / root
0644
os_js.go
0.749 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux.go
27.048 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_arm.go
1.506 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_arm64.go
0.467 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_be64.go
0.787 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_generic.go
0.85 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_loong64.go
0.337 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_mips64x.go
0.973 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_mipsx.go
0.964 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_noauxv.go
0.329 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_novdso.go
0.339 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_ppc64x.go
0.514 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_riscv64.go
1.362 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_s390x.go
0.806 KB
4 Dec 2025 6.06 PM
root / root
0644
os_linux_x86.go
0.229 KB
4 Dec 2025 6.06 PM
root / root
0644
os_netbsd.go
10.232 KB
4 Dec 2025 6.06 PM
root / root
0644
os_netbsd_386.go
0.603 KB
4 Dec 2025 6.06 PM
root / root
0644
os_netbsd_amd64.go
0.6 KB
4 Dec 2025 6.06 PM
root / root
0644
os_netbsd_arm.go
1.094 KB
4 Dec 2025 6.06 PM
root / root
0644
os_netbsd_arm64.go
0.751 KB
4 Dec 2025 6.06 PM
root / root
0644
os_nonopenbsd.go
0.427 KB
4 Dec 2025 6.06 PM
root / root
0644
os_only_solaris.go
0.353 KB
4 Dec 2025 6.06 PM
root / root
0644
os_openbsd.go
6.447 KB
4 Dec 2025 6.06 PM
root / root
0644
os_openbsd_arm.go
0.667 KB
4 Dec 2025 6.06 PM
root / root
0644
os_openbsd_arm64.go
0.321 KB
4 Dec 2025 6.06 PM
root / root
0644
os_openbsd_libc.go
1.488 KB
4 Dec 2025 6.06 PM
root / root
0644
os_openbsd_mips64.go
0.321 KB
4 Dec 2025 6.06 PM
root / root
0644
os_openbsd_syscall.go
1.359 KB
4 Dec 2025 6.06 PM
root / root
0644
os_openbsd_syscall1.go
0.431 KB
4 Dec 2025 6.06 PM
root / root
0644
os_openbsd_syscall2.go
2.511 KB
4 Dec 2025 6.06 PM
root / root
0644
os_plan9.go
11.943 KB
4 Dec 2025 6.06 PM
root / root
0644
os_plan9_arm.go
0.366 KB
4 Dec 2025 6.06 PM
root / root
0644
os_solaris.go
6.707 KB
4 Dec 2025 6.06 PM
root / root
0644
os_unix.go
0.426 KB
4 Dec 2025 6.06 PM
root / root
0644
os_unix_nonlinux.go
0.505 KB
4 Dec 2025 6.06 PM
root / root
0644
os_wasip1.go
6.88 KB
4 Dec 2025 6.06 PM
root / root
0644
os_wasm.go
3.314 KB
4 Dec 2025 6.06 PM
root / root
0644
os_windows.go
40.658 KB
4 Dec 2025 6.06 PM
root / root
0644
os_windows_arm.go
0.499 KB
4 Dec 2025 6.06 PM
root / root
0644
os_windows_arm64.go
0.331 KB
4 Dec 2025 6.06 PM
root / root
0644
panic.go
45.134 KB
4 Dec 2025 6.06 PM
root / root
0644
panic32.go
4.895 KB
4 Dec 2025 6.06 PM
root / root
0644
pinner.go
10.994 KB
4 Dec 2025 6.06 PM
root / root
0644
plugin.go
4.394 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt.go
15.458 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_386.s
0.805 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_amd64.s
1.541 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_arm.s
1.487 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_arm64.s
1.967 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_loong64.s
2.411 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_mips64x.s
2.716 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_mipsx.s
2.681 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_nonwindows.go
0.283 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_ppc64x.s
2.716 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_riscv64.s
2.258 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_s390x.s
1.009 KB
4 Dec 2025 6.06 PM
root / root
0644
preempt_wasm.s
0.172 KB
4 Dec 2025 6.06 PM
root / root
0644
print.go
5.921 KB
4 Dec 2025 6.06 PM
root / root
0644
proc.go
220.345 KB
4 Dec 2025 6.06 PM
root / root
0644
profbuf.go
18.203 KB
4 Dec 2025 6.06 PM
root / root
0644
proflabel.go
2.059 KB
4 Dec 2025 6.06 PM
root / root
0644
race.go
22.501 KB
4 Dec 2025 6.06 PM
root / root
0644
race0.go
2.894 KB
4 Dec 2025 6.06 PM
root / root
0644
race_amd64.s
15.17 KB
4 Dec 2025 6.06 PM
root / root
0644
race_arm64.s
15.554 KB
4 Dec 2025 6.06 PM
root / root
0644
race_loong64.s
15.241 KB
4 Dec 2025 6.06 PM
root / root
0644
race_ppc64le.s
17.035 KB
4 Dec 2025 6.06 PM
root / root
0644
race_s390x.s
13.131 KB
4 Dec 2025 6.06 PM
root / root
0644
rand.go
8.788 KB
4 Dec 2025 6.06 PM
root / root
0644
rdebug.go
0.537 KB
4 Dec 2025 6.06 PM
root / root
0644
retry.go
0.742 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_aix_ppc64.s
5.056 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_android_386.s
0.803 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_android_amd64.s
0.736 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_android_arm.s
0.823 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_android_arm64.s
0.919 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_darwin_amd64.s
0.39 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_darwin_arm64.s
1.688 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_dragonfly_amd64.s
0.438 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_freebsd_386.s
0.443 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_freebsd_amd64.s
0.432 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_freebsd_arm.s
0.291 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_freebsd_arm64.s
1.879 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_freebsd_riscv64.s
2.721 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_illumos_amd64.s
0.304 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_ios_amd64.s
0.415 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_ios_arm64.s
0.415 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_js_wasm.s
1.431 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_386.s
0.439 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_amd64.s
0.3 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_arm.s
0.983 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_arm64.s
1.809 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_loong64.s
2.009 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_mips64x.s
0.99 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_mipsx.s
0.778 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_ppc64.s
0.827 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_ppc64le.s
2.887 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_riscv64.s
2.648 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_linux_s390x.s
0.66 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_netbsd_386.s
0.441 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_netbsd_amd64.s
0.302 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_netbsd_arm.s
0.289 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_netbsd_arm64.s
1.803 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_openbsd_386.s
0.443 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_openbsd_amd64.s
0.304 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_openbsd_arm.s
0.291 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_openbsd_arm64.s
1.961 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_openbsd_mips64.s
0.953 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_openbsd_ppc64.s
0.361 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_openbsd_riscv64.s
0.363 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_plan9_386.s
0.511 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_plan9_amd64.s
0.47 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_plan9_arm.s
0.388 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_solaris_amd64.s
0.304 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_wasip1_wasm.s
0.453 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_windows_386.s
1.28 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_windows_amd64.s
1.139 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_windows_arm.s
0.377 KB
4 Dec 2025 6.06 PM
root / root
0644
rt0_windows_arm64.s
0.716 KB
4 Dec 2025 6.06 PM
root / root
0644
runtime-gdb.py
18.864 KB
4 Dec 2025 6.06 PM
root / root
0644
runtime.go
9.768 KB
4 Dec 2025 6.06 PM
root / root
0644
runtime1.go
20.791 KB
4 Dec 2025 6.06 PM
root / root
0644
runtime2.go
50.123 KB
4 Dec 2025 6.06 PM
root / root
0644
runtime_boring.go
0.447 KB
4 Dec 2025 6.06 PM
root / root
0644
rwmutex.go
4.984 KB
4 Dec 2025 6.06 PM
root / root
0644
security_aix.go
0.438 KB
4 Dec 2025 6.06 PM
root / root
0644
security_issetugid.go
0.49 KB
4 Dec 2025 6.06 PM
root / root
0644
security_linux.go
0.327 KB
4 Dec 2025 6.06 PM
root / root
0644
security_nonunix.go
0.25 KB
4 Dec 2025 6.06 PM
root / root
0644
security_unix.go
0.846 KB
4 Dec 2025 6.06 PM
root / root
0644
select.go
15.398 KB
4 Dec 2025 6.06 PM
root / root
0644
sema.go
20.174 KB
4 Dec 2025 6.06 PM
root / root
0644
set_vma_name_linux.go
0.936 KB
4 Dec 2025 6.06 PM
root / root
0644
set_vma_name_stub.go
0.355 KB
4 Dec 2025 6.06 PM
root / root
0644
sigaction.go
0.489 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_386.go
1.718 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_aix_ppc64.go
3.545 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_amd64.go
2.726 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_arm.go
2.543 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_arm64.go
3.828 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_darwin.go
2.128 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_darwin_amd64.go
4.004 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_darwin_arm64.go
3.598 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_dragonfly.go
2.171 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_dragonfly_amd64.go
2.015 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_freebsd.go
2.202 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_freebsd_386.go
1.551 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_freebsd_amd64.go
2.03 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_freebsd_arm.go
2.179 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_freebsd_arm64.go
3.237 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_freebsd_riscv64.go
3.075 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_386.go
1.592 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_amd64.go
2.051 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_arm.go
2.123 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_arm64.go
2.945 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_loong64.go
3.216 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_mips64x.go
3.35 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_mipsx.go
3.667 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_ppc64x.go
3.501 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_riscv64.go
2.921 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_linux_s390x.go
4.485 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_loong64.go
3.072 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_mips64x.go
3.181 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_mipsx.go
3.06 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_netbsd.go
2.181 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_netbsd_386.go
1.757 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_netbsd_amd64.go
2.325 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_netbsd_arm.go
2.301 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_netbsd_arm64.go
3.404 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_openbsd.go
2.18 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_openbsd_386.go
1.585 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_openbsd_amd64.go
2.036 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_openbsd_arm.go
2.117 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_openbsd_arm64.go
3.391 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_openbsd_mips64.go
3.282 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_openbsd_ppc64.go
3.53 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_openbsd_riscv64.go
3.12 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_plan9.go
1.934 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_ppc64x.go
3.708 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_riscv64.go
2.91 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_solaris.go
4.501 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_solaris_amd64.go
2.466 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_unix.go
45.658 KB
4 Dec 2025 6.06 PM
root / root
0644
signal_windows.go
14.353 KB
4 Dec 2025 6.06 PM
root / root
0644
sigqueue.go
7.618 KB
4 Dec 2025 6.06 PM
root / root
0644
sigqueue_note.go
0.633 KB
4 Dec 2025 6.06 PM
root / root
0644
sigqueue_plan9.go
3.254 KB
4 Dec 2025 6.06 PM
root / root
0644
sigtab_aix.go
11.304 KB
4 Dec 2025 6.06 PM
root / root
0644
sigtab_linux_generic.go
3.518 KB
4 Dec 2025 6.06 PM
root / root
0644
sigtab_linux_mipsx.go
5.953 KB
4 Dec 2025 6.06 PM
root / root
0644
slice.go
12.204 KB
4 Dec 2025 6.06 PM
root / root
0644
softfloat64.go
11.536 KB
4 Dec 2025 6.06 PM
root / root
0644
stack.go
42.74 KB
4 Dec 2025 6.06 PM
root / root
0644
stkframe.go
9.771 KB
4 Dec 2025 6.06 PM
root / root
0644
string.go
13.166 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs.go
18.087 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs2.go
1.146 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs3.go
0.316 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_386.go
0.691 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_amd64.go
1.384 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_arm.go
0.673 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_arm64.go
0.684 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_linux.go
0.635 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_loong64.go
0.623 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_mips64x.go
0.51 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_mipsx.go
0.431 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_nonlinux.go
0.291 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_nonwasm.go
0.271 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_ppc64.go
0.295 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_ppc64x.go
0.672 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_riscv64.go
0.679 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_s390x.go
0.404 KB
4 Dec 2025 6.06 PM
root / root
0644
stubs_wasm.go
0.691 KB
4 Dec 2025 6.06 PM
root / root
0644
symtab.go
40.96 KB
4 Dec 2025 6.06 PM
root / root
0644
symtabinl.go
4.526 KB
4 Dec 2025 6.06 PM
root / root
0644
synctest.go
12.779 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_aix_ppc64.s
7.42 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_arm.go
0.509 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_arm64.go
0.458 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_darwin.go
24.438 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_darwin_amd64.s
19.855 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_darwin_arm64.go
1.738 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_darwin_arm64.s
18.422 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_dragonfly_amd64.s
8.31 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_freebsd_386.s
9.409 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_freebsd_amd64.s
12.675 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_freebsd_arm.s
10.378 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_freebsd_arm64.s
9.493 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_freebsd_riscv64.s
8.918 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_libc.go
1.878 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_386.s
17.89 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_amd64.s
16.357 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_arm.s
13.502 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_arm64.s
17.529 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_loong64.s
16.812 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_mips64x.s
11.965 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_mipsx.s
9.69 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_ppc64x.s
18.909 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_riscv64.s
10.523 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux_s390x.s
13.451 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_loong64.go
0.478 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_mips64x.go
0.488 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_mipsx.go
0.484 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_netbsd_386.s
9.608 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_netbsd_amd64.s
9.782 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_netbsd_arm.s
10.576 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_netbsd_arm64.s
9.469 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_nonppc64x.go
0.239 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd.go
2.593 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd1.go
1.229 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd2.go
8.671 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd3.go
4.069 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd_386.s
20.4 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd_amd64.s
15.539 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd_arm.s
18.461 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd_arm64.s
15.053 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd_mips64.s
8.807 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd_ppc64.s
15.297 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_openbsd_riscv64.s
16.802 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_plan9_386.s
4.335 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_plan9_amd64.s
4.732 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_plan9_arm.s
6.798 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_ppc64x.go
0.52 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_riscv64.go
0.458 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_s390x.go
0.458 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_solaris_amd64.s
6.418 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_wasm.go
1.127 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_wasm.s
1.521 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_windows_386.s
6.457 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_windows_amd64.s
8.418 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_windows_arm.s
7.744 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_windows_arm64.s
6.797 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_x86.go
0.539 KB
4 Dec 2025 6.06 PM
root / root
0644
syscall2_solaris.go
1.85 KB
4 Dec 2025 6.06 PM
root / root
0644
syscall_aix.go
6.332 KB
4 Dec 2025 6.06 PM
root / root
0644
syscall_solaris.go
8.383 KB
4 Dec 2025 6.06 PM
root / root
0644
syscall_windows.go
16.67 KB
4 Dec 2025 6.06 PM
root / root
0644
tagptr.go
0.891 KB
4 Dec 2025 6.06 PM
root / root
0644
tagptr_32bit.go
0.964 KB
4 Dec 2025 6.06 PM
root / root
0644
tagptr_64bit.go
3.127 KB
4 Dec 2025 6.06 PM
root / root
0644
test_amd64.go
0.191 KB
4 Dec 2025 6.06 PM
root / root
0644
test_amd64.s
0.309 KB
4 Dec 2025 6.06 PM
root / root
0644
test_stubs.go
0.213 KB
4 Dec 2025 6.06 PM
root / root
0644
textflag.h
1.466 KB
4 Dec 2025 6.06 PM
root / root
0644
time.go
43.854 KB
4 Dec 2025 6.06 PM
root / root
0644
time_fake.go
2.521 KB
4 Dec 2025 6.06 PM
root / root
0644
time_linux_amd64.s
2.019 KB
4 Dec 2025 6.06 PM
root / root
0644
time_nofake.go
1.568 KB
4 Dec 2025 6.06 PM
root / root
0644
time_plan9.go
0.629 KB
4 Dec 2025 6.06 PM
root / root
0644
time_windows.h
0.735 KB
4 Dec 2025 6.06 PM
root / root
0644
time_windows_386.s
1.707 KB
4 Dec 2025 6.06 PM
root / root
0644
time_windows_amd64.s
0.768 KB
4 Dec 2025 6.06 PM
root / root
0644
time_windows_arm.s
1.974 KB
4 Dec 2025 6.06 PM
root / root
0644
time_windows_arm64.s
0.885 KB
4 Dec 2025 6.06 PM
root / root
0644
timeasm.go
0.408 KB
4 Dec 2025 6.06 PM
root / root
0644
timestub.go
0.878 KB
4 Dec 2025 6.06 PM
root / root
0644
timestub2.go
0.364 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_arm.s
3.451 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_arm64.h
1.098 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_arm64.s
1.199 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_loong64.s
0.575 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_mips64x.s
0.716 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_mipsx.s
0.693 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_ppc64x.s
1.523 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_riscv64.s
0.601 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_s390x.s
1.546 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_stub.go
0.254 KB
4 Dec 2025 6.06 PM
root / root
0644
tls_windows_amd64.go
0.287 KB
4 Dec 2025 6.06 PM
root / root
0644
trace.go
38.343 KB
4 Dec 2025 6.06 PM
root / root
0644
traceallocfree.go
5.998 KB
4 Dec 2025 6.06 PM
root / root
0644
traceback.go
56.618 KB
4 Dec 2025 6.06 PM
root / root
0644
tracebuf.go
10.405 KB
4 Dec 2025 6.06 PM
root / root
0644
tracecpu.go
8.79 KB
4 Dec 2025 6.06 PM
root / root
0644
traceevent.go
3.685 KB
4 Dec 2025 6.06 PM
root / root
0644
tracemap.go
4.529 KB
4 Dec 2025 6.06 PM
root / root
0644
traceregion.go
3.402 KB
4 Dec 2025 6.06 PM
root / root
0644
traceruntime.go
25.478 KB
4 Dec 2025 6.06 PM
root / root
0644
tracestack.go
11.361 KB
4 Dec 2025 6.06 PM
root / root
0644
tracestatus.go
6.927 KB
4 Dec 2025 6.06 PM
root / root
0644
tracestring.go
2.438 KB
4 Dec 2025 6.06 PM
root / root
0644
tracetime.go
3.829 KB
4 Dec 2025 6.06 PM
root / root
0644
tracetype.go
2.279 KB
4 Dec 2025 6.06 PM
root / root
0644
type.go
17.42 KB
4 Dec 2025 6.06 PM
root / root
0644
typekind.go
0.348 KB
4 Dec 2025 6.06 PM
root / root
0644
unsafe.go
3.17 KB
4 Dec 2025 6.06 PM
root / root
0644
utf8.go
3.386 KB
4 Dec 2025 6.06 PM
root / root
0644
valgrind.go
5.013 KB
4 Dec 2025 6.06 PM
root / root
0644
valgrind0.go
1.116 KB
4 Dec 2025 6.06 PM
root / root
0644
valgrind_amd64.s
1.266 KB
4 Dec 2025 6.06 PM
root / root
0644
valgrind_arm64.s
0.763 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_elf32.go
2.761 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_elf64.go
2.836 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_freebsd.go
2.443 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_freebsd_arm.go
0.443 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_freebsd_arm64.go
0.443 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_freebsd_riscv64.go
0.419 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_freebsd_x86.go
1.856 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_in_none.go
0.433 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux.go
7.786 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux_386.go
0.653 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux_amd64.go
0.888 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux_arm.go
0.653 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux_arm64.go
0.712 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux_loong64.go
0.824 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux_mips64x.go
0.83 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux_ppc64x.go
0.709 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux_riscv64.go
0.65 KB
4 Dec 2025 6.06 PM
root / root
0644
vdso_linux_s390x.go
0.696 KB
4 Dec 2025 6.06 PM
root / root
0644
vgetrandom_linux.go
3.825 KB
4 Dec 2025 6.06 PM
root / root
0644
vgetrandom_unsupported.go
0.45 KB
4 Dec 2025 6.06 PM
root / root
0644
vlop_386.s
2.018 KB
4 Dec 2025 6.06 PM
root / root
0644
vlop_arm.s
7.063 KB
4 Dec 2025 6.06 PM
root / root
0644
vlrt.go
6.712 KB
4 Dec 2025 6.06 PM
root / root
0644
wincallback.go
3.454 KB
4 Dec 2025 6.06 PM
root / root
0644
write_err.go
0.289 KB
4 Dec 2025 6.06 PM
root / root
0644
write_err_android.go
4.59 KB
4 Dec 2025 6.06 PM
root / root
0644
zcallback_windows.go
0.151 KB
4 Dec 2025 6.06 PM
root / root
0644
zcallback_windows.s
63.057 KB
4 Dec 2025 6.06 PM
root / root
0644
zcallback_windows_arm.s
89.323 KB
4 Dec 2025 6.06 PM
root / root
0644
zcallback_windows_arm64.s
89.323 KB
4 Dec 2025 6.06 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF