http://bugs.winehq.org/show_bug.cgi?id=16325
--- Comment #18 from Dan Kegel dank@kegel.com 2008-12-07 09:45:10 --- "how do we record the caller of an api within that api? Does argv[0] work in this case?"
Nope. You have to use winedbg, set a breakpoint on it, and get a backtrace.
"where does TRACE info go?"
To stderr, but only if you set the WINEDEBUG environment variable to something like +font. Look for the WINE_DEFAULT_DEBUG_CHANNEL statement at the top of the source file you're interested in. See http://winehq.org/site/docs/wineusr-guide/x542#AEN544