add debug messages

Signed-off-by: Quentin JEROME <qjerome@users.noreply.github.com>
pull/583/head
Quentin JEROME 2 years ago
parent b0f999419e
commit 74bc754862

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

Loading…
Cancel
Save