net: buf: Add debug for fragments

net_buf_unref actually unrefs the fragments but it only logs information
of the parent.

Change-Id: I03208f250d030b7927d68c8da442f830f6070dc3
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2016-11-25 16:02:47 +02:00 committed by Anas Nashif
commit 2de6e8da4d

View file

@ -135,12 +135,17 @@ void net_buf_put(struct k_fifo *fifo, struct net_buf *buf)
void net_buf_unref(struct net_buf *buf)
{
NET_BUF_ASSERT(buf);
while (buf) {
struct net_buf *frags = buf->frags;
NET_BUF_ASSERT(buf->ref > 0);
NET_BUF_DBG("buf %p ref %u fifo %p frags %p", buf, buf->ref,
buf->free, buf->frags);
while (buf && --buf->ref == 0) {
struct net_buf *frags = buf->frags;
if (--buf->ref > 0) {
return;
}
buf->frags = NULL;