1. 03 4月, 2009 3 次提交
  2. 31 3月, 2009 9 次提交
    • L
      blktrace: print out BLK_TN_MESSAGE properly · 18cea459
      Li Zefan 提交于
      Impact: improve ftrace plugin output
      
      Before this patch:
      
       # cat trace
               make-5383  [001]   741.240059:   8,7    P   N [make]
       __trace_note_message: cfq1074
      
       # echo 1 > options/blk_classic
       # cat trace
         8,7    1     0.692221252     0  C   W 130411392 + 1024 [0]
       Bad pc action 6361
       Bad pc action 283d
      
       # echo 0 > options/blk_classic
       # echo bin > trace_options
       # cat trace_pipe | blkparse -i -
       (can't parse messages generated by blk_add_trace_msg())
      
      After this patch:
       # cat trace
            <idle>-0     [001]   187.600933:   8,7    C   W 145220224 + 8 [0]
            <idle>-0     [001]   187.600946:   8,7    m   N cfq1076 complete
      
       # echo 1 > options/blk_classic
       # cat trace
         8,7    1     0.256378996   238  I   W 113190728 + 8 [pdflush]
         8,7    1     0.256378998   238  m   N cfq1076 insert_request
      
       # echo 0 > options/blk_classic
       # echo bin > trace_options
       # cat trace_pipe | blkparse -i -
        8,7    1        0    22.973250293     0  C   W 102770576 + 8 [0]
        8,7    1        0    22.973259213     0  m   N cfq1076 complete
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: NJens Axboe <jens.axboe@oracle.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      18cea459
    • L
      blktrace: extract duplidate code · b6a4b0c3
      Li Zefan 提交于
      Impact: cleanup
      
      blk_trace_event_print() and blk_tracer_print_line() share most of the code.
      
         text    data     bss     dec     hex filename
         8605     393      12    9010    2332 kernel/trace/blktrace.o.orig
         text    data     bss     dec     hex filename
         8555     393      12    8960    2300 kernel/trace/blktrace.o
      
      This patch also prepares for the next patch, that prints out BLK_TN_MESSAGE.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: NJens Axboe <jens.axboe@oracle.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b6a4b0c3
    • L
      blktrace: fix memory leak when freeing struct blk_io_trace · ad5dd549
      Li Zefan 提交于
      Impact: fix mixed ioctl and ftrace-plugin blktrace use memory leak
      
      When mixing the use of ioctl-based blktrace and ftrace-based blktrace,
      we can leak memory in this way:
      
        # btrace /dev/sda > /dev/null &
        # echo 0 > /sys/block/sda/sda1/trace/enable
      
      now we leak bt->dropped_file, bt->msg_file, bt->rchan...
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: NJens Axboe <jens.axboe@oracle.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ad5dd549
    • L
      blktrace: fix blk_probes_ref chaos · 17ba97e3
      Li Zefan 提交于
      Impact: fix mixed ioctl and ftrace-plugin blktrace use refcount bugs
      
      ioctl-based blktrace allocates bt and registers tracepoints when
      ioctl(BLKTRACESETUP), and do all cleanups when ioctl(BLKTRACETEARDOWN).
      
      while ftrace-based blktrace allocates/frees bt when:
        # echo 1/0 > /sys/block/sda/sda1/trace/enable
      
      and registers/unregisters tracepoints when:
        # echo blk/nop > /debugfs/tracing/current_tracer
      or
        # echo 1/0 > /debugfs/tracing/tracing_enable
      
      The separatation of allocation and registeration causes 2 problems:
      
        1. current user-space blktrace still calls ioctl(TEARDOWN) when
           ioctl(SETUP) failed:
             # echo 1 > /sys/block/sda/sda1/trace/enable
             # blktrace /dev/sda
               BLKTRACESETUP: Device or resource busy
               ^C
           and now blk_probes_ref == -1
      
        2. Another way to make blk_probes_ref == -1:
           # plugin sdb && mount sdb1
           # echo 1 > /sys/block/sdb/sdb1/trace/enable
           # remove sdb
      
      This patch does the allocation and registeration when writing
      sdaX/trace/enable.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: NJens Axboe <jens.axboe@oracle.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      17ba97e3
    • L
      blktrace: make classic output more classic · 35ac51bf
      Li Zefan 提交于
      Impact: fix ftrace plugin timestamp output
      
      In the classic user-space blktrace, the output timestamp is sec.nsec
      not sec.usec.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: NJens Axboe <jens.axboe@oracle.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      35ac51bf
    • L
      blktrace: fix off-by-one bug · eb08f8eb
      Li Zefan 提交于
      'what' is used as the index of array what2act, so it can't >= the array size.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: NJens Axboe <jens.axboe@oracle.com>
      Acked-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      eb08f8eb
    • L
      blktrace: fix the original blktrace · 55547204
      Li Zefan 提交于
      Currently the original blktrace, which is using relay and is used via
      ioctl, is broken. You can use ftrace to see the output of blktrace,
      but user-space blktrace is unusable.
      
      It's broken by "blktrace: add ftrace plugin"
      (c71a8961)
      
       -	if (unlikely(bt->trace_state != Blktrace_running))
       +	if (unlikely(bt->trace_state != Blktrace_running || !blk_tracer_enabled))
      		return;
      
      With this patch, both ioctl and ftrace can be used, but of course you
      can't use both of them at the same time.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: NJens Axboe <jens.axboe@oracle.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      55547204
    • L
      blktrace: fix a race when creating blk_tree_root in debugfs · b5230b56
      Li Zefan 提交于
      t1                                t2
      ------                            ------
      do_blk_trace_setup()              do_blk_trace_setup()
        if (!blk_tree_root) {
                                          if (!blk_tree_root)
          blk_tree_root = create_dir()
                                            blk_tree_root = create_dir();
                                            (now blk_tree_root == NULL)
        ...
        dir = create_dir(name, blk_tree_root);
      
      Due to this race, t1 will create 'dir' in /debugfs but not /debugfs/block.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: NJens Axboe <jens.axboe@oracle.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b5230b56
    • L
      blktrace: fix timestamp in binary output · 6c051ce0
      Li Zefan 提交于
      I found the timestamp is wrong:
      
       # echo bin > trace_option
       # echo blk > current_tracer
       # cat trace_pipe | blkparse -i -
       8,0    0        0     0.000000000   504  A   W ...
       ...
       8,7    1        0     0.008534097     0  C   R ...
                  (should be 8.534097xxx)
      
      user-space blkparse expects the timestamp to be nanosecond.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Acked-by: NJens Axboe <jens.axboe@oracle.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6c051ce0
  3. 24 3月, 2009 4 次提交
  4. 21 3月, 2009 7 次提交
  5. 19 3月, 2009 3 次提交
    • F
      tracing/ring-buffer: fix non cpu hotplug case · 3bf832ce
      Frederic Weisbecker 提交于
      Impact: fix warning with irqsoff tracer
      
      The ring buffer allocates its buffers on pre-smp time (early_initcall).
      It means that, at first, only the boot cpu buffer is allocated and
      the ring-buffer cpumask only has the boot cpu set (cpu_online_mask).
      
      Later, the secondary cpu will show up and the ring-buffer will be notified
      about this event: the appropriate buffer will be allocated and the cpumask
      will be updated.
      
      Unfortunately, if !CONFIG_CPU_HOTPLUG, the ring-buffer will not be
      notified about the secondary cpus, meaning that the cpumask will have
      only the cpu boot set, and only one cpu buffer allocated.
      
      We fix that by using cpu_possible_mask if !CONFIG_CPU_HOTPLUG.
      
      This patch fixes the following warning with irqsoff tracer running:
      
      [  169.317794] WARNING: at kernel/trace/trace.c:466 update_max_tr_single+0xcc/0xf3()
      [  169.318002] Hardware name: AMILO Li 2727
      [  169.318002] Modules linked in:
      [  169.318002] Pid: 5624, comm: bash Not tainted 2.6.29-rc8-tip-02636-g6aafa6c #11
      [  169.318002] Call Trace:
      [  169.318002]  [<ffffffff81036182>] warn_slowpath+0xea/0x13d
      [  169.318002]  [<ffffffff8100b9d6>] ? ftrace_call+0x5/0x2b
      [  169.318002]  [<ffffffff8100b9d6>] ? ftrace_call+0x5/0x2b
      [  169.318002]  [<ffffffff8100b9d1>] ? ftrace_call+0x0/0x2b
      [  169.318002]  [<ffffffff8101ef10>] ? ftrace_modify_code+0xa9/0x108
      [  169.318002]  [<ffffffff8106e27f>] ? trace_hardirqs_off+0x25/0x27
      [  169.318002]  [<ffffffff8149afe7>] ? _spin_unlock_irqrestore+0x1f/0x2d
      [  169.318002]  [<ffffffff81064f52>] ? ring_buffer_reset_cpu+0xf6/0xfb
      [  169.318002]  [<ffffffff8106637c>] ? ring_buffer_reset+0x36/0x48
      [  169.318002]  [<ffffffff8106aeda>] update_max_tr_single+0xcc/0xf3
      [  169.318002]  [<ffffffff8100bc17>] ? sysret_check+0x22/0x5d
      [  169.318002]  [<ffffffff8106e3ea>] stop_critical_timing+0x142/0x204
      [  169.318002]  [<ffffffff8106e4cf>] trace_hardirqs_on_caller+0x23/0x25
      [  169.318002]  [<ffffffff8149ac28>] trace_hardirqs_on_thunk+0x3a/0x3c
      [  169.318002]  [<ffffffff8100bc17>] ? sysret_check+0x22/0x5d
      [  169.318002] ---[ end trace db76cbf775a750cf ]---
      
      Because this tracer may try to swap two cpu ring buffers for an
      unregistered cpu on the ring buffer.
      
      This patch might also fix a fair loss of traces due to unallocated buffers
      for secondary cpus.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Acked-b: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1237470453-5427-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3bf832ce
    • I
      tracepoints: dont update zero-sized tracepoint sections · ec625cb2
      Ingo Molnar 提交于
      Zero-sized tracepoint sections can occur if tracing is enabled but
      no tracepoint is defined. Do not emit a warning in that case.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
      LKML-Reference: <1237394936.3132.1.camel@localhost.localdomain>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ec625cb2
    • J
      tracing: fix oops in tracepoint_update_probe_range() · 09933a10
      Jaswinder Singh Rajput 提交于
      Change this crash:
      
       BUG: unable to handle kernel NULL pointer dereference at (null)
       IP: [<ffffffff8107d4de>] tracepoint_update_probe_range+0x1f/0x9b
       PGD 13d5fb067 PUD 13d688067 PMD 0
       Oops: 0000 [#1] SMP
      
      To a more debuggable WARN_ONCE().
      Signed-off-by: NJaswinder Singh Rajput <jaswinderrajput@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      LKML-Reference: <1237394936.3132.1.camel@localhost.localdomain>
      [ moved the check outside the lock and added a WARN_ON(). ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      09933a10
  6. 18 3月, 2009 11 次提交
    • A
      kprobes: Fix locking imbalance in kretprobes · f02b8624
      Ananth N Mavinakayanahalli 提交于
      Fix locking imbalance in kretprobes:
      
      =====================================
      [ BUG: bad unlock balance detected! ]
      -------------------------------------
      kthreadd/2 is trying to release lock (&rp->lock) at:
      [<c06b3080>] pre_handler_kretprobe+0xea/0xf4
      but there are no more locks to release!
      
      other info that might help us debug this:
      1 lock held by kthreadd/2:
       #0:  (rcu_read_lock){..--}, at: [<c06b2b24>] __atomic_notifier_call_chain+0x0/0x5a
      
      stack backtrace:
      Pid: 2, comm: kthreadd Not tainted 2.6.29-rc8 #1
      Call Trace:
       [<c06ae498>] ? printk+0xf/0x17
       [<c06b3080>] ? pre_handler_kretprobe+0xea/0xf4
       [<c044ce6c>] print_unlock_inbalance_bug+0xc3/0xce
       [<c0444d4b>] ? clocksource_read+0x7/0xa
       [<c04450a4>] ? getnstimeofday+0x5f/0xf6
       [<c044a9ca>] ? register_lock_class+0x17/0x293
       [<c044b72c>] ? mark_lock+0x1e/0x30b
       [<c0448956>] ? tick_dev_program_event+0x4a/0xbc
       [<c0498100>] ? __slab_alloc+0xa5/0x415
       [<c06b2fbe>] ? pre_handler_kretprobe+0x28/0xf4
       [<c06b3080>] ? pre_handler_kretprobe+0xea/0xf4
       [<c044cf1b>] lock_release_non_nested+0xa4/0x1a5
       [<c06b3080>] ? pre_handler_kretprobe+0xea/0xf4
       [<c044d15d>] lock_release+0x141/0x166
       [<c06b07dd>] _spin_unlock_irqrestore+0x19/0x50
       [<c06b3080>] pre_handler_kretprobe+0xea/0xf4
       [<c06b20b5>] kprobe_exceptions_notify+0x1c9/0x43e
       [<c06b2b02>] notifier_call_chain+0x26/0x48
       [<c06b2b5b>] __atomic_notifier_call_chain+0x37/0x5a
       [<c06b2b24>] ? __atomic_notifier_call_chain+0x0/0x5a
       [<c06b2b8a>] atomic_notifier_call_chain+0xc/0xe
       [<c0442d0d>] notify_die+0x2d/0x2f
       [<c06b0f9c>] do_int3+0x1f/0x71
       [<c06b0e84>] int3+0x2c/0x34
       [<c042d476>] ? do_fork+0x1/0x288
       [<c040221b>] ? kernel_thread+0x71/0x79
       [<c043ed1b>] ? kthread+0x0/0x60
       [<c043ed1b>] ? kthread+0x0/0x60
       [<c04040b8>] ? kernel_thread_helper+0x0/0x10
       [<c043ec7f>] kthreadd+0xac/0x148
       [<c043ebd3>] ? kthreadd+0x0/0x148
       [<c04040bf>] kernel_thread_helper+0x7/0x10
      Signed-off-by: NAnanth N Mavinakayanahalli <ananth@in.ibm.com>
      Tested-by: NBharata B Rao <bharata@linux.vnet.ibm.com>
      Cc: Masami Hiramatsu <mhiramat@redhat.com>
      Cc: Jim Keniston <jkenisto@us.ibm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: <stable@kernel.org> [2.6.29.x, 2.6.28.x, 2.6.27.x]
      LKML-Reference: <20090318113621.GB4129@in.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f02b8624
    • 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
    • C
      tracing: fix command line to pid reverse map · a635cf04
      Carsten Emde 提交于
      Impact: fix command line to pid mapping
      
      map_cmdline_to_pid[] is checked in trace_save_cmdline(), but never
      updated. This results in stale pid to command line mappings and the
      tracer output will associate the wrong comm string.
      Signed-off-by: NCarsten Emde <Carsten.Emde@osadl.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <srostedt@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a635cf04
    • T
      tracing: fix trace_find_cmdline() · 50d88758
      Thomas Gleixner 提交于
      Impact: prevent stale command line output
      
      In case there is no valid command line mapping for a pid
      trace_find_cmdline() returns without updating the comm buffer. The
      trace dump keeps the previous entry which results in confusing trace
      output:
      
           <idle>-0     [000]   280.702056 ....
           <idle>-23456 [000]   280.702080 ....
      
      Update the comm buffer with "<...>" when no mapping is found.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <srostedt@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      50d88758
    • T
      tracing: replace the crude (unsigned) -1 hackery · 2c7eea4c
      Thomas Gleixner 提交于
      Impact: cleanup
      
      The command line recorder uses (unsigned) -1 to mark non mapped
      entries in the pid to command line maps. The validity check is
      completely unintuitive: idx >= SAVED_CMDLINES
      
      There is no need for such casting games. Use a constant to mark
      unmapped entries and check for that constant to make the code readable
      and understandable.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <srostedt@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2c7eea4c
    • T
      tracing: stop command line recording when tracing is disabled · 18aecd36
      Thomas Gleixner 提交于
      Impact: prevent overwrite of command line entries
      
      When the tracer is stopped the command line recording continues to
      record. The check for tracing_is_on() is not sufficient here as the
      ringbuffer status is not affected by setting
      debug/tracing/tracing_enabled to 0. On a non idle system this can
      result in the loss of the command line information for the stopped
      trace, which makes the trace harder to read and analyse.
      
      Check tracer_enabled to allow further recording.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <srostedt@redhat.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      18aecd36
    • S
      tracing: make power tracer start/stop methods lighter weight · 62524d55
      Steven Rostedt 提交于
      The start/stop methods of a tracer should be able to be executed
      in all contexts. This patch converts the power tracer to do so.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      62524d55
    • S
      tracing: make sched_switch stop/start light weight · 5fec6ddc
      Steven Rostedt 提交于
      The stopping and starting of a tracer should be light weight and
      be able to be called in all contexts. The sched_switch grabbed
      mutexes in the start/stop functions. This patch changes it to a
      simple variable, on/off.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      5fec6ddc
    • S
      tracing: add global-clock option to provide cross CPU clock to traces · af4617bd
      Steven Rostedt 提交于
      Impact: feature to allow better serialized clock
      
      This patch adds an option called "global-clock" that will allow
      the tracer to switch to a slower but more accurate (across CPUs)
      clock.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      af4617bd
    • S
      ring-buffer: add api to allow a tracer to change clock source · 37886f6a
      Steven Rostedt 提交于
      This patch adds a new function called ring_buffer_set_clock that
      allows a tracer to assign its own clock source to the buffer.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      37886f6a
    • M
      module: fix refptr allocation and release order · 6e2b7574
      Masami Hiramatsu 提交于
      Impact: fix ref-after-free crash on failed module load
      
      Fix refptr bug: Change refptr allocation and release order not to access a module
      data structure pointed by 'mod' after freeing mod->module_core.
      This bug will cause kernel panic(e.g. failed to find undefined symbols).
      
      This bug was reported on systemtap bugzilla.
      http://sources.redhat.com/bugzilla/show_bug.cgi?id=9927Signed-off-by: NMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Eric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      6e2b7574
  7. 17 3月, 2009 3 次提交
    • T
      tracing: fix leak in event_format_read() · c269fc8c
      Tom Zanussi 提交于
      Impact: fix memory leak
      
      If event_format_read() exits early due to nonzero ppos, the
      previous kmalloc doesn't get freed - might as well do the
      check before the kmalloc and avoid the problem.
      Signed-off-by: NTom Zanussi <tzanussi@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: =?ISO-8859-1?Q?Fr=E9d=E9ric?= Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1237270859.8033.141.camel@charm-linux>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c269fc8c
    • S
      tracing: stop comm recording on tracing off · 6adaad14
      Steven Rostedt 提交于
      Impact: fix for losing comms in trace
      
      The command lines of tasks are cached at sched switch to not need
      to record them at every trace point.  Disabling the tracing on stops
      the recording of traces, but does not stop the caching of command lines.
      When the tracing is off the cache may overflow and cause the tracing
      to show incorrect tasks matching the PIDs.
      
      This patch disables prevents updates to the comm cache when the ring buffer
      is off.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      6adaad14
    • S
      tracing: protect reader of cmdline output · 4ca53085
      Steven Rostedt 提交于
      Impact: fix to one cause of incorrect comm outputs in trace
      
      The spinlock only protected the creation of a comm <=> pid pair.
      But it was possible that a reader could look up a pid, and get the
      wrong comm because it had no locking.
      
      This also required changing trace_find_cmdline to copy the comm cache
      and not just send back a pointer to it.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      4ca53085