Commit d6c10f6b authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: add VM CS mapping trace point

Output all VM mappings a command submission uses.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent b495bd3a
...@@ -111,7 +111,7 @@ TRACE_EVENT(amdgpu_vm_bo_unmap, ...@@ -111,7 +111,7 @@ TRACE_EVENT(amdgpu_vm_bo_unmap,
__entry->offset, __entry->flags) __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_PROTO(struct amdgpu_bo_va_mapping *mapping),
TP_ARGS(mapping), TP_ARGS(mapping),
TP_STRUCT__entry( TP_STRUCT__entry(
...@@ -129,6 +129,16 @@ TRACE_EVENT(amdgpu_vm_bo_update, ...@@ -129,6 +129,16 @@ TRACE_EVENT(amdgpu_vm_bo_update,
__entry->soffset, __entry->eoffset, __entry->flags) __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, TRACE_EVENT(amdgpu_vm_set_page,
TP_PROTO(uint64_t pe, uint64_t addr, unsigned count, TP_PROTO(uint64_t pe, uint64_t addr, unsigned count,
uint32_t incr, uint32_t flags), uint32_t incr, uint32_t flags),
......
...@@ -852,6 +852,14 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, ...@@ -852,6 +852,14 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
return r; 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); spin_lock(&vm->status_lock);
list_splice_init(&bo_va->invalids, &bo_va->valids); list_splice_init(&bo_va->invalids, &bo_va->valids);
list_del_init(&bo_va->vm_status); list_del_init(&bo_va->vm_status);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment