Configuring OCFS2 Tracing

Use the following commands and methods to trace issues in OCFS2.

Commands for Tracing OCFS2 Issues

The following commands are useful for tracing OCFS2 issues.

debugfs.ocfs2 -l

Lists all the trace bits and their statuses.

debugfs.ocfs2 -l SUPER allow|off|deny

Allows, disables, or disallows tracing for the superblock. If you specify deny, then even if another tracing mode setting implicitly allows it, tracing is still disallowed.

debugfs.ocfs2 -l HEARTBEAT ENTRY EXIT allow

Enable heartbeat tracing.

debugfs.ocfs2 -l HEARTBEAT off ENTRY EXIT deny

Disable heartbeat tracing. ENTRY and EXIT parameters are set to deny, as these parameters exist in all trace paths.

debugfs.ocfs2 -l ENTRY EXIT NAMEI INODE allow

Enable tracing for the file system.

debugfs.ocfs2 -l ENTRY EXIT deny NAMEI INODE allow

Disable tracing for the file system.

debugfs.ocfs2 -l ENTRY EXIT DLM DLM_THREAD allow

Enable tracing for the DLM.

debugfs.ocfs2 -l ENTRY EXIT deny DLM DLM_THREAD allow

Disable tracing for the DLM.

OCFS2 Tracing Methods and Examples

To obtain a trace, first enable the trace, sleep for a short while, and then disable the trace. To avoid unnecessary output, reset the trace bits to their default settings after you have finished tracing, as shown in the following example:

sudo debugfs.ocfs2 -l ENTRY EXIT NAMEI INODE allow && sleep 10 &&
sudo debugfs.ocfs2 -l ENTRY EXIT deny NAMEI INODE off 

To limit the amount of information that's displayed, enable only the trace bits that are relevant to diagnosing the problem.

If a specific file system command, such as mv, is causing an error, you might use a sequence of commands that are shown in the following example to trace the error:

sudo debugfs.ocfs2 -l ENTRY EXIT NAMEI INODE allow
mv source destination & CMD_PID=$(jobs -p %-)
echo $CMD_PID
sudo debugfs.ocfs2 -l ENTRY EXIT deny NAMEI INODE off

Because the trace is enabled for all mounted OCFS2 volumes, knowing the correct process ID can help you to interpret the trace.

For more information, see the debugfs.ocfs2(8) manual page.