qcacmn: Add nbuf history for clone and copy
The network buffer (nbuf) history records the usual nbuf allocations and frees, but does not record allocations due to copies or clones. Record these allocations in the nbuf history as well to aid in debugging. Change-Id: If5bed9a41d301d43a1e610df4366d0bcf2c3efc4 CRs-Fixed: 2379866
This commit is contained in:
@@ -1402,27 +1402,16 @@ void qdf_nbuf_free_debug(qdf_nbuf_t nbuf, const char *func, uint32_t line);
|
||||
/**
|
||||
* qdf_nbuf_clone_debug() - clone the nbuf (copy is readonly)
|
||||
* @buf: nbuf to clone from
|
||||
* @func_name: pointer to function name
|
||||
* @line_num: line number
|
||||
* @func: name of the calling function
|
||||
* @line: line number of the callsite
|
||||
*
|
||||
* This function clones the nbuf and creates a memory tracking
|
||||
* node corresponding to that cloned skbuff structure.
|
||||
*
|
||||
* Return: cloned buffer
|
||||
*/
|
||||
static inline qdf_nbuf_t
|
||||
qdf_nbuf_clone_debug(qdf_nbuf_t buf, const char *func_name, uint32_t line_num)
|
||||
{
|
||||
qdf_nbuf_t cloned_buf;
|
||||
|
||||
cloned_buf = __qdf_nbuf_clone(buf);
|
||||
|
||||
/* Store SKB in internal QDF tracking table */
|
||||
if (qdf_likely(cloned_buf))
|
||||
qdf_net_buf_debug_add_node(cloned_buf, 0, func_name, line_num);
|
||||
|
||||
return cloned_buf;
|
||||
}
|
||||
qdf_nbuf_t qdf_nbuf_clone_debug(qdf_nbuf_t buf, const char *func,
|
||||
uint32_t line);
|
||||
|
||||
#define qdf_nbuf_copy(buf) \
|
||||
qdf_nbuf_copy_debug(buf, __func__, __LINE__)
|
||||
@@ -1430,8 +1419,8 @@ qdf_nbuf_clone_debug(qdf_nbuf_t buf, const char *func_name, uint32_t line_num)
|
||||
/**
|
||||
* qdf_nbuf_copy_debug() - returns a private copy of the buf
|
||||
* @buf: nbuf to copy from
|
||||
* @func_name: pointer to function name
|
||||
* @line_num: line number
|
||||
* @func: name of the calling function
|
||||
* @line: line number of the callsite
|
||||
*
|
||||
* This API returns a private copy of the buf, the buf returned is completely
|
||||
* modifiable by callers. It also creates a memory tracking node corresponding
|
||||
@@ -1439,19 +1428,7 @@ qdf_nbuf_clone_debug(qdf_nbuf_t buf, const char *func_name, uint32_t line_num)
|
||||
*
|
||||
* Return: copied buffer
|
||||
*/
|
||||
static inline qdf_nbuf_t
|
||||
qdf_nbuf_copy_debug(qdf_nbuf_t buf, const char *func_name, uint32_t line_num)
|
||||
{
|
||||
qdf_nbuf_t copied_buf;
|
||||
|
||||
copied_buf = __qdf_nbuf_copy(buf);
|
||||
|
||||
/* Store SKB in internal QDF tracking table */
|
||||
if (qdf_likely(copied_buf))
|
||||
qdf_net_buf_debug_add_node(copied_buf, 0, func_name, line_num);
|
||||
|
||||
return copied_buf;
|
||||
}
|
||||
qdf_nbuf_t qdf_nbuf_copy_debug(qdf_nbuf_t buf, const char *func, uint32_t line);
|
||||
|
||||
#else /* NBUF_MEMORY_DEBUG */
|
||||
|
||||
|
Reference in New Issue
Block a user