sched_backtrace: define sched_dumpstack when not enable SCHED_BACKTRACE
Before directly use sched_backtrace() with SCHED_BACKTRACE disable will lead compile error, this commit avoid this problem by define sched_backtrace to 0 when CONFIG_SCHED_BACKTRACE not enable. Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
parent
28cb5e7984
commit
c9e3a0669f
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue