tracefs is a special-purpose filesystem in Linux used for tracing filesystem and kernel operations.
This was added to the kernel back in 2015 to replace debugfs. For security reasons, some system do not mount debugfs at all. Tracefs reduces the attack surface by allowing to trace without mounting debugfs. Additionally it provides features not supported by debugfs (such as calls for mkdir and rmdir. 1
On NixOS, we currently mount debugfs by default.
Distro support
Debian and Arch Linux both enable this by default.
RHEL 8 and later, they enable tracefs by default. 2
Sample config
Tracefs can be enabled as easily by:
fileSystems."/sys/kernel/tracing" = {
device = "tracefs";
fsType = "tracefs";
};
tracefs is a special-purpose filesystem in Linux used for tracing filesystem and kernel operations.
This was added to the kernel back in 2015 to replace
debugfs. For security reasons, some system do not mountdebugfsat all. Tracefs reduces the attack surface by allowing to trace without mounting debugfs. Additionally it provides features not supported bydebugfs(such as calls formkdirandrmdir. 1On NixOS, we currently mount
debugfsby default.Distro support
Debian and Arch Linux both enable this by default.
RHEL 8 and later, they enable tracefs by default. 2
Sample config
Tracefs can be enabled as easily by:
Footnotes
https://lkml.iu.edu/hypermail/linux/kernel/1501.2/03623.html ↩
https://access.redhat.com/solutions/5914171 ↩