diff options
author | Jason Ekstrand <jason.ekstrand@intel.com> | 2017-03-07 09:13:15 -0800 |
---|---|---|
committer | Jason Ekstrand <jason.ekstrand@intel.com> | 2017-03-07 15:22:16 -0800 |
commit | 201fc83df742ddadcd725c25854ecd1fd399f982 (patch) | |
tree | 56825ca919704d61e4dae3a9bc53491ba972fb5e /src/intel/vulkan/anv_private.h | |
parent | 20234cfe3a204eda5abb4ed757ae775e82619ba7 (diff) |
anv: Add a performance warning helper
This acts identically to anv_finishme except that it only dumps out
these nice log messages if you run with INTEL_DEBUG=perf.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Diffstat (limited to 'src/intel/vulkan/anv_private.h')
-rw-r--r-- | src/intel/vulkan/anv_private.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index c73196ab5ef..e2aeb4f86d7 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -230,6 +230,8 @@ VkResult __vk_errorf(VkResult error, const char *file, int line, const char *for void __anv_finishme(const char *file, int line, const char *format, ...) anv_printflike(3, 4); +void __anv_perf_warn(const char *file, int line, const char *format, ...) + anv_printflike(3, 4); void anv_loge(const char *format, ...) anv_printflike(1, 2); void anv_loge_v(const char *format, va_list va); @@ -245,6 +247,18 @@ void anv_loge_v(const char *format, va_list va); } \ } while (0) +/** + * Print a perf warning message. Set INTEL_DEBUG=perf to see these. + */ +#define anv_perf_warn(format, ...) \ + do { \ + static bool reported = false; \ + if (!reported && unlikely(INTEL_DEBUG & DEBUG_PERF)) { \ + __anv_perf_warn(__FILE__, __LINE__, format, ##__VA_ARGS__); \ + reported = true; \ + } \ + } while (0) + /* A non-fatal assert. Useful for debugging. */ #ifdef DEBUG #define anv_assert(x) ({ \ |