You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix MySQL profiling issues: double delays, thundering herd, stale counters, and custom sync API
Address four issues reported when profiling MySQL after the LIEF/macOS port:
1a. Guard progress-point delay check with __APPLE__. On Linux, delays are
already applied in the SIGPROF handler; calling add_delays() again at
every COZ_PROGRESS hit caused double application and TPS collapse.
1b. Remove per-experiment local_delay sync block added in the macOS port.
Forcing all threads to the same baseline caused a thundering herd of
nanosleep calls under high concurrency. The existing cool-off period
between experiments already naturally syncs threads via add_delays().
4. Call process_samples() (not just add_delays()) in catch_up() and
post_block() on Linux. Samples accumulate in per-thread perf_event
buffers between 10ms timer signals; processing them ensures delay
counters are current before unblocking other threads (BCOZ fix).
3. Add COZ_PRE_BLOCK, COZ_CATCH_UP, COZ_POST_BLOCK(skip_delays) macros
and corresponding _coz_pre_block/_coz_post_block exports for programs
using custom synchronization not intercepted by Coz (e.g., MySQL
mutexes, RocksDB internal locks).
2. Add linear regression slope and R-squared columns to `coz plot --text`
output to help users assess result reliability and optimization impact.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments