fix(nimble): Nimble Error logs in case of memory overflow/failure

This commit is contained in:
Abhinav Kudnar
2024-06-21 17:40:54 +05:30
parent ca6c6173fc
commit da900069fb
2 changed files with 8 additions and 0 deletions
+3
View File
@@ -35,6 +35,7 @@
#include "os/os.h"
#include "os/os_trace_api.h"
#include "modlog/modlog.h"
#include <assert.h>
#include <stddef.h>
@@ -186,6 +187,7 @@ os_msys_get(uint16_t dsize, uint16_t leadingspace)
m = os_mbuf_get(pool, leadingspace);
return (m);
err:
MODLOG_DFLT(INFO,"_os_msys_find_pool failed (size %u)\n",dsize);
return (NULL);
}
@@ -205,6 +207,7 @@ os_msys_get_pkthdr(uint16_t dsize, uint16_t user_hdr_len)
m = os_mbuf_get_pkthdr(pool, user_hdr_len);
return (m);
err:
MODLOG_DFLT(INFO,"_os_msys_find_pool failed (size %u)\n",dsize);
return (NULL);
}
+5
View File
@@ -24,6 +24,7 @@
#include <assert.h>
#include <stdbool.h>
#include "syscfg/syscfg.h"
#include "modlog/modlog.h"
#if !MYNEWT_VAL(OS_SYSVIEW_TRACE_MEMPOOL)
#define OS_TRACE_DISABLE_FILE_API
#endif
@@ -373,6 +374,10 @@ os_memblock_get(struct os_mempool *mp)
os_trace_api_ret_u32(OS_TRACE_ID_MEMBLOCK_GET, (uint32_t)(uintptr_t)block);
if(!block){
MODLOG_DFLT(INFO,"os_memblock_get failed (size %u)\n",sizeof *block);
}
return (void *)block;
}