2012/10/16 Lei Wen <leiwen@xxxxxxxxxxx>: > Current I am trying to make crash support display out function param and > local value while backtracing. > > The idea for this patch is to mimic core dump support in gdb, teaching the > crash to supply the regset to the gdb, so that gdb could have full knowledge > what is going on in the panic point. Just for comparison/inspiration, I'm attaching the patch I've been using for some time now to get this information in crash. It enables gdb's backtrace directly so you will need to run it with "backtrace" or "gdb bt". I've made no attempt to clean up the patch, it's as-is (hacky) and applies on top of Crash 6.0.6. I've only tested it on ARM and there are several rough edges even on ARM (example, observe the "request failed" message after the successful trace). It looks like this: crash> set 533 crash> bt PID: 533 TASK: e62d4560 CPU: 1 COMMAND: "kworker/u:2" #0 [<c0648f14>] (__schedule) from [<c0649688>] #1 [<c0649688>] (schedule) from [<c064a898>] #2 [<c064a898>] (__mutex_lock_slowpath) from [<c064a98c>] #3 [<c064a98c>] (mutex_lock) from [<c03171dc>] #4 [<c03171dc>] (device_attach) from [<c03168fc>] #5 [<c03168fc>] (bus_probe_device) from [<c03149dc>] #6 [<c03149dc>] (device_add) from [<c040cd88>] #7 [<c040cd88>] (sdio_add_func) from [<c040c060>] #8 [<c040c060>] (mmc_attach_sdio) from [<c0404930>] #9 [<c0404930>] (mmc_rescan) from [<c00bb5e4>] #10 [<c00bb5e4>] (process_one_work) from [<c00bbaf4>] #11 [<c00bbaf4>] (worker_thread) from [<c00c0564>] #12 [<c00c0564>] (kthread) from [<c0064288>] crash> gdb bt #0 0xc0648f14 in context_switch (next=0xe49b6520, prev=0xe62d4560, rq=0xc1b4a8c0) at /tmp/kernel/kernel/sched.c:3216 #1 __schedule () at /tmp/kernel/kernel/sched.c:4354 #2 0xc0649688 in schedule () at /tmp/kernel/kernel/sched.c:4406 #3 0xc064a898 in __mutex_lock_common (state=2, lock=0xe49f1c3c, subclass=<optimized out>, nest_lock=<optimized out>, ip=<optimized out>) at /tmp/kernel/kernel/mutex.c:244 #4 __mutex_lock_slowpath (lock_count=0xe49f1c3c) at /tmp/kernel/kernel/mutex.c:405 #5 0xc064a98c in __mutex_fastpath_lock (fail_fn=0xc064a760 <__mutex_lock_slowpath>, count=0xe49f1c3c) at /tmp/kernel/arch/arm/include/asm/mutex.h:43 #6 mutex_lock (lock=0xe49f1c3c) at /tmp/kernel/kernel/mutex.c:90 #7 0xc03171dc in device_lock (dev=0xe49f1c08) at /tmp/kernel/include/linux/device.h:673 #8 device_attach (dev=0xe49f1c08) at /tmp/kernel/drivers/base/dd.c:246 #9 0xc03168fc in bus_probe_device (dev=<optimized out>) at /tmp/kernel/drivers/base/bus.c:493 #10 0xc03149dc in device_add (dev=0xe49f1c08) at /tmp/kernel/drivers/base/core.c:978 #11 0xc040cd88 in sdio_add_func (func=0xe49f1c00) at /tmp/kernel/drivers/mmc/core/sdio_bus.c:315 #12 0xc040c060 in mmc_attach_sdio (host=0xe6486800) at /tmp/kernel/drivers/mmc/core/sdio.c:1197 #13 0xc0404930 in mmc_rescan_try_freq (freq=<optimized out>, host=0xe6486800) at /tmp/kernel/drivers/mmc/core/core.c:2069 #14 mmc_rescan (work=0xe6486a08) at /tmp/kernel/drivers/mmc/core/core.c:2188 #15 0xc00bb5e4 in process_one_work (worker=0xe62e04e0, work=0xe6486a08) at /tmp/kernel/kernel/workqueue.c:1870 #16 0xc00bbaf4 in worker_thread (__worker=0xe62e04e0) at /tmp/kernel/kernel/workqueue.c:1981 #17 0xc00c0564 in kthread (_create=0xe60a9ec4) at /tmp/kernel/kernel/kthread.c:96 #18 0xc0064288 in kernel_thread_helper () Register 25 is not available gdb: gdb request failed: bt crash> gdb bt full #0 0xc0648f14 in context_switch (next=0xe49b6520, prev=0xe62d4560, rq=0xc1b4a8c0) at /tmp/kernel/kernel/sched.c:3216 mm = 0x0 oldmm = <optimized out> #1 __schedule () at /tmp/kernel/kernel/sched.c:4354 prev = 0xe62d4560 next = 0xe49b6520 switch_count = <optimized out> rq = 0xc1b4a8c0 cpu = <optimized out> #2 0xc0649688 in schedule () at /tmp/kernel/kernel/sched.c:4406 tsk = <unavailable> #3 0xc064a898 in __mutex_lock_common (state=2, lock=0xe49f1c3c, subclass=<optimized out>, nest_lock=<optimized out>, ip=<optimized out>) at /tmp/kernel/kernel/mutex.c:244 task = 0xe62d4560 waiter = { list = { next = 0xe49f1c48, prev = 0xe49f1c48 }, task = 0xe62d4560 } #4 __mutex_lock_slowpath (lock_count=0xe49f1c3c) at /tmp/kernel/kernel/mutex.c:405 lock = 0xe49f1c3c #5 0xc064a98c in __mutex_fastpath_lock (fail_fn=0xc064a760 <__mutex_lock_slowpath>, count=0xe49f1c3c) at /tmp/kernel/arch/arm/include/asm/mutex.h:43 __ex_flag = <optimized out> __res = <optimized out> #6 mutex_lock (lock=0xe49f1c3c) at /tmp/kernel/kernel/mutex.c:90 No locals. #7 0xc03171dc in device_lock (dev=0xe49f1c08) at /tmp/kernel/include/linux/device.h:673 No locals. #8 device_attach (dev=0xe49f1c08) at /tmp/kernel/drivers/base/dd.c:246 ret = 0 #9 0xc03168fc in bus_probe_device (dev=<optimized out>) at /tmp/kernel/drivers/base/bus.c:493 bus = <optimized out> ret = <optimized out> #10 0xc03149dc in device_add (dev=0xe49f1c08) at /tmp/kernel/drivers/base/core.c:978 parent = 0xe3c7e008 class_intf = <optimized out> error = 0 __func__ = "device_add" #11 0xc040cd88 in sdio_add_func (func=0xe49f1c00) at /tmp/kernel/drivers/mmc/core/sdio_bus.c:315 ret = <unavailable> #12 0xc040c060 in mmc_attach_sdio (host=0xe6486800) at /tmp/kernel/drivers/mmc/core/sdio.c:1197 err = <optimized out> i = <optimized out> funcs = 2 ocr = 553647872 card = 0xe3c7e000 #13 0xc0404930 in mmc_rescan_try_freq (freq=<optimized out>, host=0xe6486800) at /tmp/kernel/drivers/mmc/core/core.c:2069 No locals. #14 mmc_rescan (work=0xe6486a08) at /tmp/kernel/drivers/mmc/core/core.c:2188 host = 0xe6486800 i = <optimized out> #15 0xc00bb5e4 in process_one_work (worker=0xe62e04e0, work=0xe6486a08) at /tmp/kernel/kernel/workqueue.c:1870 cwq = 0xe6344a00 gcwq = <optimized out> bwh = <unavailable> cpu_intensive = <optimized out> f = 0xc04046e4 <mmc_rescan> #16 0xc00bbaf4 in worker_thread (__worker=0xe62e04e0) at /tmp/kernel/kernel/workqueue.c:1981 work = <optimized out> worker = 0xe62e04e0 gcwq = 0xc09c0a60 #17 0xc00c0564 in kthread (_create=0xe60a9ec4) at /tmp/kernel/kernel/kthread.c:96 create = 0xe60a9ec4 threadfn = 0xc00bb960 <worker_thread> data = 0xe62e04e0 self = { should_stop = 0, data = 0xe62e04e0, exited = { done = 0, wait = { lock = { { rlock = { raw_lock = { lock = 0 }, break_lock = 0 } } }, task_list = { next = 0xe62effd0, prev = 0xe62effd0 } } } } ret = -4 #18 0xc0064288 in kernel_thread_helper () No symbol table info available. Register 25 is not available gdb: gdb request failed: bt full
Attachment:
gdbbt.patch
Description: Binary data
-- Crash-utility mailing list Crash-utility@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/crash-utility