Creating debugfs files
debugfs debugfs is a pseudo-filesystem used for kernel debugging. It is usually mounted at /sys/kernel/debug. debugfs contains files that allow us to read debugging information.
By default, only the root user can cd into the /sys/kernel/debug directory.
To change it to allow the current user to cd into debugfs, we can remount it with uid set to the current user’s uid.
sudo umount /sys/kernel/debug sudo mount -t debugfs none /sys/kernel/debug -o uid=`echo $UID` cd /sys/kernel/debug Creating debugfs entries Creating debugfs files is similar to creating character device files.