[Crash-utility] question about kernel module dwarf unwinder support

Jiong Wang jiwang at tilera.com
Sun Sep 29 09:30:45 UTC 2013


Hi All,

We have ported crash-utility to TileGX arch and it generally works well.

For stack backtrace, we are using dwarf based approach and using
.debug_frame section.

Currently, the problem is letting dwarf unwinder support kernel module
(.ko), we have work out this problem by quite ugly way:

* we modified target independent code in kernel.c to invoke new added
tilegx hook "tilegx_add_module_unwind_table" for "mod -s" command.

diff --git a/kernel.c b/kernel.c
index 3fc0b68..5f3f2ef 100755
--- a/kernel.c
+++ b/kernel.c
@@ -3760,6 +3760,10 @@ do_module_cmd(ulong flag, char *modref, ulong
address,
break;

case LOAD_SPECIFIED_MODULE_SYMBOLS:
+ #ifdef TILEGX
+ if (!tilegx_add_module_unwind_table(modref, objfile, address))
+ error(FATAL, "cannot load debug frame from: %s\n", objfile);
+ #endif


* in "tilegx_add_module_unwind_table" we parse .ko file, locate
.debug_frame/.rela.debug_frame, perform relocation on .debug_frame, then
add the relocated .debug_frame to module unwind table list. then later,
the if the pc is in module address space, then module unwind table list
will be searched instead of kernel unwinder table.

I don't know if this approach will be accepted by the community when we
return all our TileGX backend. Are there any better approach to support
kernel module dwarf unwinding that will not affect the target-indepent code?

thanks in advance.


Regards,
Jiong
Tilera Corporation.




More information about the Crash-utility mailing list