mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 15:00:11 +01:00
tu: Add MESA_TRACE_FUNC to submit and BO alloc paths
Makes much easier to see how slow are submits and BO allocs, which sometimes happen together. Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35637>
This commit is contained in:
parent
6e5944ec4b
commit
9f74fcffe4
4 changed files with 14 additions and 3 deletions
|
|
@ -2234,6 +2234,7 @@ tu_u_trace_submission_data_create(
|
|||
uint32_t cmd_buffer_count,
|
||||
struct tu_u_trace_submission_data **submission_data)
|
||||
{
|
||||
MESA_TRACE_FUNC();
|
||||
*submission_data = (struct tu_u_trace_submission_data *)
|
||||
vk_zalloc(&device->vk.alloc,
|
||||
sizeof(struct tu_u_trace_submission_data), 8,
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ tu_bo_init_new_explicit_iova(struct tu_device *dev,
|
|||
VkMemoryPropertyFlags mem_property,
|
||||
enum tu_bo_alloc_flags flags, const char *name)
|
||||
{
|
||||
MESA_TRACE_FUNC();
|
||||
struct tu_instance *instance = dev->physical_device->instance;
|
||||
|
||||
VkResult result =
|
||||
|
|
@ -88,6 +89,7 @@ tu_bo_export_dmabuf(struct tu_device *dev, struct tu_bo *bo)
|
|||
void
|
||||
tu_bo_finish(struct tu_device *dev, struct tu_bo *bo)
|
||||
{
|
||||
MESA_TRACE_FUNC();
|
||||
struct tu_instance *instance = dev->physical_device->instance;
|
||||
|
||||
vk_address_binding_report(&instance->vk, bo->base ? bo->base : &dev->vk.base,
|
||||
|
|
|
|||
|
|
@ -351,6 +351,7 @@ tu_wait_fence(struct tu_device *dev,
|
|||
int fence,
|
||||
uint64_t timeout_ns)
|
||||
{
|
||||
MESA_TRACE_FUNC();
|
||||
/* fence was created when no work was yet submitted */
|
||||
if (fence < 0)
|
||||
return VK_SUCCESS;
|
||||
|
|
@ -390,6 +391,8 @@ tu_free_zombie_vma_locked(struct tu_device *dev, bool wait)
|
|||
if (!u_vector_length(&dev->zombie_vmas))
|
||||
return VK_SUCCESS;
|
||||
|
||||
MESA_TRACE_FUNC();
|
||||
|
||||
if (wait) {
|
||||
struct tu_zombie_vma *vma = (struct tu_zombie_vma *)
|
||||
u_vector_head(&dev->zombie_vmas);
|
||||
|
|
@ -654,6 +657,7 @@ msm_bo_init(struct tu_device *dev,
|
|||
enum tu_bo_alloc_flags flags,
|
||||
const char *name)
|
||||
{
|
||||
MESA_TRACE_FUNC();
|
||||
struct drm_msm_gem_new req = {
|
||||
.size = size,
|
||||
.flags = 0
|
||||
|
|
@ -946,9 +950,12 @@ msm_queue_submit(struct tu_queue *queue, void *_submit,
|
|||
.syncobj_stride = sizeof(struct drm_msm_gem_submit_syncobj),
|
||||
};
|
||||
|
||||
ret = drmCommandWriteRead(queue->device->fd,
|
||||
DRM_MSM_GEM_SUBMIT,
|
||||
&req, sizeof(req));
|
||||
{
|
||||
MESA_TRACE_SCOPE("DRM_MSM_GEM_SUBMIT");
|
||||
ret = drmCommandWriteRead(queue->device->fd,
|
||||
DRM_MSM_GEM_SUBMIT,
|
||||
&req, sizeof(req));
|
||||
}
|
||||
|
||||
mtx_unlock(&queue->device->bo_mutex);
|
||||
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ submit_add_entries(struct tu_device *dev, void *submit,
|
|||
static VkResult
|
||||
queue_submit(struct vk_queue *_queue, struct vk_queue_submit *vk_submit)
|
||||
{
|
||||
MESA_TRACE_FUNC();
|
||||
struct tu_queue *queue = list_entry(_queue, struct tu_queue, vk);
|
||||
struct tu_device *device = queue->device;
|
||||
bool u_trace_enabled = u_trace_should_process(&queue->device->trace_context);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue