1. 17 12月, 2009 1 次提交
    • F
      perf events, x86/stacktrace: Make stack walking optional · 61c1917f
      Frederic Weisbecker 提交于
      The current print_context_stack helper that does the stack
      walking job is good for usual stacktraces as it walks through
      all the stack and reports even addresses that look unreliable,
      which is nice when we don't have frame pointers for example.
      
      But we have users like perf that only require reliable
      stacktraces, and those may want a more adapted stack walker, so
      lets make this function a callback in stacktrace_ops that users
      can tune for their needs.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      LKML-Reference: <1261024834-5336-1-git-send-regression-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      61c1917f
  2. 06 12月, 2009 1 次提交
    • F
      x86: Fixup wrong irq frame link in stacktraces · af2d8289
      Frederic Weisbecker 提交于
      When we enter in irq, two things can happen to preserve the link
      to the previous frame pointer:
      
      - If we were in an irq already, we don't switch to the irq stack
        as we are inside. We just need to save the previous frame
        pointer and to link the new one to the previous.
      
      - Otherwise we need another level of indirection. We enter the irq with
        the previous stack. We save the previous bp inside and make bp
        pointing to its saved address. Then we switch to the irq stack and
        push bp another time but to the new stack. This makes two levels to
        dereference instead of one.
      
      In the second case, the current stacktrace code omits the second level
      and loses the frame pointer accuracy. The stack that follows will then
      be considered as unreliable.
      
      Handling that makes the perf callchain happier.
      Before:
      
      43.94%  [k] _raw_read_lock
                  |
                  --- _read_lock
                     |
                     |--60.53%-- send_sigio
                     |          __kill_fasync
                     |          kill_fasync
                     |          evdev_pass_event
                     |          evdev_event
                     |          input_pass_event
                     |          input_handle_event
                     |          input_event
                     |          synaptics_process_byte
                     |          psmouse_handle_byte
                     |          psmouse_interrupt
                     |          serio_interrupt
                     |          i8042_interrupt
                     |          handle_IRQ_event
                     |          handle_edge_irq
                     |          handle_irq
                     |          __irqentry_text_start
                     |          ret_from_intr
                     |          |
                     |          |--30.43%-- __select
                     |          |
                     |          |--17.39%-- 0x454f15
                     |          |
                     |          |--13.04%-- __read
                     |          |
                     |          |--13.04%-- vread_hpet
                     |          |
                     |          |--13.04%-- _xcb_lock_io
                     |          |
                     |           --13.04%-- 0x7f630878ce8
      
      After:
      
          50.00%  [k] _raw_read_lock
                  |
                  --- _read_lock
                     |
                     |--98.97%-- send_sigio
                     |          __kill_fasync
                     |          kill_fasync
                     |          evdev_pass_event
                     |          evdev_event
                     |          input_pass_event
                     |          input_handle_event
                     |          input_event
                     |          |
                     |          |--96.88%-- synaptics_process_byte
                     |          |          psmouse_handle_byte
                     |          |          psmouse_interrupt
                     |          |          serio_interrupt
                     |          |          i8042_interrupt
                     |          |          handle_IRQ_event
                     |          |          handle_edge_irq
                     |          |          handle_irq
                     |          |          __irqentry_text_start
                     |          |          ret_from_intr
                     |          |          |
                     |          |          |--39.78%-- __const_udelay
                     |          |          |          |
                     |          |          |          |--91.89%-- ath5k_hw_register_timeout
                     |          |          |          |          ath5k_hw_noise_floor_calibration
                     |          |          |          |          ath5k_hw_reset
                     |          |          |          |          ath5k_reset
                     |          |          |          |          ath5k_config
                     |          |          |          |          ieee80211_hw_config
                     |          |          |          |          |
                     |          |          |          |          |--88.24%-- ieee80211_scan_work
                     |          |          |          |          |          worker_thread
                     |          |          |          |          |          kthread
                     |          |          |          |          |          child_rip
                     |          |          |          |          |
                     |          |          |          |           --11.76%-- ieee80211_scan_completed
                     |          |          |          |                     ieee80211_scan_work
                     |          |          |          |                     worker_thread
                     |          |          |          |                     kthread
                     |          |          |          |                     child_rip
                     |          |          |          |
                     |          |          |           --8.11%-- ath5k_hw_noise_floor_calibration
                     |          |          |                     ath5k_hw_reset
                     |          |          |                     ath5k_reset
                     |          |          |                     ath5k_config
      
      Note: This does not only affect perf events but also x86-64
      stacktraces. They were considered as unreliable once we quit
      the irq stack frame.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: "K. Prasad" <prasad@linux.vnet.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      af2d8289
  3. 26 11月, 2009 2 次提交
    • I
      x86: dumpstack, 64-bit: Disable preemption when walking the IRQ/exception stacks · 67f2de0b
      Ingo Molnar 提交于
      This warning:
      
      [  847.140022] rb_producer   D 0000000000000000  5928   519      2 0x00000000
      [  847.203627] BUG: using smp_processor_id() in preemptible [00000000] code: khungtaskd/517
      [  847.207360] caller is show_stack_log_lvl+0x2e/0x241
      [  847.210364] Pid: 517, comm: khungtaskd Not tainted 2.6.32-rc8-tip+ #13761
      [  847.213395] Call Trace:
      [  847.215847]  [<ffffffff81413bde>] debug_smp_processor_id+0x1f0/0x20a
      [  847.216809]  [<ffffffff81015eae>] show_stack_log_lvl+0x2e/0x241
      [  847.220027]  [<ffffffff81018512>] show_stack+0x1c/0x1e
      [  847.223365]  [<ffffffff8107b7db>] sched_show_task+0xe4/0xe9
      [  847.226694]  [<ffffffff8112f21f>] check_hung_task+0x140/0x199
      [  847.230261]  [<ffffffff8112f4a8>] check_hung_uninterruptible_tasks+0x1b7/0x20f
      [  847.233371]  [<ffffffff8112f500>] ? watchdog+0x0/0x50
      [  847.236683]  [<ffffffff8112f54e>] watchdog+0x4e/0x50
      [  847.240034]  [<ffffffff810cee56>] kthread+0x97/0x9f
      [  847.243372]  [<ffffffff81012aea>] child_rip+0xa/0x20
      [  847.246690]  [<ffffffff81e43494>] ? restore_args+0x0/0x30
      [  847.250019]  [<ffffffff81e43083>] ? _spin_lock+0xe/0x10
      [  847.253351]  [<ffffffff810cedbf>] ? kthread+0x0/0x9f
      [  847.256833]  [<ffffffff81012ae0>] ? child_rip+0x0/0x20
      
      Happens because on preempt-RCU, khungd calls show_stack() with
      preemption enabled.
      
      Make sure we are not preemptible while walking the IRQ and exception
      stacks on 64-bit. (32-bit stack dumping is preemption safe.)
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      67f2de0b
    • I
      x86: dumpstack: Clean up the x86_stack_ids[][] initalization and other details · b8030906
      Ingo Molnar 提交于
      Make the initialization more readable, plus tidy up a few small
      visual details as well.
      
      No change in functionality.
      
      LKML-Reference: <new-submission>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b8030906
  4. 24 9月, 2009 1 次提交
  5. 02 7月, 2009 1 次提交
    • F
      perf_counter: Ignore the nmi call frames in the x86-64 backtraces · 0406ca6d
      Frederic Weisbecker 提交于
      About every callchains recorded with perf record are filled up
      including the internal perfcounter nmi frame:
      
       perf_callchain
       perf_counter_overflow
       intel_pmu_handle_irq
       perf_counter_nmi_handler
       notifier_call_chain
       atomic_notifier_call_chain
       notify_die
       do_nmi
       nmi
      
      We want ignore this frame as it's not interesting for
      instrumentation. To solve this, we simply ignore every frames
      from nmi context.
      
      New example of "perf report -s sym -c" after this patch:
      
      9.59%  [k] search_by_key
                   4.88%
                      search_by_key
                      reiserfs_read_locked_inode
                      reiserfs_iget
                      reiserfs_lookup
                      do_lookup
                      __link_path_walk
                      path_walk
                      do_path_lookup
                      user_path_at
                      vfs_fstatat
                      vfs_lstat
                      sys_newlstat
                      system_call_fastpath
                      __lxstat
                      0x406fb1
      
                   3.19%
                      search_by_key
                      search_by_entry_key
                      reiserfs_find_entry
                      reiserfs_lookup
                      do_lookup
                      __link_path_walk
                      path_walk
                      do_path_lookup
                      user_path_at
                      vfs_fstatat
                      vfs_lstat
                      sys_newlstat
                      system_call_fastpath
                      __lxstat
                      0x406fb1
      [...]
      
      For now this patch only solves the problem in x86-64.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      LKML-Reference: <1246474930-6088-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0406ca6d
  6. 18 1月, 2009 2 次提交
  7. 03 12月, 2008 1 次提交
    • S
      ftrace: print real return in dumpstack for function graph · 7ee991fb
      Steven Rostedt 提交于
      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: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7ee991fb
  8. 28 10月, 2008 1 次提交
    • N
      x86: unify appropriate bits from dumpstack_32 and dumpstack_64 · 878719e8
      Neil Horman 提交于
      Impact: cleanup
      
      As promised, now that dumpstack_32 and dumpstack_64 have so many bits
      in common, we should merge the in-sync bits into a common file, to
      prevent them from diverging again.
      
      This patch removes bits which are common between dumpstack_32.c and
      dumpstack_64.c and places them in a common dumpstack.c which is built
      for both 32 and 64 bit arches.
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      Acked-by: NAlexander van Heukelum <heukelum@fastmail.fm>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      
       Makefile       |    2
       arch/x86/kernel/Makefile       |    2
       arch/x86/kernel/Makefile       |    2
       arch/x86/kernel/Makefile       |    2
       arch/x86/kernel/Makefile       |    2
       arch/x86/kernel/Makefile       |    2
       arch/x86/kernel/dumpstack.c    |  319 +++++++++++++++++++++++++++++++++++++++++
       arch/x86/kernel/dumpstack.h    |   39 +++++
       arch/x86/kernel/dumpstack_32.c |  294 -------------------------------------
       arch/x86/kernel/dumpstack_64.c |  285 ------------------------------------
       5 files changed, 363 insertions(+), 576 deletions(-)
      878719e8
  9. 22 10月, 2008 5 次提交
  10. 17 10月, 2008 1 次提交
  11. 13 10月, 2008 7 次提交