Mesa (master): anv: Make anv_finishme only warn once per call-site

Jason Ekstrand jekstrand at kemper.freedesktop.org
Wed Nov 9 19:32:24 UTC 2016


Module: Mesa
Branch: master
Commit: 64b140498d51a593006a65149b372fed22b6e32d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=64b140498d51a593006a65149b372fed22b6e32d

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Tue Nov  8 20:43:09 2016 -0800

anv: Make anv_finishme only warn once per call-site

When you fire up Dota2 on Haswell you get spammed with thousands of
"Implement Gen7 HZ ops" finishme's.  The point of anv_finishme is to act as
a reminder that there is something left to implement.  Printing it once
should be sufficient.

Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/intel/vulkan/anv_private.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 8f5a95b..c71a884 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -194,8 +194,13 @@ void anv_loge_v(const char *format, va_list va);
 /**
  * Print a FINISHME message, including its source location.
  */
-#define anv_finishme(format, ...) \
-   __anv_finishme(__FILE__, __LINE__, format, ##__VA_ARGS__);
+#define anv_finishme(format, ...) ({ \
+   static bool reported = false; \
+   if (!reported) { \
+      __anv_finishme(__FILE__, __LINE__, format, ##__VA_ARGS__); \
+      reported = true; \
+   } \
+})
 
 /* A non-fatal assert.  Useful for debugging. */
 #ifdef DEBUG




More information about the mesa-commit mailing list