AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
To: "Pierre-Eric Pelloux-Prayer" <pierre-eric.pelloux-prayer@amd.com>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Gustavo Padovan" <gustavo@padovan.org>,
	"Christian König" <christian.koenig@amd.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
	dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org,
	"Alex Deucher" <alexander.deucher@amd.com>,
	amd-gfx@lists.freedesktop.org
Subject: [PATCH v3 4/8] drm/amdgpu: add a amdgpu_bo_fill trace event
Date: Fri, 16 Feb 2024 16:09:53 +0100	[thread overview]
Message-ID: <20240216151006.475077-5-pierre-eric.pelloux-prayer@amd.com> (raw)
In-Reply-To: <20240216151006.475077-1-pierre-eric.pelloux-prayer@amd.com>

Useful to identify why sdma jobs are submitted.

v2: moved from amdgpu_bo_create to amdgpu_bo_fill

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 18 ++++++++++++++++++
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c   |  2 ++
 2 files changed, 20 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
index f539b1d00234..0e47cbe7e0a9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h
@@ -514,6 +514,24 @@ TRACE_EVENT(amdgpu_bo_move,
 			__entry->new_placement, __entry->bo_size)
 );
 
+TRACE_EVENT(amdgpu_bo_fill,
+	    TP_PROTO(struct amdgpu_bo *bo, uint32_t value),
+	    TP_ARGS(bo, value),
+	    TP_STRUCT__entry(
+			__field(struct amdgpu_bo *, bo)
+			__field(u64, bo_size)
+			__field(u32, value)
+			),
+
+	    TP_fast_assign(
+			__entry->bo      = bo;
+			__entry->bo_size = amdgpu_bo_size(bo);
+			__entry->value   = value;
+			),
+	    TP_printk("bo=%p, size=%lld, value=0x%08x",
+			__entry->bo, __entry->bo_size, __entry->value)
+);
+
 TRACE_EVENT(amdgpu_ib_pipe_sync,
 	    TP_PROTO(struct amdgpu_job *sched_job, struct dma_fence *fence),
 	    TP_ARGS(sched_job, fence),
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 8722beba494e..7d0b2c1191f8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -2231,6 +2231,8 @@ int amdgpu_fill_buffer(struct amdgpu_bo *bo,
 		return -EINVAL;
 	}
 
+	trace_amdgpu_bo_fill(bo, src_data);
+
 	amdgpu_res_first(bo->tbo.resource, 0, amdgpu_bo_size(bo), &dst);
 
 	mutex_lock(&adev->mman.gtt_window_lock);
-- 
2.40.1


  parent reply	other threads:[~2024-02-16 15:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16 15:09 [PATCH v3 0/8] dma-fence, drm, amdgpu new trace events Pierre-Eric Pelloux-Prayer
2024-02-16 15:09 ` [PATCH v3 1/8] tracing, dma-buf: add a trace_dma_fence_sync_to event Pierre-Eric Pelloux-Prayer
2024-02-16 15:28   ` Christian König
2024-02-16 15:09 ` [PATCH v3 2/8] dma-buf/fence-chain: use trace_dma_fence_sync_to Pierre-Eric Pelloux-Prayer
2024-02-16 15:30   ` Christian König
2024-02-16 15:09 ` [PATCH v3 3/8] amdgpu: use trace_dma_fence_sync_to in amdgpu_fence_sync Pierre-Eric Pelloux-Prayer
2024-02-16 15:56   ` Christian König
2024-02-16 15:09 ` Pierre-Eric Pelloux-Prayer [this message]
2024-02-16 15:09 ` [PATCH v3 5/8] drm/amdgpu: add a amdgpu_cs_start trace event Pierre-Eric Pelloux-Prayer
2024-02-16 15:09 ` [PATCH v3 6/8] drm: add drm_mode_atomic_commit event Pierre-Eric Pelloux-Prayer
2024-02-16 15:59   ` Steven Rostedt
2024-02-16 16:24   ` Ville Syrjälä
2024-02-22 13:05     ` Pierre-Eric Pelloux-Prayer
2024-02-16 15:09 ` [PATCH v3 7/8] drm/sched: use trace_dma_fence_used_as_dependency Pierre-Eric Pelloux-Prayer
2024-02-16 15:09 ` [PATCH v3 8/8] drm/amdgpu: add devname to trace_amdgpu_sched_run_job Pierre-Eric Pelloux-Prayer
2024-02-16 15:20 ` [PATCH v3 0/8] dma-fence, drm, amdgpu new trace events Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240216151006.475077-5-pierre-eric.pelloux-prayer@amd.com \
    --to=pierre-eric.pelloux-prayer@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo@padovan.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=sumit.semwal@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox