i#6938 sched migrate: Add lock contention stats #6968
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds lock contention counters for mutex_dbg_owned::lock() in non-NDEBUG builds.
While it's not there for release builds, the results in non-release should still be
indicative of general lock behavior.
When I just changed the mutex_dbg_owned header, the relese build static drmemtrace
tests (e.g., the burst_* ones) were all failing with floating point exceptions. It
turns out it's due to different compilation units having different values for NDEBUG.
I tried to make them all the same: but we have some files that contain
#undef NDEBUG
and other complexities. So I split the mutex_dbg_owned implementation into a
.cpp file and have the mutex wrapper extra fields always present.
Prints the stats for sched_lock_ with the other scheduler stats.
Sample results on schedule_stats on a threadsig trace show a lot of contention even with only 3 cores:
Issue: #6938