From f64e081d1abad0a8334fd9d7f89889e3265b7a06 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 21 May 2021 08:47:50 -0700 Subject: [PATCH] vkr: add some trace points for the ring Signed-off-by: Chia-I Wu Reviewed-by: Yiwei Zhang --- src/vkr_ring.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/vkr_ring.c b/src/vkr_ring.c index 74ba96a..e9c8348 100644 --- a/src/vkr_ring.c +++ b/src/vkr_ring.c @@ -15,6 +15,7 @@ #include "util/u_math.h" #include "util/u_memory.h" #include "virgl_context.h" +#include "virgl_util.h" enum vkr_ring_status_flag { VKR_RING_STATUS_IDLE = 1u << 0, @@ -187,6 +188,8 @@ vkr_ring_thread(void *arg) } if (wait) { + TRACE_SCOPE("ring idle"); + mtx_lock(&ring->mutex); if (ring->started && !ring->pending_notify) cnd_wait(&ring->cond, &ring->mutex); @@ -258,6 +261,10 @@ vkr_ring_notify(struct vkr_ring *ring) ring->pending_notify = true; cnd_signal(&ring->cond); mtx_unlock(&ring->mutex); + + { + TRACE_SCOPE("ring notify done"); + } } bool @@ -269,5 +276,9 @@ vkr_ring_write_extra(struct vkr_ring *ring, size_t offset, uint32_t val) volatile atomic_uint *dst = (void *)((uint8_t *)ring->shared.extra + offset); atomic_store_explicit(dst, val, memory_order_release); + { + TRACE_SCOPE("ring extra done"); + } + return true; }