WARNING: This is the _old_ Lustre wiki, and it is in the process of being retired. The information found here is all likely to be out of date. Please search the new wiki for more up to date information.
Diagnostic and Debugging Tools
Tools Available for Debugging & Analysis
There are several diagnostic tools available to debug Lustre; some are provided by the operating system, while others were developed and made available by the Lustre project.
Lustre Debugging Tools
In-kernel debug mechanisms
- debug logs: When a kernel module is first inserted, a circular debug buffer is allocated to hold substantial amount of debugging information (in megabytes or more). When the buffer fills up, it wraps around and discards the oldest information. We have added debug messages specifically for Lustre; they can be written out to this kernel log.
- debug daemon: The debug daemon provides the facility for unlimited logging of the CDEBUG logs in Lustre.
- /proc/sys/lnet/debug: Contains a mask that can be used to delimit the debugging information written out to the kernel debug logs.
Other internal tools
- lctl: This tool is made available by Lustre. It is very useful to filter the kernel and extract useful information.
- Lustre subsystem asserts: In case of asserts, a log will be written out to /tmp/lustre_log.<timestamp>.
- lfs: A Lustre utility that can be used to get to a Lustre file's extended attributes (among other things).
External debugging tools for administrators and developers
- strace: Allows Lustre users to trace a system call.
- /var/log/messages: The directory to which fatal or serious messages are printed by the syslogd.
- Crash dumps: On some kernels, a sysrq "c" is enabled which produces a crash dump. Lustre enhances this crash dump with a log dump (the last 64K of log) to the console.
- debugfs: An nteractive Ext2 filesystem debugger.
Logging and data collection tools These logging and data collection tools can be used to collect information for debugging Lustre kernel issues.
kdump is a Linux kernel crash utility useful for debugging a system running Red Hat Enterprise Linux. For more information about kdump, see the Red Hat knowledge base article How do I configure kexec/kdump on Red Hat Enterprise Linux 5?. To download kdump, go to the Fedora Project Download site. Links are good
netdump is a crash dump utility from Red Hat that allows memory images to be dumped over a network to a central server for analysis. It is now obsolete and has been replaced by kdump. Check this with brian or cfaber.
netconsole supports kernel-level network logging over UDP. A system requires (SysRq) allows users to collect relevant data through netconsole. For more information, see Netconsole.
Additional external debugging and analysis tools for developers
- leak_finder.pl: An extremely useful program that helps locate memory leaks in the code.
The tools described below may be useful for debugging Lustre™ in a development environment.
A virtual machine is often used to create an isolated development and test environment.
VirtualBox Open Source Edition provides enterprise-class virtualization capability for all major platforms and is available free from Sun Microsystems at Get Sun Virtual Box.
The VMware Server virtualization platform is available as free introductory software at Download VMware Server.
Xen is a para-virtualized environment with virtualization capabilities similar to VMware Server and Virtual Box. However, Xen allows the use of modified kernels to provide near-native performance and the ability to emulate shared storage. For more information, see Using Xen with Lustre. link to xen.org
Debuggers and Analysis Tools
kgdb is a source-level kernel debugger that allows remote debugging using conman.
kgdb provides a special set of hooks for a Linux kernel to attach gdb from another machine over a serial console. We provide kgdb patches for some kernels like rhel4 with the Lustre patches (these are not patched in by default).
Also see Chapter 6. Running Programs Under gdb in the Red Hat Linux 4 Debugging with GDB guide.
lcrash - Linux crash dump analyzer generic Linux tool - find link
crash is used to analyze saved crash dump data.
crash vmlinux crash_dump
For more information about using crash to analyze crash dump output, see:
- Red Hat Magazine article A quick overview of Linux kernel crash dump analysis.
- Crash Usage: A Case Study from the white paper Red Hat Crash Utility by David Anderson.
- Kernel Trap forum entry Linux: Kernel Crash Dumps.
- White paper A Quick Overview of Linux Kernel Crash Dump Analysis.