diff options
author | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2016-05-03 19:30:35 -0300 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.com> | 2017-01-18 12:08:49 -0200 |
commit | 33c3335356b79a0e2bc80ceab5d12f9648442dcf (patch) | |
tree | e1b01c59dc6bd3050ee0c4c5cba1cb08f7a48b09 | |
parent | 5b06ba2378e177fdb8f100adda6e55b205308202 (diff) | |
download | linux-sync_file.tar.gz |
dma-buf/sync_file: add debug to track sync_filessync_file
Track creating and removal of sync_files in debugfs when using
the SW_SYNC framework to test sync file infrastructure.
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
-rw-r--r-- | drivers/dma-buf/sync_file.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c index 2321035f6204bc..9ff8943c53ef8b 100644 --- a/drivers/dma-buf/sync_file.c +++ b/drivers/dma-buf/sync_file.c @@ -26,6 +26,8 @@ #include <linux/sync_file.h> #include <uapi/linux/sync_file.h> +#include "sync_debug.h" + static const struct file_operations sync_file_fops; static struct sync_file *sync_file_alloc(void) @@ -87,6 +89,7 @@ struct sync_file *sync_file_create(struct dma_fence *fence) fence->ops->get_timeline_name(fence), fence->context, fence->seqno); + sync_file_debug_add(sync_file); return sync_file; } EXPORT_SYMBOL(sync_file_create); @@ -269,6 +272,7 @@ static struct sync_file *sync_file_merge(const char *name, struct sync_file *a, } strlcpy(sync_file->name, name, sizeof(sync_file->name)); + sync_file_debug_add(sync_file); return sync_file; err: @@ -285,6 +289,8 @@ static void sync_file_free(struct kref *kref) if (test_bit(POLL_ENABLED, &sync_file->fence->flags)) dma_fence_remove_callback(sync_file->fence, &sync_file->cb); dma_fence_put(sync_file->fence); + + sync_file_debug_remove(sync_file); kfree(sync_file); } |