1. 07 4月, 2009 1 次提交
  2. 22 3月, 2009 2 次提交
  3. 18 3月, 2009 1 次提交
    • F
      tracing/ftrace: stop {irqs, preempt}soff tracers when tracing is stopped · 49036200
      Frederic Weisbecker 提交于
      Impact: fix a selftest warning
      
      In some cases, it's possible to see the following warning on irqsoff
      tracer selftest:
      
      [    4.640003] Testing tracer irqsoff: <4>------------[ cut here ]------------
      [    4.653562] WARNING: at kernel/trace/trace.c:458 update_max_tr_single+0x9a/0xc4()
      [    4.660000] Hardware name: System Product Name
      [    4.660000] Modules linked in:
      [    4.660000] Pid: 301, comm: kstop/1 Not tainted 2.6.29-rc8-tip #35837
      [    4.660000] Call Trace:
      [    4.660000]  [<4014b588>] warn_slowpath+0x79/0x8f
      [    4.660000]  [<402d6949>] ? put_dec+0x64/0x6b
      [    4.660000]  [<40162b56>] ? getnstimeofday+0x58/0xdd
      [    4.660000]  [<40162210>] ? clocksource_read+0x3/0xf
      [    4.660000]  [<4015eb44>] ? ktime_set+0x8/0x34
      [    4.660000]  [<4014101a>] ? balance_runtime+0x8/0x56
      [    4.660000]  [<405f6f11>] ? _spin_lock+0x3/0x10
      [    4.660000]  [<4011f643>] ? ftrace_call+0x5/0x8
      [    4.660000]  [<4015d0f1>] ? task_cputime_zero+0x3/0x27
      [    4.660000]  [<40190ee7>] ? cpupri_set+0x90/0xcb
      [    4.660000]  [<405f7208>] ? _spin_lock_irqsave+0x22/0x34
      [    4.660000]  [<40190f12>] ? cpupri_set+0xbb/0xcb
      [    4.660000]  [<405f7151>] ? _spin_unlock_irqrestore+0x23/0x35
      [    4.660000]  [<4018493f>] ? ring_buffer_reset_cpu+0x27/0x51
      [    4.660000]  [<405f7208>] ? _spin_lock_irqsave+0x22/0x34
      [    4.660000]  [<40184962>] ? ring_buffer_reset_cpu+0x4a/0x51
      [    4.660000]  [<405f7151>] ? _spin_unlock_irqrestore+0x23/0x35
      [    4.660000]  [<4018cc29>] ? trace_hardirqs_off+0x1a/0x1c
      [    4.660000]  [<405f7151>] ? _spin_unlock_irqrestore+0x23/0x35
      [    4.660000]  [<40184962>] ? ring_buffer_reset_cpu+0x4a/0x51
      [    4.660000]  [<401850f3>] ? cpumask_next+0x15/0x18
      [    4.660000]  [<4018a41f>] update_max_tr_single+0x9a/0xc4
      [    4.660000]  [<4014e5fe>] ? exit_notify+0x16/0xf2
      [    4.660000]  [<4018cd13>] check_critical_timing+0xcc/0x11e
      [    4.660000]  [<4014e5fe>] ? exit_notify+0x16/0xf2
      [    4.660000]  [<4014e5fe>] ? exit_notify+0x16/0xf2
      [    4.660000]  [<4018cdf1>] stop_critical_timing+0x8c/0x9f
      [    4.660000]  [<4014e5c4>] ? forget_original_parent+0xac/0xd0
      [    4.660000]  [<4018ce3a>] trace_hardirqs_on+0x1a/0x1c
      [    4.660000]  [<4014e5c4>] forget_original_parent+0xac/0xd0
      [    4.660000]  [<4014e5fe>] exit_notify+0x16/0xf2
      [    4.660000]  [<4014e8a5>] do_exit+0x1cb/0x225
      [    4.660000]  [<4015c72b>] ? kthread+0x0/0x69
      [    4.660000]  [<4011f61d>] kernel_thread_helper+0xd/0x10
      [    4.660000] ---[ end trace a7919e7f17c0a725 ]---
      [    4.660164] .. no entries found ..FAILED!
      
      During the selftest of irqsoff tracer, we do that:
      
      	/* disable interrupts for a bit */
      	local_irq_disable();
      	udelay(100);
      	local_irq_enable();
      	/* stop the tracing. */
      	tracing_stop();
      	/* check both trace buffers */
      	ret = trace_test_buffer(tr, NULL);
      
      If a callsite performs a new max delay with irqs off just after
      tracing_stop, update_max_tr_single() -> ring_buffer_swap_cpu()
      will be called with the buffers disabled by tracing_stop(), hence
      the warning, then ring_buffer_swap_cpu() return -EAGAIN and
      update_max_tr_single() complains.
      
      Fix it by also stopping the tracer before stopping the tracing globally.
      A similar situation can happen with preemptoff and preemptirqsoff tracers
      where we apply the same fix.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1237325938-5240-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      49036200
  4. 16 3月, 2009 1 次提交
    • F
      tracing/ftrace: fix double calls to tracing_start() · ac1d52d0
      Frederic Weisbecker 提交于
      Impact: fix a warning during preemptirqsoff selftests
      
      When the preemptirqsoff selftest fails, we see the following
      warning:
      
      [    6.050000] Testing tracer preemptirqsoff: .. no entries found ..
      ------------[ cut here ]------------
      [    6.060000] WARNING: at kernel/trace/trace.c:688 tracing_start+0x67/0xd3()
      [    6.060000] Modules linked in:
      [    6.060000] Pid: 1, comm: swapper Tainted: G
      [    6.060000] Call Trace:
      [    6.060000]  [<ffffffff802460ff>] warn_slowpath+0xb1/0x100
      [    6.060000]  [<ffffffff802a8f5b>] ? trace_preempt_on+0x35/0x4b
      [    6.060000]  [<ffffffff802a37fb>] ? tracing_start+0x31/0xd3
      [    6.060000]  [<ffffffff802a37fb>] ? tracing_start+0x31/0xd3
      [    6.060000]  [<ffffffff80271e0b>] ? __lock_acquired+0xe6/0x1f2
      [    6.060000]  [<ffffffff802a37fb>] ? tracing_start+0x31/0xd3
      [    6.060000]  [<ffffffff802a3831>] tracing_start+0x67/0xd3
      [    6.060000]  [<ffffffff802a8ace>] ? irqsoff_tracer_reset+0x2d/0x57
      [    6.060000]  [<ffffffff802a4d1c>] trace_selftest_startup_preemptirqsoff+0x1c8/0x1f1
      [    6.060000]  [<ffffffff802a4798>] register_tracer+0x12f/0x241
      [    6.060000]  [<ffffffff810250d0>] ? init_irqsoff_tracer+0x0/0x53
      [    6.060000]  [<ffffffff8102510b>] init_irqsoff_tracer+0x3b/0x53
      
      This is because in fail case, the preemptirqsoff tracer selftest calls twice
      the tracing_start() function:
      
      int
      trace_selftest_startup_preemptirqsoff(struct tracer *trace, struct trace_array *tr)
      {
              if (!ret && !count) {
                      printk(KERN_CONT ".. no entries found ..");
                      ret = -1;
                      tracing_start(); <-----
                      goto out;
              }
              [...]
      out:
              trace->reset(tr);
              tracing_start(); <------
              tracing_max_latency = save_max;
      
              return ret;
      }
      
      Since it is well handled in the out path, we don't need the conditional one.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1237159961-7447-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ac1d52d0
  5. 13 3月, 2009 2 次提交
  6. 10 3月, 2009 1 次提交
  7. 19 2月, 2009 2 次提交
    • S
      tracing: limit the number of loops the ring buffer self test can make · 4b3e3d22
      Steven Rostedt 提交于
      Impact: prevent deadlock if ring buffer gets corrupted
      
      This patch adds a paranoid check to make sure the ring buffer consumer
      does not go into an infinite loop. Since the ring buffer has been set
      to read only, the consumer should not loop for more than the ring buffer
      size. A check is added to make sure the consumer does not loop more than
      the ring buffer size.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      4b3e3d22
    • S
      tracing: disable tracing while testing ring buffer · 0c5119c1
      Steven Rostedt 提交于
      Impact: fix to prevent hard lockup on self tests
      
      If one of the tracers are broken and is constantly filling the ring
      buffer while the test of the ring buffer is running, it will hang
      the box. The reason is that the test is a consumer that will not
      stop till the ring buffer is empty. But if the tracer is broken and
      is constantly producing input to the buffer, this test will never
      end. The result is a lockup of the box.
      
      This happened when KALLSYMS was not defined and the dynamic ftrace
      test constantly filled the ring buffer, because the filter failed
      and all functions were being traced. Something was being called
      that constantly filled the buffer.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      0c5119c1
  8. 18 2月, 2009 2 次提交
  9. 09 2月, 2009 1 次提交
  10. 06 2月, 2009 1 次提交
  11. 29 12月, 2008 1 次提交
  12. 16 11月, 2008 2 次提交
  13. 13 11月, 2008 1 次提交
  14. 08 11月, 2008 3 次提交
  15. 23 10月, 2008 1 次提交
  16. 21 10月, 2008 1 次提交
  17. 14 10月, 2008 4 次提交
    • S
      ftrace: make work with new ring buffer · 3928a8a2
      Steven Rostedt 提交于
      This patch ports ftrace over to the new ring buffer.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3928a8a2
    • S
      ftrace: give time for wakeup test to run · 5aa60c60
      Steven Rostedt 提交于
      It is possible that the testing thread in the ftrace wakeup test does not
      run before we stop the trace. This will cause the trace to fail since nothing
      will be in the buffers.
      
      This patch adds a small wait in the wakeup test to allow for the woken task
      to run and be traced.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5aa60c60
    • S
      ftrace: add nop tracer · fb1b6d8b
      Steven Noonan 提交于
      A no-op tracer which can serve two purposes:
      
       1. A template for development of a new tracer.
       2. A convenient way to see ftrace_printk() calls without
          an irrelevant trace making the output messy.
      
      [ mingo@elte.hu: resolved conflicts ]
      Signed-off-by: NSteven Noonan <steven@uplinklabs.net>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fb1b6d8b
    • S
      ftrace: printk formatting infrastructure · dd0e545f
      Steven Rostedt 提交于
      This patch adds a feature that can help kernel developers debug their
      code using ftrace.
      
        int ftrace_printk(const char *fmt, ...);
      
      This records into the ftrace buffer using printf formatting. The entry
      size in the buffers are still a fixed length. A new type has been added
      that allows for more entries to be used for a single recording.
      
      The start of the print is still the same as the other entries.
      
      It returns the number of characters written to the ftrace buffer.
      
      For example:
      
      Having a module with the following code:
      
      static int __init ftrace_print_test(void)
      {
              ftrace_printk("jiffies are %ld\n", jiffies);
              return 0;
      }
      
      Gives me:
      
        insmod-5441  3...1 7569us : ftrace_print_test: jiffies are 4296626666
      
      for the latency_trace file and:
      
                insmod-5441  [03]  1959.370498: ftrace_print_test jiffies are 4296626666
      
      for the trace file.
      
      Note: Only the infrastructure should go into the kernel. It is to help
      facilitate debugging for other kernel developers. Calls to ftrace_printk
      is not intended to be left in the kernel, and should be frowned upon just
      like scattering printks around in the code.
      
      But having this easily at your fingertips helps the debugging go faster
      and bugs be solved quicker.
      
      Maybe later on, we can hook this with markers and have their printf format
      be sucked into ftrace output.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      dd0e545f
  18. 27 5月, 2008 1 次提交
    • S
      ftrace: limit use of check pages · 19384c03
      Steven Rostedt 提交于
      The check_pages function is called often enough that it can cause problems
      with trace outputs or even bringing the system to a halt.
      
      This patch limits the check_pages to the places that are most likely to
      have problems. The check is made at the flip between the global array and
      the max save array, as well as when the size of the buffers changes and
      the self tests.
      
      This patch also removes the BUG_ON from check_pages and replaces it with
      a WARN_ON and disabling of the tracer.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Cc: pq@iki.fi
      Cc: proski@gnu.org
      Cc: sandmann@redhat.com
      Cc: a.p.zijlstra@chello.nl
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      19384c03
  19. 24 5月, 2008 12 次提交