From: David Kahurani k.kahurani@gmail.com
Based on libvkd3d.
Signed-off-by: David Kahurani k.kahurani@gmail.com Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- include/wine/debug.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+)
diff --git a/include/wine/debug.h b/include/wine/debug.h index 58f92754164..9e96f217d91 100644 --- a/include/wine/debug.h +++ b/include/wine/debug.h @@ -85,6 +85,15 @@ struct __wine_debug_channel const enum __wine_debug_class __dbcl = __WINE_DBCL##dbcl; \ __WINE_DBG_LOG
+#define __WINE_DPRINTF_ONCE(dbcl1,dbcl2,dbch) \ + do { if(__WINE_GET_DEBUGGING(dbcl1,(dbch))) { \ + static int __wine_dbg_next_time;\ + struct __wine_debug_channel * const __dbch = (dbch); \ + const enum __wine_debug_class __dbcl = \ + __wine_dbg_next_time ? __WINE_DBCL##dbcl2 : __WINE_DBCL##dbcl1; \ + __wine_dbg_next_time = 1; \ + __WINE_DBG_LOG + #define __WINE_DBG_LOG(args...) \ wine_dbg_log( __dbcl, __dbch, __FUNCTION__, args); } } while(0)
@@ -104,6 +113,7 @@ struct __wine_debug_channel #define WINE_WARN(args...) do { } while(0) #define WINE_WARN_(ch) WINE_WARN #define WINE_FIXME(args...) do { } while(0) +#define WINE_FIXME_ONCE(args...) do { } while(0) #define WINE_FIXME_(ch) WINE_FIXME #endif
@@ -115,6 +125,15 @@ struct __wine_debug_channel const enum __WINE_DEBUG_CLASS __dbcl = __WINE_DBCL##dbcl; \ __WINE_DBG_LOG
+#define __WINE_DPRINTF_ONCE(dbcl1,dbcl2,dbch) \ + do { if(__WINE_GET_DEBUGGING(dbcl1,(dbch))) { \ + static int __wine_dbg_next_time;\ + struct __wine_debug_channel * const __dbch = (dbch); \ + const enum __WINE_DEBUG_CLASS __dbcl = \ + __wine_dbg_next_time ? __WINE_DBCL##dbcl2 : __WINE_DBCL##dbcl1; \ + __wine_dbg_next_time = 1; \ + __WINE_DBG_LOG + #define __WINE_DBG_LOG(...) \ wine_dbg_log( __dbcl, __dbch, __func__, __VA_ARGS__); } } while(0)
@@ -129,16 +148,36 @@ struct __wine_debug_channel #define WINE_WARN(...) do { } while(0) #define WINE_WARN_(ch) WINE_WARN #define WINE_FIXME(...) do { } while(0) +#define WINE_FIXME_ONCE(...) do { } while(0) #define WINE_FIXME_(ch) WINE_FIXME #endif
#else /* !__GNUC__ && !__SUNPRO_C */
+#define __WINE_DPRINTF_ONCE(dbcl1,dbcl2,dbch) \ + do { \ + static BOOL __wine_next_time_level;\ + const enum __wine_debug_class __dbcl = \ + __wine_next_time_level ? __WINE_DBCL##dbcl2 : __WINE_DBCL##dbcl1;\ + (!__WINE_GET_DEBUGGING(dbcl1,(dbch)) || \ + (wine_dbg_log(__dbcl,(dbch),__FILE__,"%d: ",__LINE__) == -1)) ? \ + (void)0 : (void)wine_dbg_printf \ + __wine_next_time_level = TRUE; } while (0) + #define __WINE_DPRINTF(dbcl,dbch) \ (!__WINE_GET_DEBUGGING(dbcl,(dbch)) || \ (wine_dbg_log(__WINE_DBCL##dbcl,(dbch),__FILE__,"%d: ",__LINE__) == -1)) ? \ (void)0 : (void)wine_dbg_printf
+#define __WINE_DPRINTF_ONCE(dbcl1,dbcl2,dbch) \ + do { if(__WINE_GET_DEBUGGING(dbcl1,(dbch))) { \ + static int __wine_dbg_next_time;\ + struct __wine_debug_channel * const __dbch = (dbch); \ + const enum __WINE_DEBUG_CLASS __dbcl = \ + __wine_dbg_next_time ? __WINE_DBCL##dbcl2 : __WINE_DBCL##dbcl1; \ + __wine_dbg_next_time = 1; \ + wine_dbg_log( __dbcl, __dbch, __func__, __VA_ARGS__); } } while(0) + #define __WINE_PRINTF_ATTR(fmt, args)
#endif /* !__GNUC__ && !__SUNPRO_C */ @@ -487,6 +526,7 @@ static inline const char *wine_dbgstr_variant( const VARIANT *v )
#ifndef WINE_FIXME #define WINE_FIXME __WINE_DPRINTF(_FIXME,__wine_dbch___default) +#define WINE_FIXME_ONCE __WINE_DPRINTF_ONCE(_FIXME,_WARN,__wine_dbch___default) #define WINE_FIXME_(ch) __WINE_DPRINTF(_FIXME,&__wine_dbch_##ch) #endif #define WINE_FIXME_ON(ch) __WINE_IS_DEBUG_ON(_FIXME,&__wine_dbch_##ch) @@ -526,6 +566,7 @@ static inline const char *debugstr_variant( const VARIANT *v ) { return wine_dbg #define WARN_ON(ch) WINE_WARN_ON(ch)
#define FIXME WINE_FIXME +#define FIXME_ONCE WINE_FIXME_ONCE #define FIXME_(ch) WINE_FIXME_(ch) #define FIXME_ON(ch) WINE_FIXME_ON(ch)
From: David Kahurani k.kahurani@gmail.com
Signed-off-by: David Kahurani k.kahurani@gmail.com Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/ntdll/unix/system.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 4052d28f644..cf456386cb3 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -2576,7 +2576,6 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, case SystemPerformanceInformation: /* 2 */ { SYSTEM_PERFORMANCE_INFORMATION spi; - static BOOL fixme_written = FALSE;
get_performance_info( &spi ); len = sizeof(spi); @@ -2586,10 +2585,9 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, else memcpy( info, &spi, len); } else ret = STATUS_INFO_LENGTH_MISMATCH; - if(!fixme_written) { - FIXME("info_class SYSTEM_PERFORMANCE_INFORMATION\n"); - fixme_written = TRUE; - } + + FIXME_ONCE("info_class SYSTEM_PERFORMANCE_INFORMATION\n"); + break; }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=109843
Your paranoid android.
=== debian11 (32 bit Chinese:China report) ===
ntdll: change.c:241: Test failed: should be ready change.c:247: Test failed: action wrong change.c:277: Test failed: should be ready change.c:280: Test failed: info not set change.c:293: Test failed: status set too soon change.c:294: Test failed: info set too soon
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/dxgi/adapter.c | 4 +--- dlls/dxgi/factory.c | 7 +------ dlls/dxgi/output.c | 7 +------ 3 files changed, 3 insertions(+), 15 deletions(-)
diff --git a/dlls/dxgi/adapter.c b/dlls/dxgi/adapter.c index 644f7e889ec..fabcb51312e 100644 --- a/dlls/dxgi/adapter.c +++ b/dlls/dxgi/adapter.c @@ -293,14 +293,12 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_QueryVideoMemoryInfo(IWineDXGIAdap { struct dxgi_adapter *adapter = impl_from_IWineDXGIAdapter(iface); struct wined3d_adapter_identifier adapter_id; - static unsigned int once; HRESULT hr;
TRACE("iface %p, node_index %u, segment_group %#x, info %p.\n", iface, node_index, segment_group, info);
- if (!once++) - FIXME("Returning fake video memory info.\n"); + FIXME_ONCE("Returning fake video memory info.\n");
if (node_index) FIXME("Ignoring node index %u.\n", node_index); diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index 97f71bc8fc1..25dab548198 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -250,12 +250,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSoftwareAdapter(IWineDXGIFac
static BOOL STDMETHODCALLTYPE dxgi_factory_IsCurrent(IWineDXGIFactory *iface) { - static BOOL once = FALSE; - - if (!once++) - FIXME("iface %p stub!\n", iface); - else - WARN("iface %p stub!\n", iface); + FIXME_ONCE("iface %p stub!\n", iface);
return TRUE; } diff --git a/dlls/dxgi/output.c b/dlls/dxgi/output.c index 585f5ae5b82..71ce90c9f0b 100644 --- a/dlls/dxgi/output.c +++ b/dlls/dxgi/output.c @@ -363,12 +363,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_FindClosestMatchingMode(IDXGIOutput
static HRESULT STDMETHODCALLTYPE dxgi_output_WaitForVBlank(IDXGIOutput6 *iface) { - static BOOL once = FALSE; - - if (!once++) - FIXME("iface %p stub!\n", iface); - else - TRACE("iface %p stub!\n", iface); + FIXME_ONCE("iface %p stub!\n", iface);
return E_NOTIMPL; }
Some applications print this very frequently.
Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/dxgi/swapchain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c index 98b020217e4..23de81dcc14 100644 --- a/dlls/dxgi/swapchain.c +++ b/dlls/dxgi/swapchain.c @@ -656,7 +656,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_swapchain_GetFullscreenDesc(IDXGISwapChai wined3d_swapchain_get_desc(swapchain->wined3d_swapchain, &wined3d_desc); wined3d_mutex_unlock();
- FIXME("Ignoring ScanlineOrdering and Scaling.\n"); + FIXME_ONCE("Ignoring ScanlineOrdering and Scaling.\n");
desc->RefreshRate.Numerator = wined3d_desc.refresh_rate; desc->RefreshRate.Denominator = 1;
Zebediah Figura zfigura@codeweavers.com writes:
+#define __WINE_DPRINTF_ONCE(dbcl1,dbcl2,dbch) \
- do { \
- static BOOL __wine_next_time_level;\
- const enum __wine_debug_class __dbcl = \
- __wine_next_time_level ? __WINE_DBCL##dbcl2 : __WINE_DBCL##dbcl1;\
- (!__WINE_GET_DEBUGGING(dbcl1,(dbch)) || \
(wine_dbg_log(__dbcl,(dbch),__FILE__,"%d: ",__LINE__) == -1)) ? \
(void)0 : (void)wine_dbg_printf \
__wine_next_time_level = TRUE; } while (0)
As already mentioned, this cannot possibly work.
On 3/5/22 02:40, Alexandre Julliard wrote:
Zebediah Figura zfigura@codeweavers.com writes:
+#define __WINE_DPRINTF_ONCE(dbcl1,dbcl2,dbch) \
- do { \
- static BOOL __wine_next_time_level;\
- const enum __wine_debug_class __dbcl = \
- __wine_next_time_level ? __WINE_DBCL##dbcl2 : __WINE_DBCL##dbcl1;\
- (!__WINE_GET_DEBUGGING(dbcl1,(dbch)) || \
(wine_dbg_log(__dbcl,(dbch),__FILE__,"%d: ",__LINE__) == -1)) ? \
(void)0 : (void)wine_dbg_printf \
__wine_next_time_level = TRUE; } while (0)
As already mentioned, this cannot possibly work.
Sorry, that was a copy-paste error. I'm not sure where it was already mentioned, though?
Zebediah Figura zfigura@codeweavers.com writes:
On 3/5/22 02:40, Alexandre Julliard wrote:
Zebediah Figura zfigura@codeweavers.com writes:
+#define __WINE_DPRINTF_ONCE(dbcl1,dbcl2,dbch) \
- do { \
- static BOOL __wine_next_time_level;\
- const enum __wine_debug_class __dbcl = \
- __wine_next_time_level ? __WINE_DBCL##dbcl2 : __WINE_DBCL##dbcl1;\
- (!__WINE_GET_DEBUGGING(dbcl1,(dbch)) || \
(wine_dbg_log(__dbcl,(dbch),__FILE__,"%d: ",__LINE__) == -1)) ? \
(void)0 : (void)wine_dbg_printf \
__wine_next_time_level = TRUE; } while (0)
As already mentioned, this cannot possibly work.
Sorry, that was a copy-paste error. I'm not sure where it was already mentioned, though?
When the patch was originally submitted. It looks like it hasn't changed since then.
On 3/7/22 11:28, Alexandre Julliard wrote:
Zebediah Figura zfigura@codeweavers.com writes:
On 3/5/22 02:40, Alexandre Julliard wrote:
Zebediah Figura zfigura@codeweavers.com writes:
+#define __WINE_DPRINTF_ONCE(dbcl1,dbcl2,dbch) \
- do { \
- static BOOL __wine_next_time_level;\
- const enum __wine_debug_class __dbcl = \
- __wine_next_time_level ? __WINE_DBCL##dbcl2 : __WINE_DBCL##dbcl1;\
- (!__WINE_GET_DEBUGGING(dbcl1,(dbch)) || \
(wine_dbg_log(__dbcl,(dbch),__FILE__,"%d: ",__LINE__) == -1)) ? \
(void)0 : (void)wine_dbg_printf \
__wine_next_time_level = TRUE; } while (0)
As already mentioned, this cannot possibly work.
Sorry, that was a copy-paste error. I'm not sure where it was already mentioned, though?
When the patch was originally submitted. It looks like it hasn't changed since then.
Sorry, I managed to look for replies twice and still didn't see it.
I'll send a new version with that hunk removed.
On 3/7/22 18:49, Zebediah Figura wrote:
On 3/7/22 11:28, Alexandre Julliard wrote:
Zebediah Figura zfigura@codeweavers.com writes:
On 3/5/22 02:40, Alexandre Julliard wrote:
Zebediah Figura zfigura@codeweavers.com writes:
+#define __WINE_DPRINTF_ONCE(dbcl1,dbcl2,dbch) \ + do { \ + static BOOL __wine_next_time_level;\ + const enum __wine_debug_class __dbcl = \ + __wine_next_time_level ? __WINE_DBCL##dbcl2 : __WINE_DBCL##dbcl1;\ + (!__WINE_GET_DEBUGGING(dbcl1,(dbch)) || \ + (wine_dbg_log(__dbcl,(dbch),__FILE__,"%d: ",__LINE__) == -1)) ? \ + (void)0 : (void)wine_dbg_printf \ + __wine_next_time_level = TRUE; } while (0)
As already mentioned, this cannot possibly work.
Sorry, that was a copy-paste error. I'm not sure where it was already mentioned, though?
When the patch was originally submitted. It looks like it hasn't changed since then.
Sorry, I managed to look for replies twice and still didn't see it.
I'll send a new version with that hunk removed.
I'm not sure to see how falling back to WARN after the first FIXME is really useful.
Often I've found warn+all useful to find some potential issues, and imho this will simply make it way more verbose as soon as one of these frequently called functions are involved, and thus less useful.
As there's already a fixme message being printed once, I think the message has served its purpose, especially as it's supposed to really print something *once*.
On 3/7/22 13:03, Rémi Bernon wrote:
On 3/7/22 18:49, Zebediah Figura wrote:
On 3/7/22 11:28, Alexandre Julliard wrote:
Zebediah Figura zfigura@codeweavers.com writes:
On 3/5/22 02:40, Alexandre Julliard wrote:
Zebediah Figura zfigura@codeweavers.com writes:
+#define __WINE_DPRINTF_ONCE(dbcl1,dbcl2,dbch) \ + do { \ + static BOOL __wine_next_time_level;\ + const enum __wine_debug_class __dbcl = \ + __wine_next_time_level ? __WINE_DBCL##dbcl2 : __WINE_DBCL##dbcl1;\ + (!__WINE_GET_DEBUGGING(dbcl1,(dbch)) || \ + (wine_dbg_log(__dbcl,(dbch),__FILE__,"%d: ",__LINE__) == -1)) ? \ + (void)0 : (void)wine_dbg_printf \ + __wine_next_time_level = TRUE; } while (0)
As already mentioned, this cannot possibly work.
Sorry, that was a copy-paste error. I'm not sure where it was already mentioned, though?
When the patch was originally submitted. It looks like it hasn't changed since then.
Sorry, I managed to look for replies twice and still didn't see it.
I'll send a new version with that hunk removed.
I'm not sure to see how falling back to WARN after the first FIXME is really useful.
Often I've found warn+all useful to find some potential issues, and imho this will simply make it way more verbose as soon as one of these frequently called functions are involved, and thus less useful.
As there's already a fixme message being printed once, I think the message has served its purpose, especially as it's supposed to really print something *once*.
Well, it's what vkd3d does, at least. I guess the actual intent of WARN has been less than perfectly clear to me. On the other hand, I don't personally care either way, so in the presence of someone who does, I'm happy to alter this to use TRACE instead.