sched: Guard backtrace related code correctly
1.Don't include unwind.h when arch specific backtrace is enable 2.Built arch specific backtrace wrapper only when enable Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
1cd9fa25cd
commit
8c80b3d908
|
@ -24,15 +24,13 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#ifndef CONFIG_ARCH_HAVE_BACKTRACE
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <execinfo.h>
|
||||
#include <unwind.h>
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
#if !defined(CONFIG_ARCH_HAVE_BACKTRACE)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data Types
|
||||
****************************************************************************/
|
||||
|
|
|
@ -99,7 +99,7 @@ ifeq ($(CONFIG_SCHED_CRITMONITOR),y)
|
|||
CSRCS += sched_critmonitor.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ARCH_HAVE_BACKTRACE),y)
|
||||
ifeq ($(CONFIG_SCHED_BACKTRACE),y)
|
||||
CSRCS += sched_backtrace.c
|
||||
endif
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_HAVE_BACKTRACE
|
||||
int sched_backtrace(pid_t tid, FAR void **buffer, int size, int skip)
|
||||
{
|
||||
FAR struct tcb_s *rtcb = NULL;
|
||||
|
@ -55,3 +56,4 @@ int sched_backtrace(pid_t tid, FAR void **buffer, int size, int skip)
|
|||
|
||||
return up_backtrace(rtcb, buffer, size, skip);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue