diff --git a/include/execinfo.h b/include/execinfo.h index ae3a555daa..acee5f273a 100644 --- a/include/execinfo.h +++ b/include/execinfo.h @@ -33,20 +33,9 @@ * Pre-processor Definitions ****************************************************************************/ -#if defined(CONFIG_SCHED_BACKTRACE) - -/* Store up to SIZE return address of the current back trace in - * ARRAY and return the exact number of values stored. - */ - -# define backtrace(buffer, size) sched_backtrace(_SCHED_GETTID(), \ - buffer, size, 0) -# define dump_stack() sched_dumpstack(_SCHED_GETTID()) - -#else -# define backtrace(buffer, size) 0 -# define dump_stack() -#endif +#define backtrace(buffer, size) sched_backtrace(_SCHED_GETTID(), \ + buffer, size, 0) +#define dump_stack() sched_dumpstack(_SCHED_GETTID()) /**************************************************************************** * Public Function Prototypes diff --git a/include/sched.h b/include/sched.h index 79de62b854..f1b77408bd 100644 --- a/include/sched.h +++ b/include/sched.h @@ -267,8 +267,13 @@ bool sched_idletask(void); /* Task Backtrace */ +#ifdef CONFIG_SCHED_BACKTRACE int sched_backtrace(pid_t tid, FAR void **buffer, int size, int skip); void sched_dumpstack(pid_t tid); +#else +# define sched_backtrace(tid, buffer, size, skip) 0 +# define sched_dumpstack(tid) +#endif #undef EXTERN #if defined(__cplusplus)