diff options
author | Christian König <christian.koenig@amd.com> | 2015-09-28 06:00:23 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-10-14 16:16:41 -0400 |
commit | d6c10f6b81e340e7d2d337183517a6da739d5ba2 (patch) | |
tree | 93e2eb0e7454ab811c41c85cf7a355cff426774e | |
parent | b495bd3a54e732e846bfde49ba2ea93b62b1de91 (diff) |
drm/amdgpu: add VM CS mapping trace point
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>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 8 |
2 files changed, 19 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h index 961d7265c286..76ecbaf72a2e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | |||
@@ -111,7 +111,7 @@ TRACE_EVENT(amdgpu_vm_bo_unmap, | |||
111 | __entry->offset, __entry->flags) | 111 | __entry->offset, __entry->flags) |
112 | ); | 112 | ); |
113 | 113 | ||
114 | TRACE_EVENT(amdgpu_vm_bo_update, | 114 | DECLARE_EVENT_CLASS(amdgpu_vm_mapping, |
115 | TP_PROTO(struct amdgpu_bo_va_mapping *mapping), | 115 | TP_PROTO(struct amdgpu_bo_va_mapping *mapping), |
116 | TP_ARGS(mapping), | 116 | TP_ARGS(mapping), |
117 | TP_STRUCT__entry( | 117 | TP_STRUCT__entry( |
@@ -129,6 +129,16 @@ TRACE_EVENT(amdgpu_vm_bo_update, | |||
129 | __entry->soffset, __entry->eoffset, __entry->flags) | 129 | __entry->soffset, __entry->eoffset, __entry->flags) |
130 | ); | 130 | ); |
131 | 131 | ||
132 | DEFINE_EVENT(amdgpu_vm_mapping, amdgpu_vm_bo_update, | ||
133 | TP_PROTO(struct amdgpu_bo_va_mapping *mapping), | ||
134 | TP_ARGS(mapping) | ||
135 | ); | ||
136 | |||
137 | DEFINE_EVENT(amdgpu_vm_mapping, amdgpu_vm_bo_mapping, | ||
138 | TP_PROTO(struct amdgpu_bo_va_mapping *mapping), | ||
139 | TP_ARGS(mapping) | ||
140 | ); | ||
141 | |||
132 | TRACE_EVENT(amdgpu_vm_set_page, | 142 | TRACE_EVENT(amdgpu_vm_set_page, |
133 | TP_PROTO(uint64_t pe, uint64_t addr, unsigned count, | 143 | TP_PROTO(uint64_t pe, uint64_t addr, unsigned count, |
134 | uint32_t incr, uint32_t flags), | 144 | uint32_t incr, uint32_t flags), |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 2e15f2db06bf..0675524eb9de 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -852,6 +852,14 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, | |||
852 | return r; | 852 | return r; |
853 | } | 853 | } |
854 | 854 | ||
855 | if (trace_amdgpu_vm_bo_mapping_enabled()) { | ||
856 | list_for_each_entry(mapping, &bo_va->valids, list) | ||
857 | trace_amdgpu_vm_bo_mapping(mapping); | ||
858 | |||
859 | list_for_each_entry(mapping, &bo_va->invalids, list) | ||
860 | trace_amdgpu_vm_bo_mapping(mapping); | ||
861 | } | ||
862 | |||
855 | spin_lock(&vm->status_lock); | 863 | spin_lock(&vm->status_lock); |
856 | list_splice_init(&bo_va->invalids, &bo_va->valids); | 864 | list_splice_init(&bo_va->invalids, &bo_va->valids); |
857 | list_del_init(&bo_va->vm_status); | 865 | list_del_init(&bo_va->vm_status); |