mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
QemuMutex: support --enable-debug-mutex
We have had some tracing tools for mutex but it's not easy to use them for e.g. dead locks. Let's provide "--enable-debug-mutex" parameter when configure to allow QemuMutex to store the last owner that took specific lock. It will be easy to use this tool to debug deadlocks since we can directly know who took the lock then as long as we can have a debugger attached to the process. Reviewed-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180425025459.5258-4-peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
f1aff7aa8e
commit
ba59fb778e
4 changed files with 30 additions and 0 deletions
|
@ -5,6 +5,10 @@
|
|||
|
||||
struct QemuMutex {
|
||||
SRWLOCK lock;
|
||||
#ifdef CONFIG_DEBUG_MUTEX
|
||||
const char *file;
|
||||
int line;
|
||||
#endif
|
||||
bool initialized;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue