1. 12 Dec, 2008 1 commit
  2. 08 Dec, 2008 6 commits
  3. 05 Dec, 2008 5 commits
  4. 04 Dec, 2008 15 commits
    • Frederic Weisbecker's avatar
      tracing/function-graph-tracer: handle ftrace_printk entries · 1fd8f2a3
      Frederic Weisbecker authored
      Handle the TRACE_PRINT entries from the function grapg tracer
      and output them as a C comment just below the function that called
      it, as if it was a comment inside this function.
      
      Example with an ftrace_printk inside might_sleep() function:
      
      void __might_sleep(char *file, int line)
      {
      	static unsigned long prev_jiffy;	/* ratelimiting */
      
      	ftrace_printk("Hi I'm a comment in might_sleep() :-)");
      
      A chunk of a resulting trace:
      
       0)               |        _reiserfs_free_block() {
       0)               |          reiserfs_read_bitmap_block() {
       0)               |            __bread() {
       0)               |              __getblk() {
       0)               |                __find_get_block() {
       0)   0.698 us    |                  mark_page_accessed();
       0)   2.267 us    |                }
       0)               |                __might_sleep() {
       0)               |                  /* Hi I'm a comment in might_sleep() :-) */
       0)   1.321 us    |                }
       0)   5.872 us    |              }
       0)   7.313 us    |            }
       0)   8.718 us    |          }
      
      And this patch brings two minor fixes:
      
      - The newline after a switch-out task has disappeared
      - The "|" sign just before the cpu number on task-switch has been deleted.
      
       0)   0.616 us    |                pick_next_task_rt();
       0)   1.457 us    |                _spin_trylock();
       0)   0.653 us    |                _spin_unlock();
       0)   0.728 us    |                _spin_trylock();
       0)   0.631 us    |                _spin_unlock();
       0)   0.729 us    |                native_load_sp0();
       0)   0.593 us    |                native_load_tls();
       ------------------------------------------
       0)    cat-2834    =>   migrati-3
       ------------------------------------------
      
       0)               |    finish_task_switch() {
       0)   0.841 us    |      _spin_unlock_irq();
       0)   0.616 us    |      post_schedule_rt();
       0)   3.882 us    |    }
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      1fd8f2a3
    • Liming Wang's avatar
      ftrace: avoid duplicated function when writing set_graph_function · faec2ec5
      Liming Wang authored
      Impact: fix a bug in function filter setting
      
      when writing function to set_graph_function, we should check whether it
      has existed in set_graph_function to avoid duplicating.
      Signed-off-by: default avatarLiming Wang <liming.wang@windriver.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      faec2ec5
    • Ingo Molnar's avatar
      tracing: fix typo and missing inline function · 6b253930
      Ingo Molnar authored
      Impact: fix build bugs
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      6b253930
    • Steven Rostedt's avatar
      ftrace: add ability to only trace swapper tasks · e32d8956
      Steven Rostedt authored
      Impact: new feature
      
      This patch lets the swapper tasks of all CPUS be filtered by the
      set_ftrace_pid file.
      
      If '0' is echoed into this file, then all the idle tasks (aka swapper)
      is flagged to be traced.  This affects all CPU idle tasks.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      e32d8956
    • Steven Rostedt's avatar
      ftrace: use struct pid · 978f3a45
      Steven Rostedt authored
      Impact: clean up, extend PID filtering to PID namespaces
      
      Eric Biederman suggested using the struct pid for filtering on
      pids in the kernel. This patch is based off of a demonstration
      of an implementation that Eric sent me in an email.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      978f3a45
    • Steven Rostedt's avatar
      pid: fix the do_each_pid_task() macro · 5ef64761
      Steven Rostedt authored
      Impact: macro side-effects fix
      
      This patch adds parenthesis around 'pid' in the do_each_pid_task
      macro to allow callers to pass in more complex parameters.
      
      e.g.  do_each_pid_task(*pid, type, task)
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      5ef64761
    • Steven Rostedt's avatar
      ftrace: trace single pid for function graph tracer · 804a6851
      Steven Rostedt authored
      Impact: New feature
      
      This patch makes the changes to set_ftrace_pid apply to the function
      graph tracer.
      
        # echo $$ > /debugfs/tracing/set_ftrace_pid
        # echo function_graph > /debugfs/tracing/current_tracer
      
      Will cause only the current task to be traced. Note, the trace flags are
      also inherited by child processes, so the children of the shell
      will also be traced.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      804a6851
    • Steven Rostedt's avatar
      ftrace: use task struct trace flag to filter on pid · 0ef8cde5
      Steven Rostedt authored
      Impact: clean up
      
      Use the new task struct trace flags to determine if a process should be
      traced or not.
      
      Note: this moves the searching of the pid to the slow path of setting
      the pid field. This needs to be converted to the pid name space.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      0ef8cde5
    • Steven Rostedt's avatar
      ftrace: graph of a single function · ea4e2bc4
      Steven Rostedt authored
      This patch adds the file:
      
         /debugfs/tracing/set_graph_function
      
      which can be used along with the function graph tracer.
      
      When this file is empty, the function graph tracer will act as
      usual. When the file has a function in it, the function graph
      tracer will only trace that function.
      
      For example:
      
       # echo blk_unplug > /debugfs/tracing/set_graph_function
       # cat /debugfs/tracing/trace
       [...]
       ------------------------------------------
       | 2)  make-19003  =>  kjournald-2219
       ------------------------------------------
      
       2)               |  blk_unplug() {
       2)               |    dm_unplug_all() {
       2)               |      dm_get_table() {
       2)      1.381 us |        _read_lock();
       2)      0.911 us |        dm_table_get();
       2)      1. 76 us |        _read_unlock();
       2) +   12.912 us |      }
       2)               |      dm_table_unplug_all() {
       2)               |        blk_unplug() {
       2)      0.778 us |          generic_unplug_device();
       2)      2.409 us |        }
       2)      5.992 us |      }
       2)      0.813 us |      dm_table_put();
       2) +   29. 90 us |    }
       2) +   34.532 us |  }
      
      You can add up to 32 functions into this file. Currently we limit it
      to 32, but this may change with later improvements.
      
      To add another function, use the append '>>':
      
        # echo sys_read >> /debugfs/tracing/set_graph_function
        # cat /debugfs/tracing/set_graph_function
        blk_unplug
        sys_read
      
      Using the '>' will clear out the function and write anew:
      
        # echo sys_write > /debug/tracing/set_graph_function
        # cat /debug/tracing/set_graph_function
        sys_write
      
      Note, if you have function graph running while doing this, the small
      time between clearing it and updating it will cause the graph to
      record all functions. This should not be an issue because after
      it sets the filter, only those functions will be recorded from then on.
      If you need to only record a particular function then set this
      file first before starting the function graph tracer. In the future
      this side effect may be corrected.
      
      The set_graph_function file is similar to the set_ftrace_filter but
      it does not take wild cards nor does it allow for more than one
      function to be set with a single write. There is no technical reason why
      this is the case, I just do not have the time yet to implement that.
      
      Note, dynamic ftrace must be enabled for this to appear because it
      uses the dynamic ftrace records to match the name to the mcount
      call sites.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      ea4e2bc4
    • Ingo Molnar's avatar
    • Ingo Molnar's avatar
      Merge commit 'v2.6.28-rc7' into tracing/core · b8307db2
      Ingo Molnar authored
      b8307db2
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block · feaf3848
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.dk/linux-2.6-block:
        block: fix setting of max_segment_size and seg_boundary mask
        block: internal dequeue shouldn't start timer
        block: set disk->node_id before it's being used
        When block layer fails to map iov, it calls bio_unmap_user to undo
      feaf3848
    • Linus Torvalds's avatar
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc · a7711327
      Linus Torvalds authored
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
        powerpc/83xx: Fix MCU support merge issue in mpc8349emitx.dts
        powerpc: Fix dma_map_sg() cache flushing on non coherent platforms
      a7711327
    • Linus Torvalds's avatar
      Merge branch 'for-2.6.28' of git://linux-nfs.org/~bfields/linux · 2433c417
      Linus Torvalds authored
      * 'for-2.6.28' of git://linux-nfs.org/~bfields/linux:
        NLM: client-side nlm_lookup_host() should avoid matching on srcaddr
        nfsd: use of unitialized list head on error exit in nfs4recover.c
        Add a reference to sunrpc in svc_addsock
        nfsd: clean up grace period on early exit
      2433c417
    • Linus Torvalds's avatar
      iTCO_wdt: fix typo when setting TCO_EN bit · cd92a17e
      Linus Torvalds authored
      The code used '&= 0x00002000' when it tried to set the TCO_EN bit, which
      obviously didn't set that bit at all, but instead just reset all the
      other bits in the SMI_EN register.
      
      This bug seemingly caused various random behavior, with Frans Pop
      reporting that X.org just silently hung at startup and Rafael Wysocki
      reports the fan spinning with full speed.
      
      See
      	http://lkml.org/lkml/2008/12/3/178
      	http://bugzilla.kernel.org/show_bug.cgi?id=12162
      
      The problem seems to have been triggered by "[WATCHDOG] iTCO_wdt :
      problem with rebooting on new ICH9 based motherboards" (commit
      7cd5b08b), but the bogus code existed
      before that too (in the "supermicro_old_pre_stop()" function), it just
      apparently never showed up due to different logic.
      
      In that commit the broken code got moved around and now gets executed
      much more.
      Reported-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Tested-by: default avatarFrans Pop <elendil@planet.nl>
      Cc: Wim Van Sebroeck <wim@iguana.be>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cd92a17e
  5. 03 Dec, 2008 13 commits
    • Steven Rostedt's avatar
      ftrace: fix race in function graph during fork · e8e1abe9
      Steven Rostedt authored
      Impact: graph tracer race/crash fix
      
      There is a nasy race in startup of a new process running the
      function graph tracer. In fork.c:
      
      	total_forks++;
      	spin_unlock(&current->sighand->siglock);
      	write_unlock_irq(&tasklist_lock);
      	ftrace_graph_init_task(p);
      	proc_fork_connector(p);
      	cgroup_post_fork(p);
      	return p;
      
      The new task is free to run as soon as the tasklist_lock is released.
      This is before the ftrace_graph_init_task. If the task does run
      it will be using the same ret_stack and curr_ret_stack as the parent.
      This will cause crashes that are difficult to debug.
      
      This patch moves the ftrace_graph_init_task to just after the alloc_pid
      code. This fixes the above race.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      e8e1abe9
    • Steven Rostedt's avatar
      trace: fix output of stack trace · 0a37119d
      Steven Rostedt authored
      Impact: fix to output of stack trace
      
      If a function is not found in the stack of the stack tracer, the
      number printed is quite strange. This fixes the algorithm to handle
      missing functions better.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      0a37119d
    • Anton Vorontsov's avatar
      powerpc/83xx: Fix MCU support merge issue in mpc8349emitx.dts · dafdb613
      Anton Vorontsov authored
      Just found the merge issue in 44274698
      ("powerpc/83xx: Add support for MCU microcontroller in .dts files"):
      the commit adds the MCU controller node into the DMA node, which is
      wrong because the MCU sits on the I2C bus. Fix this by moving the MCU
      node into the I2C controller node.
      
      The original patch[1] was OK though. ;-)
      Signed-off-by: default avatarAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
      dafdb613
    • Milan Broz's avatar
      block: fix setting of max_segment_size and seg_boundary mask · 0e435ac2
      Milan Broz authored
      Fix setting of max_segment_size and seg_boundary mask for stacked md/dm
      devices.
      
      When stacking devices (LVM over MD over SCSI) some of the request queue
      parameters are not set up correctly in some cases by default, namely
      max_segment_size and and seg_boundary mask.
      
      If you create MD device over SCSI, these attributes are zeroed.
      
      Problem become when there is over this mapping next device-mapper mapping
      - queue attributes are set in DM this way:
      
      request_queue   max_segment_size  seg_boundary_mask
      SCSI                65536             0xffffffff
      MD RAID1                0                      0
      LVM                 65536                 -1 (64bit)
      
      Unfortunately bio_add_page (resp.  bio_phys_segments) calculates number of
      physical segments according to these parameters.
      
      During the generic_make_request() is segment cout recalculated and can
      increase bio->bi_phys_segments count over the allowed limit.  (After
      bio_clone() in stack operation.)
      
      Thi is specially problem in CCISS driver, where it produce OOPS here
      
          BUG_ON(creq->nr_phys_segments > MAXSGENTRIES);
      
      (MAXSEGENTRIES is 31 by default.)
      
      Sometimes even this command is enough to cause oops:
      
        dd iflag=direct if=/dev/<vg>/<lv> of=/dev/null bs=128000 count=10
      
      This command generates bios with 250 sectors, allocated in 32 4k-pages
      (last page uses only 1024 bytes).
      
      For LVM layer, it allocates bio with 31 segments (still OK for CCISS),
      unfortunatelly on lower layer it is recalculated to 32 segments and this
      violates CCISS restriction and triggers BUG_ON().
      
      The patch tries to fix it by:
      
       * initializing attributes above in queue request constructor
         blk_queue_make_request()
      
       * make sure that blk_queue_stack_limits() inherits setting
      
       (DM uses its own function to set the limits because it
       blk_queue_stack_limits() was introduced later.  It should probably switch
       to use generic stack limit function too.)
      
       * sets the default seg_boundary value in one place (blkdev.h)
      
       * use this mask as default in DM (instead of -1, which differs in 64bit)
      
      Bugs related to this:
      https://bugzilla.redhat.com/show_bug.cgi?id=471639
      http://bugzilla.kernel.org/show_bug.cgi?id=8672Signed-off-by: default avatarMilan Broz <mbroz@redhat.com>
      Reviewed-by: default avatarAlasdair G Kergon <agk@redhat.com>
      Cc: Neil Brown <neilb@suse.de>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Tejun Heo <htejun@gmail.com>
      Cc: Mike Miller <mike.miller@hp.com>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      0e435ac2
    • Tejun Heo's avatar
      block: internal dequeue shouldn't start timer · 53a08807
      Tejun Heo authored
      blkdev_dequeue_request() and elv_dequeue_request() are equivalent and
      both start the timeout timer.  Barrier code dequeues the original
      barrier request but doesn't passes the request itself to lower level
      driver, only broken down proxy requests; however, as the original
      barrier code goes through the same dequeue path and timeout timer is
      started on it.  If barrier sequence takes long enough, this timer
      expires but the low level driver has no idea about this request and
      oops follows.
      
      Timeout timer shouldn't have been started on the original barrier
      request as it never goes through actual IO.  This patch unexports
      elv_dequeue_request(), which has no external user anyway, and makes it
      operate on elevator proper w/o adding the timer and make
      blkdev_dequeue_request() call elv_dequeue_request() and add timer.
      Internal users which don't pass the request to driver - barrier code
      and end_that_request_last() - are converted to use
      elv_dequeue_request().
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Mike Anderson <andmike@linux.vnet.ibm.com>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      53a08807
    • Cheng Renquan's avatar
      block: set disk->node_id before it's being used · bf91db18
      Cheng Renquan authored
      disk->node_id will be refered in allocating in disk_expand_part_tbl, so we
      should set it before disk->node_id is refered.
      Signed-off-by: default avatarCheng Renquan <crquan@gmail.com>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      bf91db18
    • Petr Vandrovec's avatar
      When block layer fails to map iov, it calls bio_unmap_user to undo · 53cc0b29
      Petr Vandrovec authored
      mapping.  Which is good if pages were mapped - but if they were provided
      by someone else and just copied then bad things happen - pages are
      released once here, and once by caller, leading to user triggerable BUG
      at include/linux/mm.h:246.
      Signed-off-by: default avatarPetr Vandrovec <petr@vandrovec.name>
      Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
      53cc0b29
    • Ingo Molnar's avatar
      tracing/function-graph-tracer: enabled by default · 764f3b95
      Ingo Molnar authored
      CONFIG_FUNCTION_GRAPH_TRACER depends on FUNCTION_TRACER already,
      (turning it non-default) so it so making it default-n is pointless.
      
      So enable it by default - it's a nice extension of the function tracer.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      764f3b95
    • Frederic Weisbecker's avatar
      tracing/function-graph-tracer: improve duration output · 166d3c79
      Frederic Weisbecker authored
      Impact: better trace output of duration for long calls
      
      The old duration output didn't exceeded 9999.999 us to fit the column
      and the nanosecs were always 3 numbers. As Ingo suggested, it's better
      to have the whole microseconds elapsed time and shift the nanosecs precision
      if needed to fit the maximum 7 numbers. And usec need more number, the case
      should be rare and important enough to break a bit the column alignment to
      show it.
      
      So, depending of the duration value, we now have these patterns:
      
          u.nnn us
         uu.nnn us
        uuu.nnn us
       uuuu.nnn us
       uuuuu.nn us
       uuuuuu.n us
       uuuuuuuu..... us
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      166d3c79
    • Frederic Weisbecker's avatar
      tracing/function-graph-tracer: display unified style cmdline and pid · 11e84acc
      Frederic Weisbecker authored
      Impact: extend function-graph output: let one know which thread called a function
      
      This patch implements a helper function to print the couple cmdline/pid.
      Its output is provided during task switching and on each row if the new
      "funcgraph-proc" defualt-off option is set through trace_options file.
      
      The output is center aligned and never exceeds 14 characters. The cmdline
      is truncated over 7 chars.
      But note that if the pid exceeds 6 characters, the column will overflow (but
      the situation is abnormal).
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      11e84acc
    • Steven Rostedt's avatar
      ftrace: add checks on ret stack in function graph · 62679efe
      Steven Rostedt authored
      Import: robustness checks
      
      Add more checks in the function graph code to detect errors and
      perhaps print out better information if a bug happens.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      62679efe
    • Steven Rostedt's avatar
      ftrace: function graph return for function entry · e49dc19c
      Steven Rostedt authored
      Impact: feature, let entry function decide to trace or not
      
      This patch lets the graph tracer entry function decide if the tracing
      should be done at the end as well. This requires all function graph
      entry functions return 1 if it should trace, or 0 if the return should
      not be traced.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      e49dc19c
    • Steven Rostedt's avatar
      ftrace: print real return in dumpstack for function graph · 7ee991fb
      Steven Rostedt authored
      Impact: better dumpstack output
      
      I noticed in my crash dumps and even in the stack tracer that a
      lot of functions listed in the stack trace are simply
      return_to_handler which is ftrace graphs way to insert its own
      call into the return of a function.
      
      But we lose out where the actually function was called from.
      
      This patch adds in hooks to the dumpstack mechanism that detects
      this and finds the real function to print. Both are printed to
      let the user know that a hook is still in place.
      
      This does give a funny side effect in the stack tracer output:
      
              Depth   Size      Location    (80 entries)
              -----   ----      --------
        0)     4144      48   save_stack_trace+0x2f/0x4d
        1)     4096     128   ftrace_call+0x5/0x2b
        2)     3968      16   mempool_alloc_slab+0x16/0x18
        3)     3952     384   return_to_handler+0x0/0x73
        4)     3568    -240   stack_trace_call+0x11d/0x209
        5)     3808     144   return_to_handler+0x0/0x73
        6)     3664    -128   mempool_alloc+0x4d/0xfe
        7)     3792     128   return_to_handler+0x0/0x73
        8)     3664     -32   scsi_sg_alloc+0x48/0x4a [scsi_mod]
      
      As you can see, the real functions are now negative. This is due
      to them not being found inside the stack.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      7ee991fb