• Ross Zwisler's avatar
    dax: add tracepoint infrastructure, PMD tracing · 282a8e03
    Ross Zwisler authored
    Tracepoints are the standard way to capture debugging and tracing
    information in many parts of the kernel, including the XFS and ext4
    filesystems.  Create a tracepoint header for FS DAX and add the first DAX
    tracepoints to the PMD fault handler.  This allows the tracing for DAX to
    be done in the same way as the filesystem tracing so that developers can
    look at them together and get a coherent idea of what the system is doing.
    
    I added both an entry and exit tracepoint because future patches will add
    tracepoints to child functions of dax_iomap_pmd_fault() like
    dax_pmd_load_hole() and dax_pmd_insert_mapping().  We want those messages
    to be wrapped by the parent function tracepoints so the code flow is more
    easily understood.  Having entry and exit tracepoints for faults also
    allows us to easily see what filesystems functions were called during the
    fault.  These filesystem functions get executed via iomap_begin() and
    iomap_end() calls, for example, and will have their own tracepoints.
    
    For PMD faults we primarily want to understand the type of mapping, the
    fault flags, the faulting address and whether it fell back to 4k faults.
    If it fell back to 4k faults the tracepoints should let us understand why.
    
    I named the new tracepoint header file "fs_dax.h" to allow for device DAX
    to have its own separate tracing header in the same directory at some
    point.
    
    Here is an example output for these events from a successful PMD fault:
    
      big-1441  [005] ....    32.582758: xfs_filemap_pmd_fault: dev 259:0 ino 0x1003
    
      big-1441  [005] ....    32.582776: dax_pmd_fault: dev 259:0 ino 0x1003
      shared WRITE|ALLOW_RETRY|KILLABLE|USER address 0x10505000 vm_start 0x10200000 vm_end 0x10700000 pgoff 0x200 max_pgoff 0x1400
    
      big-1441  [005] ....    32.583292: dax_pmd_fault_done: dev 259:0 ino 0x1003
      shared WRITE|ALLOW_RETRY|KILLABLE|USER address 0x10505000 vm_start 0x10200000 vm_end 0x10700000 pgoff 0x200 max_pgoff 0x1400 NOPAGE
    
    Link: http://lkml.kernel.org/r/1484085142-2297-3-git-send-email-ross.zwisler@linux.intel.comSigned-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
    Suggested-by: default avatarDave Chinner <david@fromorbit.com>
    Reviewed-by: default avatarJan Kara <jack@suse.cz>
    Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
    Cc: Dave Jiang <dave.jiang@intel.com>
    Cc: Matthew Wilcox <mawilcox@microsoft.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    282a8e03
fs_dax.h 1.99 KB