linux-mips
[Top] [All Lists]

Re: [Q] MIPS: How to record the user stack backtrace in the kernel

To: Deng-Cheng Zhu <dengcheng.zhu@gmail.com>
Subject: Re: [Q] MIPS: How to record the user stack backtrace in the kernel
From: "Maciej W. Rozycki" <macro@linux-mips.org>
Date: Sun, 6 Jun 2010 23:02:35 +0100 (BST)
Cc: linux-mips@linux-mips.org
In-reply-to: <AANLkTikRaw_OLR7LenUA8acaedJy2V6HZKJ0cAd6PNRk@mail.gmail.com>
References: <AANLkTikRaw_OLR7LenUA8acaedJy2V6HZKJ0cAd6PNRk@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Alpine 2.00 (LFD 1167 2008-08-23)
On Sat, 5 Jun 2010, Deng-Cheng Zhu wrote:

> In the kernel, we don't have frame unwinder to work on the user stack.
> Given the different possible compiler flags, getting the backtrace for the
> user stack is especially challenging. Certainly, I don't want symbols -
> only to get a list of return addresses. Do you have any comments?

 You can't do that, because, unlike some other platforms, MIPS ABIs do not 
use a fixed frame layout.  You need at least symbol information or, 
preferably, debug records to be able to construct a backtrace.  These can 
be attached to the ELF executables used and are not easily reachable from 
the kernel.

 What's the point anyway?  Just use GDB or other widely available user 
tools.

  Maciej

<Prev in Thread] Current Thread [Next in Thread>