start/stop logs by code... is it possible ?

Rob Shearman robertshearman at gmail.com
Wed Jul 2 17:04:49 CDT 2008


2008/7/1 Massimo Del Fedele <max at veneto.com>:
> I'd like to start some trace log entering a function and stopping it at
> exit, to isolate just the part I need. Is it possible to add some code
> inside the function body that do it ?
>
> I mean...
>
> void aWineFunction(...)
> {
>   .......
>   STARTLOG
>   .......
>   .......
>   STOPLOG
>
>   .......
>
> }
>
> The purpose is to isolate traces from code called by a single function.

Try these untested macros:

#define STARTLOG(dbch) ((_wine_dbch_##dbch).flags |= (1 << __WINE_DBCL_TRA
CE))
#define STOPLOG(dbch) ((_wine_dbch_##dbch).flags &= ~(1 << __WINE_DBCL_TRA
CE))

And then use them like this:
void aWineFunction(...)
{
  .......
  STARTLOG(relay)
  .......
  .......
  STOPLOG(relay)

  .......
}


-- 
Rob Shearman



More information about the wine-devel mailing list