Image rebuilt to enable generation of BTF?

Hello,

Sorry, I am new to the FPGA community and try to learn as much as I could.
soure PYNQ: 2.6.2, Board: Pynq-Z2, Tool Version: Xilinx 2020.1, Linux: 18.04.4

Since I want to make ebpf + co-re to work, I would need CONFIG_DEBUG_INFO_BTF in Kernel config. I try to add that into PYNQ/sdbuild/boot/meta-pynq/recipes-kernel/linux/linux-xlnx/pynq.cfg and then I rebuild the image in two steps 1. make images ARCH_ONLY=arm (board agnostic, I think this is the step where linux kernel related configuration get built) 2. make PREBUILT= BOARDS=Pynq-Z2. Despite some library version conflicts and missing in the end I generate the final output in sdbuild/output/Pynq-Z2-2.6.0.img. However, after a successful boot, I cannot see CONFIG_DEBUG_INFO_BTF in /proc/config.gz.

I have another general question:

  1. Also in order for vmlinux ELF file to contain btf, it needs pahole to support. Not sure how to make pynq image build process to be aware of that

  2. Say if I need to change pynq linux kernel version, is it possible to rebuild an image that is different from the default version? (e.g. My virtual machine has 5.4.0 and somehow I need pynq to work on say 5.11.0)

  3. I need other tools libbpf, bpftool and LLVM. Is it possible to include those in the process?

Cheers,

Hi there,

You might need to set/unset additional dependency kernel configs for CONFIG_DEBUG_INFO_BTF to show up – there’s a relevant stackoverflow post.

  1. Not very familiar with pahole, seems like you would need to google around on how to get it into a 32-bit arm system (maybe issues like this could be helpful for reference?
  2. I’m not sure if there’s a straightforward way of doing this, you are likely to run into many dependency issues. You’d have to look around for how this is done in the petalinux flow (e.g. how to find kernel version in petalinux).
  3. If the packages you need are available on canonical packages for an arm32 architecture then you could just add them to multistrap.config in the sdbuild flow. Otherwise you would need to make packages for them in sdbuild/packages, for example PYNQ/sdbuild/packages/glog at master · Xilinx/PYNQ · GitHub.

Thanks
Shawn