0%

Resources for Debugging FUSE Filesystem

Debugging FUSE Filesystem.

Collect some tip/tricks for debugging FUSE.

Program options

  1. -f : Run foreground
  2. -s : Disable multiple threading
  1. Enable debugging
    1. Compiling with debugging symbols enabled(-g to gcc)
    2. enable core dumps: ulimit -c unlimited
    3. If program crashes, it will have core dump in current directory
    4. load the core file: `gdb

Tools

  1. Valgrind: Valgrind is an instrumentation framework for building dynamic analysis tools.

    #include <valgrind/valgrind.h>
    
    if (RUNNING_ON_VALGRIND) {
        fprintf(stderr,
            "******** Valgrind has been detected by %s\n"
            "******** If you have difficulties getting %s to work under"
            " Valgrind,\n"
            "******** see the following thread:\n"
            "******** http://www.nabble.com/valgrind-and-fuse-file-systems"
            "-td13112112.html\n"
            "******** Sleeping for 5 seconds so this doesn't fly by ....",
                progname, progname);
        sleep(5);
        fprintf(stderr, "\n");
    }

    Reference: Code from Tim Post

  2. User-Mode Linux

Documents/Tutorials

  1. CS135 FUSE Document
  2. Use GDB to Understand FUSE File System