Use BACKTRACE_BUFFER_SIZE to declare backtrace buffer

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
xuxingliang 2024-06-26 23:05:06 +08:00 committed by Xiang Xiao
parent 3fad764804
commit a8b7d26db5
2 changed files with 2 additions and 2 deletions

View file

@ -197,7 +197,7 @@ static void mempool_memdump_callback(FAR struct mempool_s *pool,
if ((MM_DUMP_ASSIGN(dump, buf) || MM_DUMP_ALLOC(dump, buf) || if ((MM_DUMP_ASSIGN(dump, buf) || MM_DUMP_ALLOC(dump, buf) ||
MM_DUMP_LEAK(dump, buf)) && MM_DUMP_SEQNO(dump, buf)) MM_DUMP_LEAK(dump, buf)) && MM_DUMP_SEQNO(dump, buf))
{ {
char tmp[CONFIG_MM_BACKTRACE * BACKTRACE_PTR_FMT_WIDTH + 1] = ""; char tmp[BACKTRACE_BUFFER_SIZE(CONFIG_MM_BACKTRACE)];
# if CONFIG_MM_BACKTRACE > 0 # if CONFIG_MM_BACKTRACE > 0
FAR const char *format = " %0*p"; FAR const char *format = " %0*p";

View file

@ -540,7 +540,7 @@ static void dump_tasks(void)
#if CONFIG_LIBC_MUTEX_BACKTRACE > 0 #if CONFIG_LIBC_MUTEX_BACKTRACE > 0
static void dump_lockholder(pid_t tid) static void dump_lockholder(pid_t tid)
{ {
char buf[CONFIG_LIBC_MUTEX_BACKTRACE * BACKTRACE_PTR_FMT_WIDTH + 1] = ""; char buf[BACKTRACE_BUFFER_SIZE(CONFIG_LIBC_MUTEX_BACKTRACE)];
FAR mutex_t *mutex; FAR mutex_t *mutex;
mutex = (FAR mutex_t *)nxsched_get_tcb(tid)->waitobj; mutex = (FAR mutex_t *)nxsched_get_tcb(tid)->waitobj;