> -----Original Message----- > From: Toke Høiland-Jørgensen <toke@xxxxxxxxxx> > Sent: 01 October 2020 14:37 > To: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> > Cc: Kevin Sheldrake <Kevin.Sheldrake@xxxxxxxxxxxxx>; > bpf@xxxxxxxxxxxxxxx > Subject: [EXTERNAL] Re: BTF without CONFIG_DEBUG_INFO_BTF=y > > Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> writes: > > > Em Thu, Oct 01, 2020 at 09:50:29AM -0300, Arnaldo Carvalho de Melo > escreveu: > >> Em Thu, Oct 01, 2020 at 12:33:18PM +0200, Toke Høiland-Jørgensen > escreveu: > >> > Kevin Sheldrake <Kevin.Sheldrake@xxxxxxxxxxxxx> writes: > >> > > I've seen mention a few times that BTF information can be made > >> > > available from a kernel that wasn't configured with > >> > > CONFIG_DEBUG_INFO_BTF. Please can someone tell me if this is true > >> > > and, if so, how I could go about accessing and using it in > >> > > kernels 4.15 to 5.8? > > > >> > > I have built the dwarves package from the github latest and run > >> > > pahole with '-J' against my kernel image to no avail - it > >> > > actually seg > >> > > faults: > > > >> > > ~/dwarves/build $ sudo ./pahole /boot/vmlinuz-5.3.0-1022-azure > >> > > btf_elf__new: cannot get elf header. > >> > > ctf__new: cannot get elf header. > >> > > ~/dwarves/build $ sudo ./pahole -J /boot/vmlinuz-5.3.0-1022-azure > >> > > btf_elf__new: cannot get elf header. > >> > > ctf__new: cannot get elf header. > >> > > Segmentation fault > >> > > ~/dwarves/build $ sudo ./pahole --version > >> > > v1.17 > > > >> > > Judging by the output, I'm guessing that my kernel image isn't > >> > > the right kind of file. Can someone point me in the right direction? > > > >> > vmlinuz is a compressed image. There's a script in the kernel > >> > source tree (scripts/extract-vmlinux), however the kernel image in > >> > /boot/ probably also has debug information stripped from it, so > >> > that likely won't help you. You'll need to get hold of a kernel > >> > image with debug information still intact somehow... > > SNIP > > Reported-by: Kevin Sheldrake <Kevin.Sheldrake@xxxxxxxxxxxxx> > > Cc: Toke Høiland-Jørgensen <toke@xxxxxxxxxx> > > Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> > > Yeah, that's much better! > > Acked-by: Toke Høiland-Jørgensen <toke@xxxxxxxxxx> Thank you to Arnaldo for identifying and fixing the seg fault. Am I right in thinking that pahole can't work on a standard out-of-the-box distro such as Ubuntu 16.04 (v4.15) or 18.04 (v5.3/5.4) as debugging information isn't available in the kernel, and equally isn't available anywhere else, without recompiling it? Many thanks Kev