Hi all,
I created a hack to debug a specific critical section with WINE_DEBUG_SPINLOCK environment. It was useful for me because it found a very weird deadlock, a thread would terminate before releasing its critical section. It will also change the timeout to 1 second so you will get a faster response on potential latency issues.
How to use it?
First you need the exact spinlock name.
for example in parser.c:
pParser->csFilter.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ParserImpl.csFilter");
Of course you still need to know what __FILE__ is, this is usually parser.c but I'm not 100% sure that is the same for out of tree builds.
So just to be sure: $ strings parser.o |grep csFilter parser.c: ParserImpl.csFilter
export WINE_DEBUG_SPINLOCK="parser.c: ParserImpl.csFilter"
It will then print a ++ for every time a lock is entered, and -- for every time lock is left., I would recommend mixing this with WINEDEBUG=+tid so you can also see the threads they are in.
Comments?
Cheers, Maarten.