From: "Christian König" <christian.koenig@amd.com>
To: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>,
Sumit Semwal <sumit.semwal@linaro.org>,
Gustavo Padovan <gustavo@padovan.org>,
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: Re: [PATCH v3 1/8] tracing, dma-buf: add a trace_dma_fence_sync_to event
Date: Fri, 16 Feb 2024 16:28:56 +0100 [thread overview]
Message-ID: <d7a4f812-5dc0-4d7d-a070-a6d13be96025@amd.com> (raw)
In-Reply-To: <20240216151006.475077-2-pierre-eric.pelloux-prayer@amd.com>
Am 16.02.24 um 16:09 schrieb Pierre-Eric Pelloux-Prayer:
> This new event can be used to trace where a given dma_fence is added
> as a dependency of some other work.
>
> I plan to use it in amdgpu.
>
> Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
> ---
> drivers/dma-buf/dma-fence.c | 1 +
> include/trace/events/dma_fence.h | 27 +++++++++++++++++++++++++++
> 2 files changed, 28 insertions(+)
>
> diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
> index 0393a9bba3a8..e7276c043984 100644
> --- a/drivers/dma-buf/dma-fence.c
> +++ b/drivers/dma-buf/dma-fence.c
> @@ -23,6 +23,7 @@
> EXPORT_TRACEPOINT_SYMBOL(dma_fence_emit);
> EXPORT_TRACEPOINT_SYMBOL(dma_fence_enable_signal);
> EXPORT_TRACEPOINT_SYMBOL(dma_fence_signaled);
> +EXPORT_TRACEPOINT_SYMBOL(dma_fence_used_as_dependency);
>
> static DEFINE_SPINLOCK(dma_fence_stub_lock);
> static struct dma_fence dma_fence_stub;
> diff --git a/include/trace/events/dma_fence.h b/include/trace/events/dma_fence.h
> index 3963e79ca7b4..5a5d272031ce 100644
> --- a/include/trace/events/dma_fence.h
> +++ b/include/trace/events/dma_fence.h
> @@ -83,6 +83,33 @@ DEFINE_EVENT(dma_fence, dma_fence_wait_end,
> TP_ARGS(fence)
> );
>
> +TRACE_EVENT(dma_fence_used_as_dependency,
> +
> + TP_PROTO(struct dma_fence *fence, const char *reason),
> +
> + TP_ARGS(fence, reason),
> +
> + TP_STRUCT__entry(
> + __string(driver, fence->ops->get_driver_name(fence))
> + __string(timeline, fence->ops->get_timeline_name(fence))
> + __field(unsigned int, context)
> + __field(unsigned int, seqno)
I noted it before that this needs to be an u64 and not unsigned int.
Otherwise we will lose the higher 32bits.
The existing trace points have that bug as well, so you might also want
to provide a patch to fix this.
Christian.
> + __string(reason, reason)
> + ),
> +
> + TP_fast_assign(
> + __assign_str(driver, fence->ops->get_driver_name(fence));
> + __assign_str(timeline, fence->ops->get_timeline_name(fence));
> + __entry->context = fence->context;
> + __entry->seqno = fence->seqno;
> + __assign_str(reason, reason);
> + ),
> +
> + TP_printk("driver=%s timeline=%s context=%u seqno=%u reason=%s",
> + __get_str(driver), __get_str(timeline), __entry->context,
> + __entry->seqno, __get_str(reason))
> +);
> +
> #endif /* _TRACE_DMA_FENCE_H */
>
> /* This part must be outside protection */
next prev parent reply other threads:[~2024-02-16 15:29 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 [this message]
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 ` [PATCH v3 4/8] drm/amdgpu: add a amdgpu_bo_fill trace event Pierre-Eric Pelloux-Prayer
2024-02-16 15:09 ` [PATCH v3 5/8] drm/amdgpu: add a amdgpu_cs_start " 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=d7a4f812-5dc0-4d7d-a070-a6d13be96025@amd.com \
--to=christian.koenig@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--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=pierre-eric.pelloux-prayer@amd.com \
--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