From 9325109cbc5502245c751c5d3a6b1ce064cf29c3 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Fri, 6 Mar 2020 17:14:08 +0200 Subject: [PATCH] net: pkt: Print size of the failed net_buf allocation This information is useful when debugging things. Signed-off-by: Jukka Rissanen --- subsys/net/ip/net_pkt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/subsys/net/ip/net_pkt.c b/subsys/net/ip/net_pkt.c index 9cf619f142e..cb5a54caec3 100644 --- a/subsys/net/ip/net_pkt.c +++ b/subsys/net/ip/net_pkt.c @@ -1151,9 +1151,10 @@ int net_pkt_alloc_buffer(struct net_pkt *pkt, if (!buf) { #if NET_LOG_LEVEL >= LOG_LEVEL_DBG - NET_ERR("Data buffer allocation failed (%s:%d)", caller, line); + NET_ERR("Data buffer (%zd) allocation failed (%s:%d)", + alloc_len, caller, line); #else - NET_ERR("Data buffer allocation failed."); + NET_ERR("Data buffer (%zd) allocation failed.", alloc_len); #endif return -ENOMEM; }