mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
sched/procfs:use instrument to statistics run time max stack
Usage: 1. CONFIG_FS_PROCFS_MAX_STACK_RECORD > 0, such as 32, 2. add '-finstrument-functions' to CFLAGS for What you want to check stack. 3. mount porcfs 4. cat /proc/<pid>/stack will print backtace & size Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
@@ -251,6 +251,10 @@
|
||||
|
||||
# define noinstrument_function __attribute__((no_instrument_function))
|
||||
|
||||
/* The nooptimiziation_function attribute no optimize */
|
||||
|
||||
# define nooptimiziation_function __attribute__((optimize(0)))
|
||||
|
||||
/* The nosanitize_address attribute informs GCC don't sanitize it */
|
||||
|
||||
# define nosanitize_address __attribute__((no_sanitize_address))
|
||||
@@ -555,6 +559,7 @@
|
||||
# define always_inline_function
|
||||
# define noinline_function
|
||||
# define noinstrument_function
|
||||
# define nooptimiziation_function
|
||||
# define nosanitize_address
|
||||
# define nosanitize_undefined
|
||||
# define nostackprotect_function
|
||||
@@ -698,6 +703,7 @@
|
||||
# define always_inline_function
|
||||
# define noinline_function
|
||||
# define noinstrument_function
|
||||
# define nooptimiziation_function
|
||||
# define nosanitize_address
|
||||
# define nosanitize_undefined
|
||||
# define nostackprotect_function
|
||||
@@ -809,6 +815,7 @@
|
||||
# define always_inline_function
|
||||
# define noinline_function
|
||||
# define noinstrument_function
|
||||
# define nooptimiziation_function
|
||||
# define nosanitize_address
|
||||
# define nosanitize_undefined
|
||||
# define nostackprotect_function
|
||||
@@ -899,6 +906,7 @@
|
||||
# define always_inline_function
|
||||
# define noinline_function
|
||||
# define noinstrument_function
|
||||
# define nooptimiziation_function
|
||||
# define nosanitize_address
|
||||
# define nosanitize_undefined
|
||||
# define nostackprotect_function
|
||||
@@ -964,6 +972,7 @@
|
||||
# define always_inline_function
|
||||
# define noinline_function
|
||||
# define noinstrument_function
|
||||
# define nooptimiziation_function
|
||||
# define nosanitize_address
|
||||
# define nosanitize_undefined
|
||||
# define nostackprotect_function
|
||||
|
||||
@@ -645,6 +645,17 @@ struct tcb_s
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
char name[CONFIG_TASK_NAME_SIZE + 1]; /* Task name (with NUL terminator */
|
||||
#endif
|
||||
|
||||
#if CONFIG_SCHED_STACK_RECORD > 0
|
||||
FAR void *stackrecord_pc[CONFIG_SCHED_STACK_RECORD];
|
||||
FAR void *stackrecord_sp[CONFIG_SCHED_STACK_RECORD];
|
||||
FAR void *stackrecord_pc_deepest[CONFIG_SCHED_STACK_RECORD];
|
||||
FAR void *stackrecord_sp_deepest[CONFIG_SCHED_STACK_RECORD];
|
||||
FAR void *sp_deepest;
|
||||
size_t caller_deepest;
|
||||
size_t level_deepest;
|
||||
size_t level;
|
||||
#endif
|
||||
};
|
||||
|
||||
/* struct task_tcb_s ********************************************************/
|
||||
|
||||
Reference in New Issue
Block a user