linux-mips
[Top] [All Lists]

Re: [PATCH] MIPS: tracing: Optimize the implementation

To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Subject: Re: [PATCH] MIPS: tracing: Optimize the implementation
From: David Daney <ddaney@caviumnetworks.com>
Date: Fri, 12 Mar 2010 08:36:09 -0800
Cc: Wu Zhangjin <wuzhangjin@gmail.com>, Ralf Baechle <ralf@linux-mips.org>, Steven Rostedt <srostedt@redhat.com>, linux-mips@linux-mips.org
In-reply-to: <20100312085053.GB6364@alpha.franken.de>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <8b93c417fefa4d446f801abfd718ba94fdcb1821.1268330348.git.wuzhangjin@gmail.com> <20100312085053.GB6364@alpha.franken.de>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Thunderbird/3.0.3
On 03/12/2010 12:50 AM, Thomas Bogendoerfer wrote:
On Fri, Mar 12, 2010 at 02:07:37AM +0800, Wu Zhangjin wrote:
+/*
+ * If the Instruction Pointer is in module space (0xc0000000), return ture;
+ * otherwise, it is in kernel space (0x80000000), return false.
+ */
+#define in_module(ip) (unlikely((ip)&  0x40000000))
+

looks broken for 64bit, but maybe this is a 32bit only feature...


I initially thought the same thing. However for 64-bit kernels linked in ckseg0 it is still true. If we use the -msym32 optimization, we are forced to be in the ckseg space, so for most cases it works.

David Daney.

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