Re: functions about dump backtrace function names in mips arch

Previous thread: Adding a kobject in the device model hierarchy by Prabhu nath on Saturday, January 1, 2011 - 9:28 am. (2 messages)

Next thread: some questions about errno.h by vichy on Sunday, January 2, 2011 - 2:18 am. (2 messages)
From: loody
Date: Sunday, January 2, 2011 - 1:26 am

 Dear all:
 If i remember correctly, when kernel panic there is a function I can
 use to dump all the names of backtrace functions.
 I have searched arch/mips/traps.c, but I only can see the dump
 functions of cpu registers,

 If my assumption is true, would anyone tell me what the name is or
 what Doc I can looking for?
 appreciate your help,
miloody

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
From: loody
Date: Sunday, January 2, 2011 - 1:27 am

 Dear all:
 If i remember correctly, when kernel panic there is a function I can
 use to dump all the names of backtrace functions.
 I have searched arch/mips/traps.c, but I only can see the dump
 functions of cpu registers,

 If my assumption is true, would anyone tell me what the name is or
 what Doc I can looking for?
 appreciate your help,
miloody

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
From: Mulyadi Santosa
Date: Sunday, January 2, 2011 - 4:01 am

In x86, it's dump_stack(). The definition can be read here online:
http://lxr.linux.no/#linux+v2.6.36/arch/x86/kernel/dumpstack.c#L198

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
From: Sowmya Sridharan
Date: Monday, January 3, 2011 - 12:43 am

Hi,

I was able to check it in 2.6.36 version of kernel, and it is defined in 
traps.c.
http://lxr.linux.no/linux+v2.6.36/arch/mips/kernel/traps.c#L205

dump_stack() calls show_backtrace function which had been show_trace in 
the earlier kernel versions.
I compared between 2.6.14 and the latest version, and here are the 
differences:
-------------------------------------------------------------------------------
http://lxr.linux.no/linux+v2.6.14/arch/mips/kernel/traps.c#L110
function: show_trace
     while (!kstack_end(stack)) {
                addr = *stack++;
                if (__kernel_text_address(addr)) {
                        printk(" [<%0*lx>] ", field, addr);
                        print_symbol("%s\n", addr);
                }
        }
---------------------------------------------------------------------------------
In the latest kernel, show_backtrace function is used, which does the same 
thing, but through different functions
http://lxr.linux.no/linux+v2.6.36/arch/mips/kernel/traps.c#L126
function: show_backtrace
        printk("Call Trace:\n");
         do {
                 print_ip_sym(pc);
                 pc = unwind_stack(task, &sp, pc, &ra);
         } while (pc);


Regards,
Sowmya

=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


From: loody
Date: Monday, January 3, 2011 - 7:32 am

hi all:

thanks for your kind help, that is what I want.
previously, I only see the address instead of function name, but after
I select CONFIG_KALLSYMS as Y, I can see the function names also.
BTW, what is the mechanism that kernel take to find out the function name?
Regards,
miloody

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
From: loody
Date: Monday, January 3, 2011 - 7:39 am

hi:

from log such as:
<80128580>] do_softirq+0x48/0x68
i know 0x48 is the offset of do_softirq, but how can I locate precise
what the offset 0x48 of do_softirq is? "objdump -s"?
Regards,
miloody

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
From: nilesh
Date: Monday, January 3, 2011 - 11:44 pm

Enabling the config option, it allows to build the symbol table for
kernel. It uses /proc/kallsyms.
Below links could help:
http://tldp.org/HOWTO/Module-HOWTO/x627.html

-- 
Thanks,
Nilesh

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Previous thread: Adding a kobject in the device model hierarchy by Prabhu nath on Saturday, January 1, 2011 - 9:28 am. (2 messages)

Next thread: some questions about errno.h by vichy on Sunday, January 2, 2011 - 2:18 am. (2 messages)