Kernel: Fix LOCK_DEBUG tracking to work again, move it to use AK::SourceLocation #6601
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.
There are a hand full of changes here, all around improving the
LOCK_DEBUG
facilities / API.Kernel: Fix LOCK_DEBUG feature to work again
UBSAN detected cases where we were calling current_thread->holding_lock
but current_thread was nullptr.
Fix Lock::force_unlock_if_locked to not pass the correct ref delta to
holding_lock(..).
Kernel: Add lock_count to procfs$all when LOCK_DEBUG is enabled.
AK: Add default constructor to SourceLocation
Kernel: Utilize AK::SourceLocation for LOCK_DEBUG instrumentation.
The previous
LOCKER(..)
instrumentation only covered some of thecases where a lock is actually acquired. By utilizing the new
AK::SourceLocation
functionality we can now reliably instrumentall calls to lock automatically.
Other changes:
Tweak the message in
Thread::finalize()
which dumps leaked lockso it's more readable and includes the function information that is
now available.
Make the
LOCKER(..)
define a no-op, it will be cleaned up in afollow up change.
Kernel: Remove the now defunct
RESTORE_LOCK(..)
macro.Kernel: Remove the now defunct
LOCKER(..)
macro.