vkr: add some trace points for the ring

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
macos/master
Chia-I Wu 4 years ago
parent 5ec017709c
commit f64e081d1a
  1. 11
      src/vkr_ring.c

@ -15,6 +15,7 @@
#include "util/u_math.h" #include "util/u_math.h"
#include "util/u_memory.h" #include "util/u_memory.h"
#include "virgl_context.h" #include "virgl_context.h"
#include "virgl_util.h"
enum vkr_ring_status_flag { enum vkr_ring_status_flag {
VKR_RING_STATUS_IDLE = 1u << 0, VKR_RING_STATUS_IDLE = 1u << 0,
@ -187,6 +188,8 @@ vkr_ring_thread(void *arg)
} }
if (wait) { if (wait) {
TRACE_SCOPE("ring idle");
mtx_lock(&ring->mutex); mtx_lock(&ring->mutex);
if (ring->started && !ring->pending_notify) if (ring->started && !ring->pending_notify)
cnd_wait(&ring->cond, &ring->mutex); cnd_wait(&ring->cond, &ring->mutex);
@ -258,6 +261,10 @@ vkr_ring_notify(struct vkr_ring *ring)
ring->pending_notify = true; ring->pending_notify = true;
cnd_signal(&ring->cond); cnd_signal(&ring->cond);
mtx_unlock(&ring->mutex); mtx_unlock(&ring->mutex);
{
TRACE_SCOPE("ring notify done");
}
} }
bool 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); volatile atomic_uint *dst = (void *)((uint8_t *)ring->shared.extra + offset);
atomic_store_explicit(dst, val, memory_order_release); atomic_store_explicit(dst, val, memory_order_release);
{
TRACE_SCOPE("ring extra done");
}
return true; return true;
} }

Loading…
Cancel
Save