Skip to contentSkip to conversation

drm/amdgpu: add condition check for trace_amdgpu_cs()

PATCH Superseded Kevin Wang 2 participants 2 messages Aug 17, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Kevin Wang

author
#0 lore raw

PATCH 1/1 drm/amdgpu: add condition check for trace_amdgpu_cs()

add trace event enabled check to avoid nop loop when submit multi ibs in amdgpu_cs_ioctl() function.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +3 -2
index ffbcaf4bfb8b..409694f074ac 100644
@@ -1319,8 +1319,9 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
 
 	reserved_buffers = true;
 
-	for (i = 0; i < parser.job->num_ibs; i++)
-		trace_amdgpu_cs(&parser, i);
+	if (trace_amdgpu_cs_enabled())
+		for (i = 0; i < parser.job->num_ibs; i++)
+			trace_amdgpu_cs(&parser, i);
 
 	r = amdgpu_cs_vm_handling(&parser);
 	if (r)
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
maintainer
#1 lore raw

Am 17.08.20 um 11:04 schrieb Kevin Wang:

Quoted 2 lines

add trace event enabled check to avoid nop loop when submit multi ibs in amdgpu_cs_ioctl() function.

Maybe we should change the trace point instead to trace all IBs with just a single call.

Quoted 12 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0 -0
index ffbcaf4bfb8b..409694f074ac 100644
@@ -1319,8 +1319,9 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
 

drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) · line 1327

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +3 -2
  	reserved_buffers = true;
 
-	for (i = 0; i < parser.job->num_ibs; i++)
-		trace_amdgpu_cs(&parser, i);
+	if (trace_amdgpu_cs_enabled())
+		for (i = 0; i < parser.job->num_ibs; i++)
+			trace_amdgpu_cs(&parser, i);
 
  	r = amdgpu_cs_vm_handling(&parser);
  	if (r)

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx