1. 09 9月, 2017 1 次提交
    • D
      ARM: 8691/1: Export save_stack_trace_tsk() · 9a3dc318
      Dustin Brown 提交于
      The kernel watchdog is a great debugging tool for finding tasks that
      consume a disproportionate amount of CPU time in contiguous chunks. One
      can imagine building a similar watchdog for arbitrary driver threads
      using save_stack_trace_tsk() and print_stack_trace(). However, this is
      not viable for dynamically loaded driver modules on ARM platforms
      because save_stack_trace_tsk() is not exported for those architectures.
      Export save_stack_trace_tsk() for the ARM architecture to align with
      x86 and support various debugging use cases such as arbitrary driver
      thread watchdog timers.
      Signed-off-by: NDustin Brown <dustinb@codeaurora.org>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      9a3dc318
  2. 02 3月, 2017 1 次提交
  3. 14 11月, 2014 1 次提交
  4. 30 5月, 2014 1 次提交
    • L
      ARM: 8049/1: ftrace/add save_stack_trace_regs() implementation · 9c986661
      Lin Yongting 提交于
      When configure kprobe events of ftrace with "stacktrace" option enabled
      in arm, there is no stacktrace was recorded after the kprobe event was
      triggered. The root cause is no save_stack_trace_regs() function implemented.
      
      Implement the save_stack_trace_regs() function in arm, then ftrace will
      call this architecture-related function to record the stacktrace into
      ring buffer.
      
      After this fix, stacktrace can be recorded, for example:
      
       # mount -t debugfs nodev /sys/kernel/debug
       # echo "p:netrx net_rx_action" >> /sys/kernel/debug/tracing/kprobe_events
       # echo 1 > /sys/kernel/debug/tracing/events/kprobes/netrx/enable
       # echo 1 > /sys/kernel/debug/tracing/options/stacktrace
       # echo 1 > /sys/kernel/debug/tracing/tracing_on
       # ping 127.0.0.1 -c 1
       # echo 0 > /sys/kernel/debug/tracing/tracing_on
      
       # cat /sys/kernel/debug/tracing/trace
       # tracer: nop
       #
       # entries-in-buffer/entries-written: 12/12   #P:1
       #
       #                              _-----=> irqs-off
       #                             / _----=> need-resched
       #                            | / _---=> hardirq/softirq
       #                            || / _--=> preempt-depth
       #                            ||| /     delay
       #           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
       #              | |       |   ||||       |         |
                   <------ missing some entries ---------------->
                   ping-1200  [000] dNs1   667.603250: netrx: (net_rx_action+0x0/0x1f8)
                   ping-1200  [000] dNs1   667.604738: <stack trace>
        => net_rx_action
        => do_softirq
        => local_bh_enable
        => ip_finish_output
        => ip_output
        => ip_local_out
        => ip_send_skb
        => ip_push_pending_frames
        => raw_sendmsg
        => inet_sendmsg
        => sock_sendmsg
        => SyS_sendto
        => ret_fast_syscall
      Signed-off-by: NLin Yongting <linyongting@gmail.com>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      9c986661
  5. 22 5月, 2014 2 次提交
    • R
      ARM: stacktrace: include exception PC value in stacktrace output · 07b40341
      Russell King 提交于
      When we unwind through an exception stack, include the saved PC value
      into the stack trace: this fills in an otherwise missed functions from
      the trace (as indicated below):
      
       [<c03f4424>] fec_enet_interrupt+0xa0/0xe8
       [<c0066c0c>] handle_irq_event_percpu+0x68/0x228
       [<c0066e18>] handle_irq_event+0x4c/0x6c
       [<c006a024>] handle_fasteoi_irq+0xac/0x198
       [<c00664b0>] generic_handle_irq+0x4c/0x60
       [<c000f014>] handle_IRQ+0x40/0x98
       [<c0008554>] gic_handle_irq+0x30/0x64
       [<c0012900>] __irq_svc+0x40/0x50
       [<c0029030>] __do_softirq+0xe0/0x2fc		<====
       [<c0029500>] irq_exit+0xb0/0x100
       [<c000f018>] handle_IRQ+0x44/0x98
       [<c0008554>] gic_handle_irq+0x30/0x64
       [<c0012900>] __irq_svc+0x40/0x50
       [<c000f34c>] arch_cpu_idle+0x30/0x38		<====
       [<c005e1e4>] cpu_startup_entry+0xac/0x214
       [<c066297c>] rest_init+0x68/0x80
       [<c08ccb10>] start_kernel+0x2fc/0x358
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      07b40341
    • R
      ARM: stacktrace: avoid listing stacktrace functions in stacktrace · 3683f44c
      Russell King 提交于
      While debugging the FEC ethernet driver using stacktrace, it was noticed
      that the stacktraces always begin as follows:
      
       [<c00117b4>] save_stack_trace_tsk+0x0/0x98
       [<c0011870>] save_stack_trace+0x24/0x28
       ...
      
      This is because the stack trace code includes the stack frames for itself.
      This is incorrect behaviour, and also leads to "skip" doing the wrong
      thing (which is the number of stack frames to avoid recording.)
      
      Perversely, it does the right thing when passed a non-current thread.  Fix
      this by ensuring that we have a known constant number of frames above the
      main stack trace function, and always skip these.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      3683f44c
  6. 10 12月, 2013 1 次提交
  7. 01 11月, 2011 1 次提交
    • P
      arm: convert core files from module.h to export.h · ecea4ab6
      Paul Gortmaker 提交于
      Many of the core ARM kernel files are not modules, but just
      including module.h for exporting symbols.  Now these files can
      use the lighter footprint export.h for this role.
      
      There are probably lots more, but ARM files of mach-* and plat-*
      don't get coverage via a simple yesconfig build.  They will have
      to be cleaned up and tested via using their respective configs.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      ecea4ab6
  8. 15 1月, 2011 1 次提交
    • R
      ARM: fix /proc/$PID/stack on SMP · d5996b2f
      Russell King 提交于
      Rabin Vincent reports:
      | On SMP, this BUG() in save_stack_trace_tsk() can be easily triggered
      | from user space by reading /proc/$PID/stack, where $PID is any pid but
      | the current process:
      |
      |	if (tsk != current) {
      | #ifdef CONFIG_SMP
      |		/*
      |		 * What guarantees do we have here that 'tsk'
      |		 * is not running on another CPU?
      |		 */
      |		BUG();
      | #else
      
      Fix this by replacing the BUG() with an entry to terminate the stack
      trace, returning an empty trace - I'd rather not expose the dwarf
      unwinder to a volatile stack of a running thread.
      Reported-by: NRabin Vincent <rabin@rab.in>
      Tested-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      d5996b2f
  9. 08 11月, 2010 1 次提交
  10. 22 7月, 2009 1 次提交
    • U
      [ARM] 5613/1: implement CALLER_ADDRESSx · 4bf1fa5a
      Uwe Kleine-König 提交于
      From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
      
      As __builtin_return_address(n) doesn't work for ARM with n > 0, the
      kernel needs its own implementation.
      
      This fixes many warnings saying:
      
      	warning: unsupported argument to '__builtin_return_address'
      
      The new methods and walk_stackframe must not be instrumented because
      CALLER_ADDRESSx is used in the various tracers and tracing the tracer is
      a bad idea.
      
      What's currently missing is an implementation using unwind tables.  This
      is not fatal though, it's just that the tracers don't get enough
      information to be really useful.
      
      Note that if both ARM_UNWIND and FRAME_POINTER are enabled,
      walk_stackframe uses unwind information.  So in this case the same
      implementation is used as when FRAME_POINTER is disabled.
      
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      4bf1fa5a
  11. 12 2月, 2009 1 次提交
  12. 03 7月, 2008 1 次提交
  13. 23 6月, 2008 1 次提交
  14. 30 5月, 2007 1 次提交
  15. 16 5月, 2007 1 次提交
  16. 12 5月, 2007 1 次提交
    • A
      [ARM] stacktrace fix · fac07790
      Andrew Morton 提交于
      ab1b6f03 said
      
       - remove the unused task argument to save_stack_trace, it's always current
      
      then broke arm:
      
      arch/arm/kernel/stacktrace.c:56: error: conflicting types for 'save_stack_trace'
      include/linux/stacktrace.h:11: error: previous declaration of 'save_stack_trace' was here
      arch/arm/kernel/stacktrace.c:56: error: conflicting types for 'save_stack_trace'
      include/linux/stacktrace.h:11: error: previous declaration of 'save_stack_trace' was here
      
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      fac07790
  17. 28 4月, 2007 1 次提交