是否可以在没有debugfs的情况下使用ftrace?

时间:2022-11-24 16:52:03

I was going through a Linux KERNEL configuration file wherein function_trace is enabled but debugfs is disabled. If i load this kernel onto the target is there any way, I can make use of the function_tracer ? if debugfs is disabled is it that the function tracer is not enabled by default ?

我正在浏览Linux KERNEL配置文件,其中启用了function_trace但禁用了debugfs。如果我将这个内核加载到目标上有什么办法,我可以使用function_tracer吗?如果debugfs被禁用,那么默认情况下不启用函数跟踪器吗?

1 个解决方案

#1


1  

Technically it's not possible to select function_trace without debugfs enabled. As per tracing configuration file (https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/trace/Kconfig#n140), it suggest that - if you select FUNCTION_TRACER, it'll automatically select GENERIC_TRACER and when GENERIC_TRACER is selected this will automatically select TRACING (https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/trace/Kconfig#n112) and when TRACING is selected it'll select DEBUG_FS (https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/trace/Kconfig#n101).

从技术上讲,如果没有启用debugfs,就无法选择function_trace。根据跟踪配置文件(https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/trace/Kconfig#n140),它建议 - 如果选择FUNCTION_TRACER,它将自动选择GENERIC_TRACER,当选择GENERIC_TRACER时,它将自动选择TRACING(https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/trace/Kconfig#n112并且当选择TRACING时,它将选择DEBUG_FS(https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/trace/Kconfig#n101)。

So, it's a linked list of selection procedure and you do not need to select each option every time. Until unless you've modified config file by hand and it's not recommended.

因此,它是选择过程的链接列表,您不需要每次都选择每个选项。除非您手动修改配置文件,否则不建议使用。

#1


1  

Technically it's not possible to select function_trace without debugfs enabled. As per tracing configuration file (https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/trace/Kconfig#n140), it suggest that - if you select FUNCTION_TRACER, it'll automatically select GENERIC_TRACER and when GENERIC_TRACER is selected this will automatically select TRACING (https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/trace/Kconfig#n112) and when TRACING is selected it'll select DEBUG_FS (https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/trace/Kconfig#n101).

从技术上讲,如果没有启用debugfs,就无法选择function_trace。根据跟踪配置文件(https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/trace/Kconfig#n140),它建议 - 如果选择FUNCTION_TRACER,它将自动选择GENERIC_TRACER,当选择GENERIC_TRACER时,它将自动选择TRACING(https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/trace/Kconfig#n112并且当选择TRACING时,它将选择DEBUG_FS(https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/kernel/trace/Kconfig#n101)。

So, it's a linked list of selection procedure and you do not need to select each option every time. Until unless you've modified config file by hand and it's not recommended.

因此,它是选择过程的链接列表,您不需要每次都选择每个选项。除非您手动修改配置文件,否则不建议使用。