drm/amdgpu: add VM CS mapping trace point
authorChristian König <christian.koenig@amd.com>
Mon, 28 Sep 2015 10:00:23 +0000 (12:00 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 14 Oct 2015 20:16:41 +0000 (16:16 -0400)
Output all VM mappings a command submission uses.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index 961d7265c286524956e1100b14f084eb6e5341b0..76ecbaf72a2e81bf70d12f63c1ca9c7517fdf3e6 100644 (file)
@@ -111,7 +111,7 @@ TRACE_EVENT(amdgpu_vm_bo_unmap,
                      __entry->offset, __entry->flags)
 );
 
-TRACE_EVENT(amdgpu_vm_bo_update,
+DECLARE_EVENT_CLASS(amdgpu_vm_mapping,
            TP_PROTO(struct amdgpu_bo_va_mapping *mapping),
            TP_ARGS(mapping),
            TP_STRUCT__entry(
@@ -129,6 +129,16 @@ TRACE_EVENT(amdgpu_vm_bo_update,
                      __entry->soffset, __entry->eoffset, __entry->flags)
 );
 
+DEFINE_EVENT(amdgpu_vm_mapping, amdgpu_vm_bo_update,
+           TP_PROTO(struct amdgpu_bo_va_mapping *mapping),
+           TP_ARGS(mapping)
+);
+
+DEFINE_EVENT(amdgpu_vm_mapping, amdgpu_vm_bo_mapping,
+           TP_PROTO(struct amdgpu_bo_va_mapping *mapping),
+           TP_ARGS(mapping)
+);
+
 TRACE_EVENT(amdgpu_vm_set_page,
            TP_PROTO(uint64_t pe, uint64_t addr, unsigned count,
                     uint32_t incr, uint32_t flags),
index 2e15f2db06bf9dd8e25c84959c3956bcc393c717..0675524eb9de57a5a911dbca2ffcd2b66d39fd32 100644 (file)
@@ -852,6 +852,14 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
                        return r;
        }
 
+       if (trace_amdgpu_vm_bo_mapping_enabled()) {
+               list_for_each_entry(mapping, &bo_va->valids, list)
+                       trace_amdgpu_vm_bo_mapping(mapping);
+
+               list_for_each_entry(mapping, &bo_va->invalids, list)
+                       trace_amdgpu_vm_bo_mapping(mapping);
+       }
+
        spin_lock(&vm->status_lock);
        list_splice_init(&bo_va->invalids, &bo_va->valids);
        list_del_init(&bo_va->vm_status);