Files
zhanxiaoqi 786b315947 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>
2026-04-28 09:53:27 +02:00

112 lines
2.2 KiB
Plaintext

#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config EVENT_FD
bool "EventFD"
default n
---help---
Create a file descriptor for event notification
if EVENT_FD
config EVENT_FD_POLL
bool "EventFD poll support"
default y
---help---
Poll support for file descriptor based events
config EVENT_FD_NPOLLWAITERS
int "Number of eventFD poll waiters"
default 2
depends on EVENT_FD_POLL
---help---
Maximum number of threads that can be waiting on poll()
endif # EVENT_FD
config TIMER_FD
bool "TimerFD"
default n
---help---
Create a file descriptor for timer notification
if TIMER_FD
config TIMER_FD_POLL
bool "TimerFD poll support"
default y
---help---
Poll support for file descriptor based timers
config TIMER_FD_NPOLLWAITERS
int "Number of timerFD poll waiters"
default 2
depends on TIMER_FD_POLL
---help---
Maximum number of threads that can be waiting on poll()
endif # TIMER_FD
config SIGNAL_FD
bool "SignalFD"
depends on !DISABLE_ALL_SIGNALS
default n
---help---
Create a file descriptor for accepting signals
if SIGNAL_FD
config SIGNAL_FD_NPOLLWAITERS
int "Number of signalFD poll waiters"
default 2
---help---
Maximum number of threads that can be waiting on poll()
endif # SIGNAL_FD
config FS_NOTIFY
bool "FS Notify System"
default n
---help---
The Fsnotify System
if FS_NOTIFY
config FS_NOTIFY_BUCKET_SIZE
int "Dir hash bucket size"
default 64
config FS_NOTIFY_MAX_EVENTS
int "Max events in one notify device"
default 1024
config FS_NOTIFY_FD_POLLWAITERS
int "Max pollwaiters in one notify device"
default 2
endif # FS_NOTIFY
config FS_BACKTRACE
int "VFS backtrace"
default 0
---help---
Add backtrace to vfs file open.
config FS_BACKTRACE_SKIP
int "Backtrace to skip"
default 2
depends on FS_BACKTRACE > 0
---help---
Skip depth of backtrace.
config FS_BACKTRACE_DEFAULT
bool "Enable the backtrace record by default"
default y
depends on FS_BACKTRACE > 0
---help---
Enable automatic backtrace capture for all file descriptor operations
globally. When disabled, backtrace capture is zero-cost by default
and must be explicitly enabled per task group by setting the
GROUP_FLAG_FD_BACKTRACE flag.