Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: trace if a PD/PT update is done directly

This is usfull for debugging.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Christian König and committed by
Alex Deucher
1313dacf bc51c1e5

+17 -12
+14 -9
drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
··· 323 323 324 324 TRACE_EVENT(amdgpu_vm_set_ptes, 325 325 TP_PROTO(uint64_t pe, uint64_t addr, unsigned count, 326 - uint32_t incr, uint64_t flags), 327 - TP_ARGS(pe, addr, count, incr, flags), 326 + uint32_t incr, uint64_t flags, bool direct), 327 + TP_ARGS(pe, addr, count, incr, flags, direct), 328 328 TP_STRUCT__entry( 329 329 __field(u64, pe) 330 330 __field(u64, addr) 331 331 __field(u32, count) 332 332 __field(u32, incr) 333 333 __field(u64, flags) 334 + __field(bool, direct) 334 335 ), 335 336 336 337 TP_fast_assign( ··· 340 339 __entry->count = count; 341 340 __entry->incr = incr; 342 341 __entry->flags = flags; 342 + __entry->direct = direct; 343 343 ), 344 - TP_printk("pe=%010Lx, addr=%010Lx, incr=%u, flags=%llx, count=%u", 345 - __entry->pe, __entry->addr, __entry->incr, 346 - __entry->flags, __entry->count) 344 + TP_printk("pe=%010Lx, addr=%010Lx, incr=%u, flags=%llx, count=%u, " 345 + "direct=%d", __entry->pe, __entry->addr, __entry->incr, 346 + __entry->flags, __entry->count, __entry->direct) 347 347 ); 348 348 349 349 TRACE_EVENT(amdgpu_vm_copy_ptes, 350 - TP_PROTO(uint64_t pe, uint64_t src, unsigned count), 351 - TP_ARGS(pe, src, count), 350 + TP_PROTO(uint64_t pe, uint64_t src, unsigned count, bool direct), 351 + TP_ARGS(pe, src, count, direct), 352 352 TP_STRUCT__entry( 353 353 __field(u64, pe) 354 354 __field(u64, src) 355 355 __field(u32, count) 356 + __field(bool, direct) 356 357 ), 357 358 358 359 TP_fast_assign( 359 360 __entry->pe = pe; 360 361 __entry->src = src; 361 362 __entry->count = count; 363 + __entry->direct = direct; 362 364 ), 363 - TP_printk("pe=%010Lx, src=%010Lx, count=%u", 364 - __entry->pe, __entry->src, __entry->count) 365 + TP_printk("pe=%010Lx, src=%010Lx, count=%u, direct=%d", 366 + __entry->pe, __entry->src, __entry->count, 367 + __entry->direct) 365 368 ); 366 369 367 370 TRACE_EVENT(amdgpu_vm_flush,
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c
··· 89 89 90 90 pe += (unsigned long)amdgpu_bo_kptr(bo); 91 91 92 - trace_amdgpu_vm_set_ptes(pe, addr, count, incr, flags); 92 + trace_amdgpu_vm_set_ptes(pe, addr, count, incr, flags, p->direct); 93 93 94 94 for (i = 0; i < count; i++) { 95 95 value = p->pages_addr ?
+2 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c
··· 143 143 src += p->num_dw_left * 4; 144 144 145 145 pe += amdgpu_bo_gpu_offset(bo); 146 - trace_amdgpu_vm_copy_ptes(pe, src, count); 146 + trace_amdgpu_vm_copy_ptes(pe, src, count, p->direct); 147 147 148 148 amdgpu_vm_copy_pte(p->adev, ib, pe, src, count); 149 149 } ··· 170 170 struct amdgpu_ib *ib = p->job->ibs; 171 171 172 172 pe += amdgpu_bo_gpu_offset(bo); 173 - trace_amdgpu_vm_set_ptes(pe, addr, count, incr, flags); 173 + trace_amdgpu_vm_set_ptes(pe, addr, count, incr, flags, p->direct); 174 174 if (count < 3) { 175 175 amdgpu_vm_write_pte(p->adev, ib, pe, addr | flags, 176 176 count, incr);