linux-mips
[Top] [All Lists]

Re: about oprofile callgraph on linux-mips

To: "Amker.Cheng" <amker.cheng@gmail.com>
Subject: Re: about oprofile callgraph on linux-mips
From: David Daney <ddaney@caviumnetworks.com>
Date: Tue, 18 Jan 2011 10:18:55 -0800
Cc: linux-mips@linux-mips.org
In-reply-to: <AANLkTin+TzF2QtbfRi8Ltqwp97ME-JtuwwEBn8cYt1zS@mail.gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <AANLkTin+TzF2QtbfRi8Ltqwp97ME-JtuwwEBn8cYt1zS@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Thunderbird/3.0.10
On 01/17/2011 07:01 PM, Amker.Cheng wrote:
Hi,
     Previously I have run oprofile on linux-mips and have two
questions about it.
     It seems that oprofile does not support callgraph on linux-mips
currently, since there is no
backtrace function in oprofile kernel module for mips target.
     Is it possible or easy to support callgraph on mips target? If I
am right, it's some kind of
difficult to calculate stack frames of interrupted user space
programs, at least for O32 ABI.


By default, most MIPS code doesn't use frame pointers. This makes generating an accurate stack trace either very difficult or impossible.

If you compile *all* your user space code with -fno-omit-framepointer, you could write a fairly simple stack walker. Otherwise you have to do code analysis to try to get a stack trace, and that is quite complex, and at in some cases impossible.

Any tips would be appriciated. thanks.

I wrote a userspace o32 stack trace generator once and posted it to java-patches@gcc.gnu.org. If you search for it you might find it.

David Daney

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