From c98b5c9714942bd1872d86f65f975b474614a380 Mon Sep 17 00:00:00 2001 From: Andres Rodriguez Date: Sat, 11 Mar 2017 10:50:34 -0500 Subject: [PATCH] drm/amdgpu: add macro to retrieve timeline name v2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This helps de-duplicate a long expression and removes overly long lines. v2: Rename macro and undef it Reviewed-by: Christian König Signed-off-by: Andres Rodriguez Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h index 88e17045a968..08ccb3d34b21 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h @@ -11,6 +11,9 @@ #define TRACE_SYSTEM amdgpu #define TRACE_INCLUDE_FILE amdgpu_trace +#define AMDGPU_JOB_GET_TIMELINE_NAME(job) \ + job->base.s_fence->finished.ops->get_timeline_name(&job->base.s_fence->finished) + TRACE_EVENT(amdgpu_mm_rreg, TP_PROTO(unsigned did, uint32_t reg, uint32_t value), TP_ARGS(did, reg, value), @@ -102,7 +105,7 @@ TRACE_EVENT(amdgpu_cs_ioctl, TP_ARGS(job), TP_STRUCT__entry( __field(uint64_t, sched_job_id) - __string(timeline, job->base.s_fence->finished.ops->get_timeline_name(&job->base.s_fence->finished)) + __string(timeline, AMDGPU_JOB_GET_TIMELINE_NAME(job)) __field(unsigned int, context) __field(unsigned int, seqno) __field(struct dma_fence *, fence) @@ -112,7 +115,7 @@ TRACE_EVENT(amdgpu_cs_ioctl, TP_fast_assign( __entry->sched_job_id = job->base.id; - __assign_str(timeline, job->base.s_fence->finished.ops->get_timeline_name(&job->base.s_fence->finished)) + __assign_str(timeline, AMDGPU_JOB_GET_TIMELINE_NAME(job)) __entry->context = job->base.s_fence->finished.context; __entry->seqno = job->base.s_fence->finished.seqno; __entry->ring_name = job->ring->name; @@ -128,7 +131,7 @@ TRACE_EVENT(amdgpu_sched_run_job, TP_ARGS(job), TP_STRUCT__entry( __field(uint64_t, sched_job_id) - __string(timeline, job->base.s_fence->finished.ops->get_timeline_name(&job->base.s_fence->finished)) + __string(timeline, AMDGPU_JOB_GET_TIMELINE_NAME(job)) __field(unsigned int, context) __field(unsigned int, seqno) __field(char *, ring_name) @@ -137,7 +140,7 @@ TRACE_EVENT(amdgpu_sched_run_job, TP_fast_assign( __entry->sched_job_id = job->base.id; - __assign_str(timeline, job->base.s_fence->finished.ops->get_timeline_name(&job->base.s_fence->finished)) + __assign_str(timeline, AMDGPU_JOB_GET_TIMELINE_NAME(job)) __entry->context = job->base.s_fence->finished.context; __entry->seqno = job->base.s_fence->finished.seqno; __entry->ring_name = job->ring->name; @@ -365,6 +368,7 @@ TRACE_EVENT(amdgpu_ttm_bo_move, __entry->new_placement, __entry->bo_size) ); +#undef AMDGPU_JOB_GET_TIMELINE_NAME #endif /* This part must be outside protection */ -- 2.20.1