mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
fs/inode: add optional manual FD backtrace control via task group flag
When CONFIG_FS_BACKTRACE is enabled, collecting a stack trace for every new file descriptor adds overhead to fast path operations like open(), dup(), and socket(). This patch adds a new configuration option CONFIG_FS_BACKTRACE_DEFAULT. When enabled (default behavior), the GROUP_FLAG_FD_BACKTRACE flag is automatically set during group allocation, causing backtrace to be captured for all tasks globally, preserving the original diagnostic capability. When disabled, backtrace capture is zero-cost by default and must be explicitly enabled per task group using GROUP_FLAG_FD_BACKTRACE. Signed-off-by: zhanxiaoqi <zhanxiaoqi@bytedance.com>
This commit is contained in:
parent
62b71c3b30
commit
786b315947
4 changed files with 32 additions and 6 deletions
|
|
@ -163,6 +163,12 @@ int group_allocate(FAR struct tcb_s *tcb, uint8_t ttype)
|
|||
sq_init(&group->tg_members);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FS_BACKTRACE_DEFAULT
|
||||
/* Enable FD backtrace for the group by default */
|
||||
|
||||
group->tg_flags |= GROUP_FLAG_FD_BACKTRACE;
|
||||
#endif
|
||||
|
||||
/* Attach the group to the TCB */
|
||||
|
||||
tcb->group = group;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue