Commit dee7fa91 authored by Russell King's avatar Russell King

[ARM] Add kallsyms support for ARM

This cset adds support for kallsyms for the ARM kernel, and ensures
that we have a reliable function prolog for backtracing.
parent 20c79d0e
......@@ -15,8 +15,8 @@ GZFLAGS :=-9
CFLAGS :=$(CFLAGS:-O2=-Os)
ifneq ($(CONFIG_NO_FRAME_POINTER),y)
CFLAGS :=$(CFLAGS: -fomit-frame-pointer=)
ifeq ($(CONFIG_FRAME_POINTER),y)
CFLAGS :=$(CFLAGS:-fomit-frame-pointer=-mapcs -mno-sched-prolog)
endif
ifeq ($(CONFIG_DEBUG_INFO),y)
......
......@@ -533,11 +533,14 @@ source net/bluetooth/Config.in
mainmenu_option next_comment
comment 'Kernel hacking'
# Always compile kernel with framepointer (until 2.4 real comes out)
# Bug reports aren't much use without this.
bool 'Compile kernel without frame pointer' CONFIG_NO_FRAME_POINTER
# RMK wants arm kernels compiled with frame pointers so hardwire this to y. If
# you know what you are doing and are willing to live without stack traces, you
# can get a slightly smaller kernel by setting this option to n, but then RMK
# will have to kill you ;).
define_bool CONFIG_FRAME_POINTER y
bool 'Verbose user fault messages' CONFIG_DEBUG_USER
bool 'Include debugging information in kernel binary' CONFIG_DEBUG_INFO
bool 'Include GDB debugging information in kernel binary' CONFIG_DEBUG_INFO
bool 'Kernel debugging' CONFIG_DEBUG_KERNEL
dep_bool ' Debug memory allocations' CONFIG_DEBUG_SLAB $CONFIG_DEBUG_KERNEL
......@@ -546,6 +549,7 @@ dep_bool ' Spinlock debugging' CONFIG_DEBUG_SPINLOCK $CONFIG_DEBUG_KERNEL
dep_bool ' Wait queue debugging' CONFIG_DEBUG_WAITQ $CONFIG_DEBUG_KERNEL
dep_bool ' Verbose BUG() reporting (adds 70K)' CONFIG_DEBUG_BUGVERBOSE $CONFIG_DEBUG_KERNEL
dep_bool ' Verbose kernel error messages' CONFIG_DEBUG_ERRORS $CONFIG_DEBUG_KERNEL
dep_bool ' Load all symbols for debugging/kksymoops' CONFIG_KALLSYMS $CONFIG_DEBUG_KERNEL $CONFIG_FRAME_POINTER
# These options are only for real kernel hackers who want to get their hands dirty.
dep_bool ' Kernel low-level debugging functions' CONFIG_DEBUG_LL $CONFIG_DEBUG_KERNEL
dep_bool ' Kernel low-level debugging messages via footbridge serial port' CONFIG_DEBUG_DC21285_PORT $CONFIG_DEBUG_LL $CONFIG_FOOTBRIDGE
......
......@@ -669,7 +669,7 @@ CONFIG_PARTITION_ADVANCED=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
......
......@@ -654,7 +654,7 @@ CONFIG_USB_MOUSE=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
# CONFIG_DEBUG_USER is not set
# CONFIG_DEBUG_INFO is not set
......
......@@ -610,7 +610,7 @@ CONFIG_FONT_8x16=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
# CONFIG_DEBUG_KERNEL is not set
......
......@@ -954,7 +954,7 @@ CONFIG_SWITCHES_UCB1X00=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
......
......@@ -1141,7 +1141,7 @@ CONFIG_BT_HCIVHCI=m
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_USER=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_KERNEL=y
......
......@@ -863,7 +863,7 @@ CONFIG_PC_KEYMAP=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
......
......@@ -957,7 +957,7 @@ CONFIG_BT_HCIUART=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
......
......@@ -884,7 +884,7 @@ CONFIG_FONT_8x16=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
......
......@@ -595,7 +595,7 @@ CONFIG_PARTITION_ADVANCED=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
# CONFIG_DEBUG_USER is not set
# CONFIG_DEBUG_INFO is not set
......
......@@ -678,7 +678,7 @@ CONFIG_MSDOS_PARTITION=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
# CONFIG_DEBUG_USER is not set
# CONFIG_DEBUG_INFO is not set
# CONFIG_NO_PGT_CACHE is not set
......
......@@ -886,7 +886,7 @@ CONFIG_SOUND=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
# CONFIG_NO_PGT_CACHE is not set
......
......@@ -577,7 +577,7 @@ CONFIG_MSDOS_PARTITION=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
# CONFIG_NO_PGT_CACHE is not set
......
......@@ -605,7 +605,7 @@ CONFIG_SOUND_UDA1341=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
......
......@@ -625,7 +625,7 @@ CONFIG_SOUND_UDA1341=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
# CONFIG_DEBUG_USER is not set
# CONFIG_DEBUG_INFO is not set
......
......@@ -722,7 +722,7 @@ CONFIG_FONT_8x16=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
......
......@@ -735,7 +735,7 @@ CONFIG_USB_MOUSE=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
......
......@@ -939,7 +939,7 @@ CONFIG_SOUND_H3600_UDA1341=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
# CONFIG_DEBUG_USER is not set
# CONFIG_DEBUG_INFO is not set
......
......@@ -653,7 +653,7 @@ CONFIG_FONT_8x16=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
......
......@@ -786,7 +786,7 @@ CONFIG_MSDOS_PARTITION=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
# CONFIG_NO_PGT_CACHE is not set
......
......@@ -881,7 +881,7 @@ CONFIG_SOUND_SA1100=m
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
# CONFIG_DEBUG_USER is not set
# CONFIG_DEBUG_INFO is not set
# CONFIG_NO_PGT_CACHE is not set
......
......@@ -883,7 +883,7 @@ CONFIG_SOUND_SA1100SSP=m
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
......
......@@ -860,7 +860,7 @@ CONFIG_SOUND_PRIME=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_USER=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_KERNEL=y
......
......@@ -466,7 +466,7 @@ CONFIG_EXT2_FS=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_USER=y
CONFIG_DEBUG_INFO=y
# CONFIG_DEBUG_KERNEL is not set
......
......@@ -1104,7 +1104,7 @@ CONFIG_USB_OHCI_SA1111=m
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
CONFIG_DEBUG_KERNEL=y
......
......@@ -732,7 +732,7 @@ CONFIG_SOUND_PANGOLIN_UDA1341=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_USER=y
CONFIG_DEBUG_INFO=y
......
......@@ -773,7 +773,7 @@ CONFIG_USB_MOUSE=m
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_USER=y
CONFIG_DEBUG_INFO=y
......
......@@ -773,7 +773,7 @@ CONFIG_USB_MOUSE=m
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_USER=y
CONFIG_DEBUG_INFO=y
......
......@@ -764,7 +764,7 @@ CONFIG_USB_MOUSE=m
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_USER=y
CONFIG_DEBUG_INFO=y
......
......@@ -773,7 +773,7 @@ CONFIG_USB_MOUSE=m
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_USER=y
CONFIG_DEBUG_INFO=y
......
......@@ -525,7 +525,7 @@ CONFIG_MSDOS_PARTITION=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
......
......@@ -830,7 +830,7 @@ CONFIG_SOUND_VIDC=m
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
......
......@@ -726,7 +726,7 @@ CONFIG_MCP_UCB1200_TS=y
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_ERRORS=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
......
......@@ -917,7 +917,7 @@ CONFIG_SOUND_SB=m
#
# Kernel hacking
#
CONFIG_NO_FRAME_POINTER=y
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_USER=y
# CONFIG_DEBUG_INFO is not set
# CONFIG_DEBUG_KERNEL is not set
......
......@@ -946,7 +946,7 @@ CONFIG_SOUND_H3600_UDA1341=m
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
# CONFIG_DEBUG_USER is not set
# CONFIG_DEBUG_INFO is not set
# CONFIG_NO_PGT_CACHE is not set
......
......@@ -952,7 +952,7 @@ CONFIG_USB_USBNET=m
#
# Kernel hacking
#
# CONFIG_NO_FRAME_POINTER is not set
CONFIG_FRAME_POINTER=y
CONFIG_DEBUG_USER=y
CONFIG_DEBUG_INFO=y
# CONFIG_NO_PGT_CACHE is not set
......
......@@ -12,7 +12,7 @@
#endif
.macro zero_fp
#ifndef CONFIG_NO_FRAME_POINTER
#ifdef CONFIG_FRAME_POINTER
mov fp, #0
#endif
.endm
......
......@@ -158,6 +158,8 @@ void show_regs(struct pt_regs * regs)
flags = condition_codes(regs);
print_symbol("PC is at %s\n", instruction_pointer(regs));
print_symbol("LR is at %s\n", regs->ARM_lr);
printk("pc : [<%08lx>] lr : [<%08lx>] %s\n"
"sp : %08lx ip : %08lx fp : %08lx\n",
instruction_pointer(regs),
......
......@@ -48,6 +48,12 @@ const char *processor_modes[]=
static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" };
void dump_backtrace_entry(unsigned long where, unsigned long from)
{
printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from);
print_symbol(" %s\n", where);
}
/*
* Stack pointers should always be within the kernels view of
* physical memory. If it is not there, then we can't dump
......@@ -162,6 +168,11 @@ static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
c_backtrace(fp, processor_mode(regs));
}
void dump_stack(void)
{
__backtrace();
}
/*
* This is called from SysRq-T (show_task) to display the current call
* trace for each process. This version will also display the running
......@@ -190,6 +201,7 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
console_verbose();
spin_lock_irq(&die_lock);
bust_spinlocks(1);
printk("Internal error: %s: %x\n", str, err);
printk("CPU: %d\n", smp_processor_id());
......@@ -203,6 +215,7 @@ NORET_TYPE void die(const char *str, struct pt_regs *regs, int err)
dump_instr(regs);
}
bust_spinlocks(0);
spin_unlock_irq(&die_lock);
do_exit(SIGSEGV);
}
......
......@@ -26,7 +26,7 @@ ENTRY(__backtrace)
ENTRY(c_backtrace)
#ifdef CONFIG_NO_FRAME_POINTER
#ifndef CONFIG_FRAME_POINTER
mov pc, lr
#else
......@@ -62,10 +62,9 @@ ENTRY(c_backtrace)
ldr r3, .Ldsi+4
teq r1, r3
subeq save, save, #4
adr r0, .Lfe
mov r1, save
bic r2, r2, mask
bl printk @ print pc and link register
mov r0, save
bic r1, r2, mask
bl dump_backtrace_entry
ldr r0, [frame, #-8] @ get sp
sub r0, r0, #4
......@@ -140,7 +139,6 @@ ENTRY(c_backtrace)
mov r0, stack
LOADREGS(fd, sp!, {instr, reg, stack, r7, pc})
.Lfe: .asciz "Function entered at [<%p>] from [<%p>]\n"
.Lfp: .asciz " r%d = %08X%c"
.Lcr: .asciz "\n"
.Lbad: .asciz "Backtrace aborted due to bad frame pointer <%p>\n"
......
......@@ -74,6 +74,12 @@ SECTIONS
__stop___ksymtab = .;
}
__kallsyms : { /* All kernel symbols */
__start___kallsyms = .;
*(__kallsyms)
__stop___kallsyms = .;
}
. = ALIGN(8192);
.data : {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment