Skip to content
  1. Sep 25, 2009
    • Frederic Weisbecker's avatar
      tracing/filters: Unify the regex parsing helpers · 3f6fe06d
      Frederic Weisbecker authored
      
      
      The filter code has stolen the regex parsing function from ftrace to
      get the regex support.
      We have duplicated this code, so factorize it in the filter area and
      make it generally available, as the filter code is the most suited to
      host this feature.
      
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      3f6fe06d
    • Frederic Weisbecker's avatar
      tracing/filters: Provide basic regex support · 1889d209
      Frederic Weisbecker authored
      
      
      This patch provides basic support for regular expressions in filters.
      
      It supports the following types of regexp:
      
      - *match_beginning
      - *match_middle*
      - match_end*
      - !don't match
      
      Example:
      	cd /debug/tracing/events/bkl/lock_kernel
      	echo 'file == "*reiserfs*"' > filter
      	echo 1 > enable
      
                 gedit-4941  [000]   457.735437: lock_kernel: depth: 0, fs/reiserfs/namei.c:334 reiserfs_lookup()
           sync_supers-227   [001]   461.379985: lock_kernel: depth: 0, fs/reiserfs/super.c:69 reiserfs_sync_fs()
           sync_supers-227   [000]   461.383096: lock_kernel: depth: 0, fs/reiserfs/journal.c:1069 flush_commit_list()
            reiserfs/1-1369  [001]   461.479885: lock_kernel: depth: 0, fs/reiserfs/journal.c:3509 flush_async_commits()
      
      Every string is now handled as a regexp in the filter framework, which
      helps to factorize the code for handling both simple strings and
      regexp comparisons.
      
      (The regexp parsing code has been wildly cherry picked from ftrace.c
      written by Steve.)
      
      v2: Simplify the whole and drop the filter_regex file
      
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      1889d209
  2. Sep 24, 2009
    • Frederic Weisbecker's avatar
      tracing/event: Cleanup the useless dentry variable · f3f3f009
      Frederic Weisbecker authored
      
      
      Cleanup the useless dentry variable while creating a kernel
      event set of files. trace_create_file() warns if it fails to
      create the file anyway, and we don't store the dentry anywhere.
      
      v2: Fix a small conflict in kernel/trace/trace_events.c
      
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      f3f3f009
    • Frederic Weisbecker's avatar
      tracing/filters: Cleanup useless headers · 737f453f
      Frederic Weisbecker authored
      
      
      Cleanup remaining headers inclusion that were only useful when
      the filter framework and its tracing related filesystem user interface
      weren't yet separated.
      
      v2: Keep module.h, needed for EXPORT_SYMBOL_GPL
      
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      737f453f
    • Frederic Weisbecker's avatar
      tracing/bkl: Add bkl ftrace events · 96a2c464
      Frederic Weisbecker authored
      
      
      Add two events lock_kernel and unlock_kernel() to trace the bkl uses.
      This opens the door for userspace tools to perform statistics about
      the callsites that use it, dependencies with other locks (by pairing
      the trace with lock events), use with recursivity and so on...
      
      The {__reacquire,release}_kernel_lock() events are not traced because
      these are called from schedule, thus the sched events are sufficient
      to trace them.
      
      Example of a trace:
      
      hald-addon-stor-4152  [000]   165.875501: unlock_kernel: depth: 0, fs/block_dev.c:1358 __blkdev_put()
      hald-addon-stor-4152  [000]   167.832974: lock_kernel: depth: 0, fs/block_dev.c:1167 __blkdev_get()
      
      How to get the callsites that acquire it recursively:
      
      cd /debug/tracing/events/bkl
      echo "lock_depth > 0" > filter
      
      firefox-4951  [001]   206.276967: unlock_kernel: depth: 1, fs/reiserfs/super.c:575 reiserfs_dirty_inode()
      
      You can also filter by file and/or line.
      
      v2: Use of FILTER_PTR_STRING attribute for files and lines fields to
          make them traceable.
      
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      96a2c464
  3. Sep 18, 2009
  4. Sep 17, 2009
  5. Sep 16, 2009