-
Notifications
You must be signed in to change notification settings - Fork 867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core] Added devel support mutex DB #1676
base: master
Are you sure you want to change the base?
Conversation
CMakeLists.txt
Outdated
if (ENABLE_MUTEX_DB) | ||
add_definitions(-DENABLE_MUTEX_DB=1) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better to follow the SRT_DEBUG_*
path? Like SRT_DEBUG_TSBPD_DRIFT
.
SRT_DEBUG_MUTEXDB
All these changes are independent and should each go in a separate commit to be able to perform backtracking in the future in case of issues. |
First and third change is strictly interconnected. A version that contains only one of these changes would be deadlocking. |
Codecov Report
@@ Coverage Diff @@
## master #1676 +/- ##
==========================================
+ Coverage 60.40% 60.61% +0.21%
==========================================
Files 78 78
Lines 17440 17455 +15
==========================================
+ Hits 10535 10581 +46
+ Misses 6905 6874 -31
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #1676 +/- ##
==========================================
- Coverage 61.45% 60.92% -0.53%
==========================================
Files 80 80
Lines 17579 17591 +12
==========================================
- Hits 10803 10718 -85
- Misses 6776 6873 +97
Continue to review full report at Codecov.
|
|
The mutex DB is added that traces every lock and unlock in a stack info form. It adds as an interface two functions:
display_mutex_db()
causes printing the mutex names in the order of locking that are currently applied, one per line, to stdout. This function is intended to be called from under the debugger.show_mutex_db()
returns a single-line string with the list of currently locked mutexes. It's intended to be used in the logs, if needed.