Skip to content

Commit e3cca46

Browse files
author
Tomasz Bursztyka
committed
net: buf: Let's make use of func/line parameters when available
It clutters a bit the code with ifdefs but it's quite useful when debugging. Change-Id: I4f6899d052921b8ef8a7ec2f6e7df927a1bca2f1 Signed-off-by: Tomasz Bursztyka <[email protected]>
1 parent 0a16173 commit e3cca46

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

subsys/net/buf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ struct net_buf *net_buf_alloc(struct net_buf_pool *pool, int32_t timeout)
8080

8181
NET_BUF_ASSERT(pool);
8282

83-
NET_BUF_DBG("pool %p timeout %d", pool, timeout);
83+
NET_BUF_DBG("%s():%d: pool %p timeout %d", func, line, pool, timeout);
8484

8585
/* We need to lock interrupts temporarily to prevent race conditions
8686
* when accessing pool->uninit_count.
@@ -154,15 +154,15 @@ struct net_buf *net_buf_get(struct k_fifo *fifo, int32_t timeout)
154154
{
155155
struct net_buf *buf, *frag;
156156

157-
NET_BUF_DBG("fifo %p timeout %d", fifo, timeout);
157+
NET_BUF_DBG("%s():%d: fifo %p timeout %d", func, line, fifo, timeout);
158158

159159
buf = k_fifo_get(fifo, timeout);
160160
if (!buf) {
161161
NET_BUF_ERR("Failed to get free buffer");
162162
return NULL;
163163
}
164164

165-
NET_BUF_DBG("buf %p fifo %p", buf, fifo);
165+
NET_BUF_DBG("%s():%d: buf %p fifo %p", func, line, buf, fifo);
166166

167167
/* Get any fragments belonging to this buffer */
168168
for (frag = buf; (frag->flags & NET_BUF_FRAGS); frag = frag->frags) {

0 commit comments

Comments
 (0)