23.07.2014 Views

Lustre 1.6 Operations Manual

Lustre 1.6 Operations Manual

Lustre 1.6 Operations Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4. If you already have a debug log saved to disk (likely from a crash), to filter a<br />

log on disk:<br />

lctl > debug_file [output filename]<br />

During the debug session, you can add markers or breaks to the log for any<br />

reason:<br />

lctl > mark [marker text]<br />

The marker text defaults to the current date and time in the debug log (similar to<br />

the example shown below):<br />

DEBUG MARKER: Tue Mar 5 16:06:44 EST 2002<br />

5. To completely flush the kernel debug buffer:<br />

lctl > clear<br />

Note – Debug messages displayed with lctl are also subject to the kernel debug<br />

masks; the filters are additive.<br />

23.2.4 Finding Memory Leaks<br />

Memory leaks can occur in a code where you allocate a memory, but forget to free it<br />

when it becomes non-essential. You can use the leak_finder.pl tool to find<br />

memory leaks. Before running this program, you must turn on the debugging to<br />

collect all malloc and free entries. Run:<br />

sysctl -w lnet.debug=+malloc<br />

Dump the log into a user-specified log file using lctl (as shown in The lctl Tool). Run<br />

the leak finder on the newly-created log dump:<br />

perl leak_finder.pl <br />

The output is:<br />

malloced 8bytes at a3116744 (called pathcopy)<br />

(lprocfs_status.c:lprocfs_add_vars:80)<br />

freed 8bytes at a3116744 (called pathcopy)<br />

(lprocfs_status.c:lprocfs_add_vars:80)<br />

The tool displays the following output to show the leaks found:<br />

Leak:32bytes allocated at a23a8fc<br />

(service.c:ptlrpc_init_svc:144,debug file line 241)<br />

23-8 <strong>Lustre</strong> <strong>1.6</strong> <strong>Operations</strong> <strong>Manual</strong> • September 2008

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!