public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] tracing, dma-buf: add a trace_dma_fence_sync_to event
@ 2024-01-17 18:41 Pierre-Eric Pelloux-Prayer
  2024-01-17 18:41 ` [PATCH 2/2] amdgpu: use trace_dma_fence_sync_to in amdgpu_fence_sync Pierre-Eric Pelloux-Prayer
  2024-02-13 15:50 ` [PATCH v2 0/6] dma-fence, drm, amdgpu new trace events Pierre-Eric Pelloux-Prayer
  0 siblings, 2 replies; 24+ messages in thread
From: Pierre-Eric Pelloux-Prayer @ 2024-01-17 18:41 UTC (permalink / raw)
  To: Sumit Semwal, Gustavo Padovan, Christian König,
	Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers, dri-devel,
	linux-media, linux-trace-kernel, Alex Deucher, amd-gfx
  Cc: 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 | 34 ++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index e0fd99e61a2d..671a499a5ccd 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_sync_to);
 
 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..9b3875f7aa79 100644
--- a/include/trace/events/dma_fence.h
+++ b/include/trace/events/dma_fence.h
@@ -83,6 +83,40 @@ DEFINE_EVENT(dma_fence, dma_fence_wait_end,
 	TP_ARGS(fence)
 );
 
+DECLARE_EVENT_CLASS(dma_fence_from,
+
+	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)
+		__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))
+);
+
+DEFINE_EVENT(dma_fence_from, dma_fence_sync_to,
+
+	TP_PROTO(struct dma_fence *fence, const char *reason),
+
+	TP_ARGS(fence, reason)
+);
+
 #endif /*  _TRACE_DMA_FENCE_H */
 
 /* This part must be outside protection */
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2024-02-16 18:02 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-17 18:41 [PATCH 1/2] tracing, dma-buf: add a trace_dma_fence_sync_to event Pierre-Eric Pelloux-Prayer
2024-01-17 18:41 ` [PATCH 2/2] amdgpu: use trace_dma_fence_sync_to in amdgpu_fence_sync Pierre-Eric Pelloux-Prayer
2024-02-13 15:50 ` [PATCH v2 0/6] dma-fence, drm, amdgpu new trace events Pierre-Eric Pelloux-Prayer
2024-02-13 15:50   ` [PATCH v2 1/6] tracing, dma-buf: add a trace_dma_fence_sync_to event Pierre-Eric Pelloux-Prayer
2024-02-14 12:00     ` Christian König
2024-02-14 15:10       ` Steven Rostedt
2024-02-14 16:54         ` Pierre-Eric Pelloux-Prayer
2024-02-16 16:32     ` Daniel Vetter
2024-02-16 16:51       ` Christian König
2024-02-16 18:02         ` Daniel Vetter
2024-02-13 15:50   ` [PATCH v2 2/6] dma-buf/fence-chain: use trace_dma_fence_sync_to Pierre-Eric Pelloux-Prayer
2024-02-13 15:50   ` [PATCH v2 3/6] amdgpu: use trace_dma_fence_sync_to in amdgpu_fence_sync Pierre-Eric Pelloux-Prayer
2024-02-14 12:10     ` Christian König
2024-02-13 15:50   ` [PATCH v2 4/6] drm/amdgpu: add BO clear event Pierre-Eric Pelloux-Prayer
2024-02-14 12:06     ` Christian König
2024-02-13 15:50   ` [PATCH v2 5/6] drm/amdgpu: add a amdgpu_cs_ioctl2 event Pierre-Eric Pelloux-Prayer
2024-02-14 12:09     ` Christian König
2024-02-14 16:38       ` Pierre-Eric Pelloux-Prayer
2024-02-14 16:45         ` Christian König
2024-02-13 15:50   ` [PATCH v2 6/6] drm: add drm_mode_atomic_commit event Pierre-Eric Pelloux-Prayer
2024-02-13 16:20     ` Steven Rostedt
2024-02-16 16:37       ` Daniel Vetter
2024-02-16 16:44         ` Steven Rostedt
2024-02-16 16:25   ` [PATCH v2 0/6] dma-fence, drm, amdgpu new trace events Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox