MCPcopy
hub / github.com/google/gvisor / GetUserCounters

Method GetUserCounters

pkg/sentry/kernel/kernel.go:2300–2311  ·  view source on GitHub ↗

GetUserCounters returns the user counters for the given KUID.

(uid auth.KUID)

Source from the content-addressed store, hash-verified

2298
2299// GetUserCounters returns the user counters for the given KUID.
2300func (k *Kernel) GetUserCounters(uid auth.KUID) *UserCounters {
2301 k.userCountersMapMu.Lock()
2302 defer k.userCountersMapMu.Unlock()
2303
2304 if uc, ok := k.userCountersMap[uid]; ok {
2305 return uc
2306 }
2307
2308 uc := &UserCounters{}
2309 k.userCountersMap[uid] = uc
2310 return uc
2311}
2312
2313// AddDevGofer initializes the dev gofer connection and starts tracking it.
2314// It takes ownership of goferFD.

Callers 3

CreateProcessMethod · 0.95
CreateTaskFunction · 0.80
CloneMethod · 0.80

Calls 2

LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected