[CI 6/7] trace
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Mon Feb 13 12:36:15 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 c493a788aea3..0bef54b892cb 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--;
}
}
@@ -401,6 +405,7 @@ int dma_fence_signal_timestamp_locked(struct dma_fence *fence,
trace_dma_fence_signaled(fence);
list_for_each_entry_safe(cur, tmp, &cb_list, node) {
+ trace_printk(" S %llx:%llu @ %u [%p]\n", fence->context, fence->seqno, fence->waitcount, cur);
INIT_LIST_HEAD(&cur->node);
decr_wait_count(fence, cur);
cur->func(fence, cur);
@@ -553,6 +558,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",
@@ -590,6 +597,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);
@@ -658,9 +666,11 @@ 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);
cb->func = func;
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);
INIT_LIST_HEAD(&cb->node);
ret = -ENOENT;
@@ -761,6 +771,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);
}
@@ -821,6 +832,7 @@ dma_fence_default_wait(struct dma_fence *fence, bool intr, signed long timeout)
cb.base.func = 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);
@@ -1004,6 +1016,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