mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
CONFIG_DEBUG_DMA_BUF_REF will collect stacktraces for each call to dma_buf_get and dma_buf_put to help identify leaks. Change-Id: If299d73fbde80fc41d2a2150c4b6b8e7223734fa Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
37 lines
1.1 KiB
C
37 lines
1.1 KiB
C
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 and
|
|
* only version 2 as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#ifndef _DMA_BUF_REF_H
|
|
#define _DMA_BUF_REF_H
|
|
|
|
struct dma_buf;
|
|
struct seq_file;
|
|
|
|
#ifdef CONFIG_DEBUG_DMA_BUF_REF
|
|
void dma_buf_ref_init(struct dma_buf *b);
|
|
void dma_buf_ref_destroy(struct dma_buf *b);
|
|
void dma_buf_ref_mod(struct dma_buf *b, int nr);
|
|
int dma_buf_ref_show(struct seq_file *s, struct dma_buf *dmabuf);
|
|
|
|
#else
|
|
static inline void dma_buf_ref_init(struct dma_buf *b) {}
|
|
static inline void dma_buf_ref_destroy(struct dma_buf *b) {}
|
|
static inline void dma_buf_ref_mod(struct dma_buf *b, int nr) {}
|
|
static inline int dma_buf_ref_show(struct seq_file *s, struct dma_buf *dmabuf)
|
|
{
|
|
return -ENOMEM;
|
|
}
|
|
#endif
|
|
|
|
|
|
#endif /* _DMA_BUF_REF_H */
|