[Top] [All Lists]

Re: [PATCH -v4 4/9] tracing: add static function tracer support for MIPS

To:, Richard Sandiford <>, Adam Nemet <>
Subject: Re: [PATCH -v4 4/9] tracing: add static function tracer support for MIPS
From: David Daney <>
Date: Thu, 22 Oct 2009 11:34:38 -0700
Cc:,,, Thomas Gleixner <>, Ralf Baechle <>, Nicholas Mc Guire <>
In-reply-to: <1256233679.23653.7.camel@falcon>
Original-recipient: rfc822;
References: <> <> <> <> <> <1256233679.23653.7.camel@falcon>
User-agent: Thunderbird (X11/20090320)
Wu Zhangjin wrote:
On Wed, 2009-10-21 at 11:24 -0400, Steven Rostedt wrote:
+NESTED(_mcount, PT_SIZE, ra)
+       PTR_LA  t0, ftrace_stub
+       PTR_L   t1, ftrace_trace_function /* please don't use t1 later, safe? */
Is t0 and t1 safe for mcount to use? Remember, mcount does not follow
the dynamics of C function ABI.

So, perhaps we can use the saved registers(a0,a1...) instead.

a0..a7 may not always be saved.

You can use at, v0, v1 and all the temporary registers. Note that for the 64-bit ABIs sometimes the names t0-t4 shadow a4-a7. So for a 64-bit kernel, you can use: $1, $2, $3, $12, $13, $14, $15, $24, $25, noting that at == $1 and contains the callers ra. For a 32-bit kernel you can add $8, $9, $10, and $11

This whole thing seems a little fragile.

I think it might be a good idea to get input from Richard Sandiford, and/or Adam Nemet about this approach (so I add them to the CC).

This e-mail thread starts here:

and here:

David Daney


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

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