linux-mips
[Top] [All Lists]

[RFC][PATCH] Implement perf_callchain_user for o32 ABI (on mipsel)

To: linux-mips@linux-mips.org
Subject: [RFC][PATCH] Implement perf_callchain_user for o32 ABI (on mipsel)
From: Holger Hans Peter Freyther <holger@freyther.de>
Date: Wed, 10 Aug 2011 09:24:24 +0200
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11
Hi all,

I wanted to use perf to profile my userspace application on MIPS but I saw
that there is no solution for that. I have written some code to scan the
prologue of the function to identify the stack size and where in the stack the
return address is stored.

   0:   27bdffd8        addiu   sp,sp,-40 <-- used to find prev. stack
   4:   afbf0024        sw      ra,36(sp) <-- stored return addr.
   8:   afbe0020        sw      s8,32(sp)
   c:   03a0f021        move    s8,sp
  10:   3c1c0000        lui     gp,0x0
  14:   279c0000        addiu   gp,gp,0

The code appears to work in qemu-system-mipsel (not where I am going to do my
profiling) with my simple test application.

The code is missing a S-o-b because I would like to get feedback if something
like this would ever be accepted upstream. The other question is also about
security, other ABIs, 32/64 bit...

comments more than welcome
        holger

Attachment: 0001-mips-Implement-perf_callchain_user-by-scanning-the-p.patch
Description: Text Data

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