Inspect ftrace config in /proc/sys/kernel
In addition to the debug file system interface at /sys/kernel/debug/tracing
, some ftrace
related configurations can also be found in the /proc/sys/kernel
directory. The /proc
file system is a virtual file system that provides information about processes and other system information. The /proc/sys
directory contains files that allow you to view and modify kernel parameters at runtime.
Let's inspect some files in /proc/sys/kernel
that are related to ftrace
. We can use the cat
command to view the content of these files.
First, let's check the ftrace_enabled
file. This file indicates whether ftrace
is currently enabled in the kernel.
Type the following command in your terminal and press Enter:
cat /proc/sys/kernel/ftrace_enabled
You should see an output like this:
1
A value of 1
means ftrace
is enabled, and 0
means it is disabled.
Next, let's look at the ftrace_dump_on_oops
file. This file controls whether the ftrace
buffer is dumped to the console when a kernel oops (a kernel error) occurs.
Type the following command and press Enter:
cat /proc/sys/kernel/ftrace_dump_on_oops
The output will likely be:
1
A value of 1
means the ftrace
buffer will be dumped on a kernel oops, which can be helpful for debugging.
Finally, let's check the ftrace_filter_notrace_regex
file. This file contains a regular expression that can be used to filter which functions are not traced when using function tracing.
Type the following command and press Enter:
cat /proc/sys/kernel/ftrace_filter_notrace_regex
The output might be empty or contain a regular expression, depending on the system's configuration:
These files in /proc/sys/kernel
provide a glimpse into some global ftrace
settings. While most detailed configuration and data access happen through /sys/kernel/debug/tracing
, these files offer a quick way to check the overall status and some basic behaviors of ftrace
.
You have now explored the main interfaces for interacting with ftrace
: the debug file system and the /proc/sys/kernel
directory.
Click Continue to complete this lab.