amdgpu_cs_ioctl already exists but serves a different purpose. amdgpu_cs_ioctl2 marks the beginning of the kernel processing of the ioctl which is useful for tools to map which events belong to the same submission (without this, the first event would be the amdgpu_bo_set_list ones). Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@xxxxxxx> --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 6830892383c3..29e43a66d0d6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -1402,6 +1402,8 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) return r; } + trace_amdgpu_cs_ioctl2(data); + r = amdgpu_cs_pass1(&parser, data); if (r) goto error_fini; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h index e8ea1cfe7027..24e95560ede5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h @@ -189,6 +189,18 @@ TRACE_EVENT(amdgpu_cs_ioctl, __entry->seqno, __get_str(ring), __entry->num_ibs) ); +TRACE_EVENT(amdgpu_cs_ioctl2, + TP_PROTO(union drm_amdgpu_cs *cs), + TP_ARGS(cs), + TP_STRUCT__entry( + __field(uint32_t, ctx_id) + ), + TP_fast_assign( + __entry->ctx_id = cs->in.ctx_id; + ), + TP_printk("context=%u", __entry->ctx_id) +); + TRACE_EVENT(amdgpu_sched_run_job, TP_PROTO(struct amdgpu_job *job), TP_ARGS(job), -- 2.40.1