MCPcopy Create free account
hub / github.com/facebook/time / ReadFBClockDataV1

Function ReadFBClockDataV1

fbclock/shmem.go:202–215  ·  view source on GitHub ↗

ReadFBClockDataV1 will read Data from mmaped fbclock shared memory. Used in tests only

(shmp unsafe.Pointer)

Source from the content-addressed store, hash-verified

200
201// ReadFBClockDataV1 will read Data from mmaped fbclock shared memory. Used in tests only
202func ReadFBClockDataV1(shmp unsafe.Pointer) (*Data, error) {
203 cData := &C.fbclock_clockdata{}
204 shmpData := (*C.fbclock_shmdata)(shmp)
205 // fbclock_clockdata_load_data comes from fbclock.c
206 res := C.fbclock_clockdata_load_data(shmpData, cData)
207 if res != 0 {
208 return nil, fmt.Errorf("failed to store data: %s", strerror(res))
209 }
210 return &Data{
211 IngressTimeNS: int64(cData.ingress_time_ns),
212 ErrorBoundNS: uint64(cData.error_bound_ns),
213 HoldoverMultiplierNS: Uint32AsFloat(uint32(cData.holdover_multiplier_ns)),
214 }, nil
215}
216
217// MmapShmpDataV2 mmaps open file as fbclock shared memory. Used in tests only.
218func MmapShmpDataV2(fd uintptr) (unsafe.Pointer, error) {

Callers 1

TestDaemonDoWorkFunction · 0.92

Calls 2

strerrorFunction · 0.85
Uint32AsFloatFunction · 0.85

Tested by 1

TestDaemonDoWorkFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…