linux-mips
[Top] [All Lists]

[PATCH 4/7] Make frame_info_init() more readable.

To: anemo@mba.ocn.ne.jp
Subject: [PATCH 4/7] Make frame_info_init() more readable.
From: Franck Bui-Huu <vagabon.xyz@gmail.com>
Date: Thu, 3 Aug 2006 09:29:18 +0200
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org, Franck Bui-Huu <vagabon.xyz@gmail.com>
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=cC3xrHybvTFz6JhqS+dtP78kON+t16/shqtHcDCWiR1ekvZ44jKuZYhOZ+sDGHX0ML0/GVHMIdJ5TzGZaauKT6LFQ0Vlns5xE4M5fAWsWAlRyNIL7eWoxfO3v2279Tr3Vwf+uABr8vZApy7ECwxKiK+rkIweI5I9TcbSoZRu/Zk=
In-reply-to: <11545901611096-git-send-email-vagabon.xyz@gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <11545901611096-git-send-email-vagabon.xyz@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
---
 arch/mips/kernel/process.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 93d5432..da332d7 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -370,15 +370,15 @@ #else
        mfinfo[0].func = schedule;
        schedule_frame = &mfinfo[0];
 #endif
-       for (i = 0; i < ARRAY_SIZE(mfinfo) && mfinfo[i].func; i++) {
-               struct mips_frame_info *info = &mfinfo[i];
-               if (get_frame_info(info)) {
-                       /* leaf or unknown */
-                       if (info->func == schedule)
-                               printk("Can't analyze prologue code at %p\n",
-                                      info->func);
-               }
-       }
+       for (i = 0; i < ARRAY_SIZE(mfinfo) && mfinfo[i].func; i++)
+               get_frame_info(mfinfo + i);
+
+       /*
+        * Without schedule() frame info, result given by
+        * thread_saved_pc() and get_wchan() are not reliable.
+        */
+       if (schedule_frame->pc_offset < 0)
+               printk("Can't analyze schedule() prologue at %p\n", schedule);
 
        mfinfo_num = i;
        return 0;
-- 
1.4.2.rc2


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