kexec.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Expose kallsyms data in vmcoreinfo note
@ 2022-05-17  0:05 Stephen Brennan
  2022-05-17  0:05 ` [PATCH 1/2] kallsyms: Move declarations to internal header Stephen Brennan
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Stephen Brennan @ 2022-05-17  0:05 UTC (permalink / raw)
  To: kexec

The kernel can be configured to contain a lot of introspection or
debugging information built-in, such as ORC for unwinding stack traces,
BTF for type information, and of course kallsyms. Debuggers could use
this information to navigate a core dump or live system, but they need
to be able to find it.

This patch series adds the necessary symbols into vmcoreinfo, which
would allow a debugger to find and interpret the kallsyms table. Using
the kallsyms data, the debugger can then lookup any symbol, allowing it
to find ORC, BTF, or any other useful data.

This would allow a live kernel, or core dump, to be debugged without
any DWARF debuginfo. This is useful for many cases: the debuginfo may
not have been generated, or you may not want to deploy the large files
everywhere you need them.

I've demonstrated a proof of concept for this at LSF/MM+BPF during a
lighting talk. Using a work-in-progress branch of the drgn debugger, and
an extended set of BTF generated by a patched version of dwarves, I've
been able to open a core dump without any DWARF info and do basic tasks
such as enumerating slab caches, block devices, tasks, and doing
backtraces. I hope this series can be a first step toward a new
possibility of "DWARFless debugging".

Related discussion around the BTF side of this:
https://lore.kernel.org/bpf/586a6288-704a-f7a7-b256-e18a675927df at oracle.com/T/#u

Some work-in-progress branches using this feature:
https://github.com/brenns10/dwarves/tree/remove_percpu_restriction_1
https://github.com/brenns10/drgn/tree/kallsyms_plus_btf

Stephen Brennan (2):
  kallsyms: Move declarations to internal header
  vmcoreinfo: Include kallsyms symbols

 kernel/crash_core.c        | 14 ++++++++++++++
 kernel/kallsyms.c          | 23 +----------------------
 kernel/kallsyms_internal.h | 30 ++++++++++++++++++++++++++++++
 3 files changed, 45 insertions(+), 22 deletions(-)
 create mode 100644 kernel/kallsyms_internal.h

-- 
2.30.2



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-06-13 22:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-17  0:05 [PATCH 0/2] Expose kallsyms data in vmcoreinfo note Stephen Brennan
2022-05-17  0:05 ` [PATCH 1/2] kallsyms: Move declarations to internal header Stephen Brennan
2022-05-17  0:05 ` [PATCH 2/2] vmcoreinfo: Include kallsyms symbols Stephen Brennan
2022-05-18 10:19 ` [PATCH 0/2] Expose kallsyms data in vmcoreinfo note Baoquan He
2022-05-23 18:00   ` Stephen Brennan
2022-05-25  2:39     ` Baoquan He
2022-06-13 20:39       ` Stephen Brennan
2022-06-13 21:26 ` Andrew Morton
2022-06-13 21:59   ` Stephen Brennan
2022-06-13 22:14     ` Andrew Morton
2022-06-13 22:33       ` Stephen Brennan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).