Support dumping BTF not only from ELF files, but also from raw BTF information (which starts directly with BTF magic number) like the one peresent in /sys/kernel/btf/vmlinux.
This way, btfdump can be used for generating the vmlinux.h for the given kernel.
Also, don't use mmap, since it doesn't work on sysfs.
Support dumping BTF not only from ELF files, but also from raw BTF information (which starts directly with BTF magic number) like the one peresent in /sys/kernel/btf/vmlinux.
This way, btfdump can be used for generating the vmlinux.h for the given kernel.
Also, don't use mmap, since it doesn't work on sysfs.