aya: More discrete feature logging

Just use the Debug formatter vs. printing a message for each probe.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
pull/522/head
Dave Tucker 2 years ago
parent d0b3d3b2fa
commit 7479c1dd6c

@ -172,25 +172,6 @@ pub struct BtfFeatures {
pub btf_type_tag: bool, pub btf_type_tag: bool,
} }
impl std::fmt::Display for BtfFeatures {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.write_fmt(format_args!(
"[FEAT PROBE] BTF func support: {}\n\
[FEAT PROBE] BTF global func support: {}\n\
[FEAT PROBE] BTF var and datasec support: {}\n\
[FEAT PROBE] BTF float support: {}\n\
[FEAT PROBE] BTF decl_tag support: {}\n\
[FEAT PROBE] BTF type_tag support: {}",
self.btf_func,
self.btf_func_global,
self.btf_datasec,
self.btf_float,
self.btf_decl_tag,
self.btf_type_tag,
))
}
}
/// Bpf Type Format metadata. /// Bpf Type Format metadata.
/// ///
/// BTF is a kind of debug metadata that allows eBPF programs compiled against one kernel version /// BTF is a kind of debug metadata that allows eBPF programs compiled against one kernel version

@ -96,28 +96,11 @@ impl Features {
bpf_perf_link: is_perf_link_supported(), bpf_perf_link: is_perf_link_supported(),
btf, btf,
}; };
debug!("BPF Feature Detection: {:#?}", f);
debug!("{}", f);
if let Some(btf) = f.btf.as_ref() {
debug!("{}", btf)
}
f f
} }
} }
impl std::fmt::Display for Features {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_fmt(format_args!(
"[FEAT PROBE] BPF program name support: {}\n\
[FEAT PROBE] bpf_link support for kprobe/uprobe/tracepoint: {}\n\
[FEAT PROBE] BTF support: {}",
self.bpf_name,
self.bpf_perf_link,
self.btf.is_some()
))
}
}
/// Builder style API for advanced loading of eBPF programs. /// Builder style API for advanced loading of eBPF programs.
/// ///
/// Loading eBPF code involves a few steps, including loading maps and applying /// Loading eBPF code involves a few steps, including loading maps and applying

Loading…
Cancel
Save