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.
Max
2008/7/1 Massimo Del Fedele max@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 ha scritto:
2008/7/1 Massimo Del Fedele max@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)
....... }
Thanx for the answer ! What I'm interested for is a trace, not a relay... can it work for traces too ? which would be the syntax then ?
Max
On Thursday 03 July 2008 01:36:43 Massimo Del Fedele wrote:
Rob Shearman ha scritto:
2008/7/1 Massimo Del Fedele max@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)
....... }
Thanx for the answer ! What I'm interested for is a trace, not a relay... can it work for traces too ? which would be the syntax then ?
STARTLOG() turns on a debug channel, in this case the relay debug channel. Simply replace the relay with whichever debug channel you're interested in.
Kai
Am Donnerstag, den 03.07.2008, 01:36 +0200 schrieb Massimo Del Fedele:
Try these untested macros:
#define STARTLOG(dbch) ((_wine_dbch_##dbch).flags |= (1 << __WINE_DBCL_TRACE)) #define STOPLOG(dbch) ((_wine_dbch_##dbch).flags &= ~(1 << __WINE_DBCL_TRACE))
And then use them like this: void aWineFunction(...) { ....... STARTLOG(relay) ....... ....... STOPLOG(relay)
....... }
Thanx for the answer ! What I'm interested for is a trace, not a relay... can it work for traces too ? which would be the syntax then ?
The contents of this mail are also untestet, so beware.
It probably will work even better. You just have to put the channel name (without quotes, so not as string) as argument to the STARTLOG and STOPLOG macros. It does not work with relay, because the thunks that print relay info are built at dll load time, and I don't expect the TRACE_ON(relay) information to be tested on each function call. If during DLL load TRACE_ON(relay) is true, this DLL will (during the whole process lifetime) generate relay info and if TRACE_ON(relay) was of at that time, no relay-printing thunks are built and it is pointless to turn it on later.
Regards, Michael Karcher
Thank to all that answered to my questions ! I'll test it on nexd days.
Best Regards
Max
Michael Karcher ha scritto:
Am Donnerstag, den 03.07.2008, 01:36 +0200 schrieb Massimo Del Fedele:
Try these untested macros:
#define STARTLOG(dbch) ((_wine_dbch_##dbch).flags |= (1 << __WINE_DBCL_TRACE)) #define STOPLOG(dbch) ((_wine_dbch_##dbch).flags &= ~(1 << __WINE_DBCL_TRACE))
And then use them like this: void aWineFunction(...) { ....... STARTLOG(relay) ....... ....... STOPLOG(relay)
....... }
Thanx for the answer ! What I'm interested for is a trace, not a relay... can it work for traces too ? which would be the syntax then ?
The contents of this mail are also untestet, so beware.
It probably will work even better. You just have to put the channel name (without quotes, so not as string) as argument to the STARTLOG and STOPLOG macros. It does not work with relay, because the thunks that print relay info are built at dll load time, and I don't expect the TRACE_ON(relay) information to be tested on each function call. If during DLL load TRACE_ON(relay) is true, this DLL will (during the whole process lifetime) generate relay info and if TRACE_ON(relay) was of at that time, no relay-printing thunks are built and it is pointless to turn it on later.
Regards, Michael Karcher