Skip to content

Commit

Permalink
add debug messages
Browse files Browse the repository at this point in the history
Signed-off-by: Quentin JEROME <[email protected]>
  • Loading branch information
qjerome committed Apr 19, 2023
1 parent b0f9994 commit 74bc754
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion aya-obj/src/btf/btf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ impl Btf {
features: &BtfFeatures,
) -> Result<(), BtfError> {
let mut types = mem::take(&mut self.types);

for i in 0..types.types.len() {
let t = &types.types[i];
let kind = t.kind();
Expand Down Expand Up @@ -549,10 +550,14 @@ impl Btf {
// Sanitize BTF_FUNC_GLOBAL and memset, memcpy
let mut fixed_ty = ty.clone();
if ty.linkage() == FuncLinkage::Global {
debug!(
if !features.btf_func_global {
debug!(
"{}: BTF_FUNC_GLOBAL not supported. replacing with BTF_FUNC_STATIC",
kind
);
} else {
debug!("changing FUNC {name} linkage to BTF_FUNC_STATIC");
}
fixed_ty.set_linkage(FuncLinkage::Static);
}
types.types[i] = BtfType::Func(fixed_ty);
Expand Down

0 comments on commit 74bc754

Please sign in to comment.