On 31/10/2025 13:16, Christian König wrote:
The driver and timeline name are meaningless for signaled fences.
Drop them and also print the context number.
v2: avoid the calls when the BO is already signaled.
Signed-off-by: Christian König <[email protected]>
---
drivers/dma-buf/dma-fence.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index 39e6f93dc310..cfa6ddcc1278 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -999,19 +999,20 @@ EXPORT_SYMBOL(dma_fence_set_deadline);
*/
void dma_fence_describe(struct dma_fence *fence, struct seq_file *seq)
{
- const char __rcu *timeline;
- const char __rcu *driver;
+ const char __rcu *timeline = "";
+ const char __rcu *driver = "";
+ const char *signaled = "";
rcu_read_lock();
- timeline = dma_fence_timeline_name(fence);
- driver = dma_fence_driver_name(fence);
+ if (!dma_fence_is_signaled(fence)) {
+ timeline = dma_fence_timeline_name(fence);
+ driver = dma_fence_driver_name(fence);
+ signaled = "un";
+ }
- seq_printf(seq, "%s %s seq %llu %ssignalled\n",
- rcu_dereference(driver),
- rcu_dereference(timeline),
- fence->seqno,
- dma_fence_is_signaled(fence) ? "" : "un");
+ seq_printf(seq, "%llu %s %s seq %llu %ssignalled\n", fence->context,
+ timeline, driver, fence->seqno, signaled);
I still prefer my version, so if I am allowed to bike shed:
a) %llu:%llu for context:seqno to align with the tracepoints would
have been nicer.
b) Why move the driver name in the middle of the timeline and seqno?
c) Signalled case will have triple space which is odd.
But it's debugfs so who cares.
Reviewed-by: Tvrtko Ursulin <[email protected]>
Regards,
Tvrtko
rcu_read_unlock();
}