Mesa (main): freedreno: Add tid to DBG() msgs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 10 02:36:05 UTC 2021


Module: Mesa
Branch: main
Commit: cbb5280a005b4fabeba20aa8025adcbdd105c5d0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cbb5280a005b4fabeba20aa8025adcbdd105c5d0

Author: Rob Clark <robdclark at chromium.org>
Date:   Wed Jun  9 10:11:05 2021 -0700

freedreno: Add tid to DBG() msgs

I keep hacking this up locally when debugging TC sort of issues.  Which
is maybe a sign that we should just add this upstream.

Signed-off-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11200>

---

 src/gallium/drivers/freedreno/freedreno_util.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h
index 66d7f31435f..97e0e3aff9c 100644
--- a/src/gallium/drivers/freedreno/freedreno_util.h
+++ b/src/gallium/drivers/freedreno/freedreno_util.h
@@ -104,10 +104,14 @@ extern bool fd_binning_enabled;
 
 #define FD_DBG(category) unlikely(fd_mesa_debug &FD_DBG_##category)
 
+#include <unistd.h>
+#include <sys/types.h>
+
 #define DBG(fmt, ...)                                                          \
    do {                                                                        \
       if (FD_DBG(MSGS))                                                        \
-         mesa_logd("%s:%d: " fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__);      \
+         mesa_logd("%5d: %s:%d: " fmt, gettid(), __FUNCTION__, __LINE__,       \
+                   ##__VA_ARGS__);                                             \
    } while (0)
 
 #define perf_debug_ctx(ctx, ...)                                               \



More information about the mesa-commit mailing list