*/
#define DMA_BUF_TRACE(FUNC, ...) \
do { \
- if (FUNC##_enabled()) { \
+ /* Always expose lock if lockdep is enabled */ \
+ if (IS_ENABLED(CONFIG_LOCKDEP) || FUNC##_enabled()) { \
guard(spinlock)(&dmabuf->name_lock); \
FUNC(__VA_ARGS__); \
- } else if (IS_ENABLED(CONFIG_LOCKDEP)) { \
- /* Expose this lock when lockdep is enabled */ \
- guard(spinlock)(&dmabuf->name_lock); \
} \
} while (0)
return -EINVAL;
fd = FD_ADD(flags, dmabuf->file);
- if (fd >= 0)
- DMA_BUF_TRACE(trace_dma_buf_fd, dmabuf, fd);
+ DMA_BUF_TRACE(trace_dma_buf_fd, dmabuf, fd);
return fd;
}
TP_ARGS(dmabuf),
TP_STRUCT__entry(
- __string(exp_name, dmabuf->exp_name)
- __field(size_t, size)
- __field(ino_t, ino)
+ __string( exp_name, dmabuf->exp_name)
+ __field( size_t, size)
+ __field( ino_t, ino)
),
TP_fast_assign(
__assign_str(exp_name);
- __entry->size = dmabuf->size;
- __entry->ino = dmabuf->file->f_inode->i_ino;
+ __entry->size = dmabuf->size;
+ __entry->ino = dmabuf->file->f_inode->i_ino;
),
TP_printk("exp_name=%s size=%zu ino=%lu",
TP_ARGS(dmabuf, attach, is_dynamic, dev),
TP_STRUCT__entry(
- __string(dev_name, dev_name(dev))
- __string(exp_name, dmabuf->exp_name)
- __field(size_t, size)
- __field(ino_t, ino)
- __field(struct dma_buf_attachment *, attach)
- __field(bool, is_dynamic)
+ __string( dev_name, dev_name(dev))
+ __string( exp_name, dmabuf->exp_name)
+ __field( size_t, size)
+ __field( ino_t, ino)
+ __field( struct dma_buf_attachment *, attach)
+ __field( bool, is_dynamic)
),
TP_fast_assign(
__assign_str(dev_name);
__assign_str(exp_name);
- __entry->size = dmabuf->size;
- __entry->ino = dmabuf->file->f_inode->i_ino;
- __entry->is_dynamic = is_dynamic;
- __entry->attach = attach;
+ __entry->size = dmabuf->size;
+ __entry->ino = dmabuf->file->f_inode->i_ino;
+ __entry->is_dynamic = is_dynamic;
+ __entry->attach = attach;
),
TP_printk("exp_name=%s size=%zu ino=%lu attachment:%p is_dynamic=%d dev_name=%s",
TP_ARGS(dmabuf, fd),
TP_STRUCT__entry(
- __string(exp_name, dmabuf->exp_name)
- __field(size_t, size)
- __field(ino_t, ino)
- __field(int, fd)
+ __string( exp_name, dmabuf->exp_name)
+ __field( size_t, size)
+ __field( ino_t, ino)
+ __field( int, fd)
),
TP_fast_assign(
__assign_str(exp_name);
- __entry->size = dmabuf->size;
- __entry->ino = dmabuf->file->f_inode->i_ino;
- __entry->fd = fd;
+ __entry->size = dmabuf->size;
+ __entry->ino = dmabuf->file->f_inode->i_ino;
+ __entry->fd = fd;
),
TP_printk("exp_name=%s size=%zu ino=%lu fd=%d",
TP_ARGS(dmabuf, attach, is_dynamic, dev)
);
-DEFINE_EVENT(dma_buf_fd, dma_buf_fd,
+DEFINE_EVENT_CONDITION(dma_buf_fd, dma_buf_fd,
TP_PROTO(struct dma_buf *dmabuf, int fd),
- TP_ARGS(dmabuf, fd)
+ TP_ARGS(dmabuf, fd),
+
+ TP_CONDITION(fd >= 0)
);
DEFINE_EVENT(dma_buf_fd, dma_buf_get,