1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
Description: improve btf test
This test attempts to read from /sys/kernel/btf/vmlinux, which doesn't exist on all kernels.
Author: Fabian Grünbichler <debian@fabian.gruenbichler.email>
Forwarded: no
--- a/src/btf/btf.rs
+++ b/src/btf/btf.rs
@@ -1816,6 +1816,8 @@
#[cfg(target_endian = "little")]
#[cfg(not(target_arch = "powerpc64"))]
fn test_read_btf_from_sys_fs() {
+ // fails on debci sometimes
+ if !std::path::Path::new("/sys/kernel/btf/vmlinux").exists() { return; }
let btf = Btf::parse_file("/sys/kernel/btf/vmlinux", Endianness::default()).unwrap();
let task_struct_id = btf
.id_by_type_name_kind("task_struct", BtfKind::Struct)
|