[CI 10/12] trace
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Mon Feb 13 17:27:58 UTC 2023
From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
drivers/dma-buf/dma-fence.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index bdba5a8e21b1..d961460944f6 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -350,6 +350,7 @@ static void incr_wait_count(struct dma_fence *fence, struct dma_fence_cb *cb)
__set_bit(DMA_FENCE_CB_FLAG_WAITCOUNT_BIT, &cb->flags);
fence->waitcount++;
+ trace_printk(" ++ %llx:%llu -> %u [%p]\n", fence->context, fence->seqno, fence->waitcount, cb);
WARN_ON_ONCE(!fence->waitcount);
}
@@ -357,8 +358,11 @@ static void decr_wait_count(struct dma_fence *fence, struct dma_fence_cb *cb)
{
lockdep_assert_held(fence->lock);
+ trace_printk(" -- %llx:%llu @ %u (%lx]) [%p]\n", fence->context, fence->seqno, fence->waitcount, cb->flags, cb);
if (__test_and_clear_bit(DMA_FENCE_CB_FLAG_WAITCOUNT_BIT, &cb->flags)) {
WARN_ON_ONCE(!fence->waitcount);
+ if (!fence->waitcount)
+ ftrace_dump(DUMP_ALL);
fence->waitcount--;
}
}
@@ -382,6 +386,7 @@ __dma_fence_signal__notify(struct dma_fence *fence,
lockdep_assert_held(fence->lock);
list_for_each_entry_safe(cur, tmp, list, node) {
+ trace_printk(" S %llx:%llu @ %u [%p]\n", fence->context, fence->seqno, fence->waitcount, cur);
decr_wait_count(fence, cur);
INIT_LIST_HEAD(&cur->node);
cur->func(fence, cur);
@@ -571,6 +576,8 @@ void dma_fence_release(struct kref *kref)
trace_dma_fence_destroy(fence);
+ trace_printk(" r %llx:%llu @ %u\n", fence->context, fence->seqno, fence->waitcount);
+
if (WARN(!list_empty(&fence->cb_list) &&
!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags),
"Fence %s:%s:%llx:%llx released with pending signals!\n",
@@ -608,6 +615,7 @@ EXPORT_SYMBOL(dma_fence_release);
*/
void dma_fence_free(struct dma_fence *fence)
{
+ trace_printk(" f %llx:%llu @ %u\n", fence->context, fence->seqno, fence->waitcount);
kfree_rcu(fence, rcu);
}
EXPORT_SYMBOL(dma_fence_free);
@@ -676,8 +684,10 @@ static int add_callback(struct dma_fence *fence, struct dma_fence_cb *cb,
incr_wait_count(fence, cb);
if (__dma_fence_enable_signaling(fence)) {
+ trace_printk(" A %llx:%llu @ %u [%p]\n", fence->context, fence->seqno, fence->waitcount, cb);
list_add_tail(&cb->node, &fence->cb_list);
} else {
+ trace_printk(" a- %llx:%llu @ %u [%p]\n", fence->context, fence->seqno, fence->waitcount, cb);
decr_wait_count(fence, cb);
ret = -ENOENT;
}
@@ -777,6 +787,7 @@ dma_fence_remove_callback(struct dma_fence *fence, struct dma_fence_cb *cb)
ret = !list_empty(&cb->node);
if (ret) {
+ trace_printk(" R %llx:%llu @ %u [%p]\n", fence->context, fence->seqno, fence->waitcount, cb);
decr_wait_count(fence, cb);
list_del_init(&cb->node);
}
@@ -837,6 +848,7 @@ dma_fence_default_wait(struct dma_fence *fence, bool intr, signed long timeout)
__dma_fence_cb_init(&cb.base, dma_fence_default_wait_cb);
cb.task = current;
+ trace_printk(" W %llx:%llu @ %u [%p]\n", fence->context, fence->seqno, fence->waitcount, &cb.base);
incr_wait_count(fence, &cb.base);
list_add(&cb.base.node, &fence->cb_list);
@@ -1020,6 +1032,8 @@ dma_fence_init(struct dma_fence *fence, const struct dma_fence_ops *ops,
fence->waitcount = 0;
fence->error = 0;
+ trace_printk(" I %llx:%llu @ %u\n", fence->context, fence->seqno, fence->waitcount);
+
trace_dma_fence_init(fence);
}
EXPORT_SYMBOL(dma_fence_init);
--
2.34.1
More information about the Intel-gfx-trybot
mailing list