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>
This commit is contained in:
Jason Ekstrand
2017-03-07 09:13:15 -08:00
parent 20234cfe3a
commit 201fc83df7
2 changed files with 27 additions and 0 deletions

View File

@@ -64,6 +64,19 @@ __anv_finishme(const char *file, int line, const char *format, ...)
fprintf(stderr, "%s:%d: FINISHME: %s\n", file, line, buffer);
}
void anv_printflike(3, 4)
__anv_perf_warn(const char *file, int line, const char *format, ...)
{
va_list ap;
char buffer[256];
va_start(ap, format);
vsnprintf(buffer, sizeof(buffer), format, ap);
va_end(ap);
fprintf(stderr, "%s:%d: PERF: %s\n", file, line, buffer);
}
VkResult
__vk_errorf(VkResult error, const char *file, int line, const char *format, ...)
{