| 244 | } |
| 245 | |
| 246 | func applyPausedState(paused bool) { |
| 247 | recordingPaused.Store(paused) |
| 248 | // Global manager: the buffering manager in single-app mode. |
| 249 | if mgr := syncMock.Get(); mgr != nil { |
| 250 | mgr.SetMemoryPressure(paused) |
| 251 | } |
| 252 | // Fan out to registered managers (multi-app: one per app). The global |
| 253 | // trigger stays global; only the action reaches every live buffer. |
| 254 | pressureHookMu.RLock() |
| 255 | hooks := make([]func(paused bool), 0, len(pressureHooks)) |
| 256 | for _, fn := range pressureHooks { |
| 257 | hooks = append(hooks, fn) |
| 258 | } |
| 259 | pressureHookMu.RUnlock() |
| 260 | for _, fn := range hooks { |
| 261 | fn(paused) |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | // readMemoryCurrent reads the raw cgroup memory.current value (total bytes |
| 266 | // including page cache). Callers that need the working-set should use |