From 2b7dda766f3b002fc96915366d560c0a279106e3 Mon Sep 17 00:00:00 2001 From: Dave Tucker Date: Wed, 15 Dec 2021 11:07:23 +0000 Subject: [PATCH] btf: Fix for rename of BPF_ -> BPF_CORE_ Signed-off-by: Dave Tucker --- aya/src/obj/btf/relocation.rs | 48 +++++++++++++++++------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/aya/src/obj/btf/relocation.rs b/aya/src/obj/btf/relocation.rs index 74fcd2c3..fe9ba4ef 100644 --- a/aya/src/obj/btf/relocation.rs +++ b/aya/src/obj/btf/relocation.rs @@ -85,18 +85,18 @@ fn err_type_name(name: &Option) -> String { #[derive(Copy, Clone, Debug)] #[repr(u32)] enum RelocationKind { - FieldByteOffset = BPF_FIELD_BYTE_OFFSET, - FieldByteSize = BPF_FIELD_BYTE_SIZE, - FieldExists = BPF_FIELD_EXISTS, - FieldSigned = BPF_FIELD_SIGNED, - FieldLShift64 = BPF_FIELD_LSHIFT_U64, - FieldRShift64 = BPF_FIELD_RSHIFT_U64, - TypeIdLocal = BPF_TYPE_ID_LOCAL, - TypeIdTarget = BPF_TYPE_ID_TARGET, - TypeExists = BPF_TYPE_EXISTS, - TypeSize = BPF_TYPE_SIZE, - EnumVariantExists = BPF_ENUMVAL_EXISTS, - EnumVariantValue = BPF_ENUMVAL_VALUE, + FieldByteOffset = BPF_CORE_FIELD_BYTE_OFFSET, + FieldByteSize = BPF_CORE_FIELD_BYTE_SIZE, + FieldExists = BPF_CORE_FIELD_EXISTS, + FieldSigned = BPF_CORE_FIELD_SIGNED, + FieldLShift64 = BPF_CORE_FIELD_LSHIFT_U64, + FieldRShift64 = BPF_CORE_FIELD_RSHIFT_U64, + TypeIdLocal = BPF_CORE_TYPE_ID_LOCAL, + TypeIdTarget = BPF_CORE_TYPE_ID_TARGET, + TypeExists = BPF_CORE_TYPE_EXISTS, + TypeSize = BPF_CORE_TYPE_SIZE, + EnumVariantExists = BPF_CORE_ENUMVAL_EXISTS, + EnumVariantValue = BPF_CORE_ENUMVAL_VALUE, } impl TryFrom for RelocationKind { @@ -106,18 +106,18 @@ impl TryFrom for RelocationKind { use RelocationKind::*; Ok(match v { - BPF_FIELD_BYTE_OFFSET => FieldByteOffset, - BPF_FIELD_BYTE_SIZE => FieldByteSize, - BPF_FIELD_EXISTS => FieldExists, - BPF_FIELD_SIGNED => FieldSigned, - BPF_FIELD_LSHIFT_U64 => FieldLShift64, - BPF_FIELD_RSHIFT_U64 => FieldRShift64, - BPF_TYPE_ID_LOCAL => TypeIdLocal, - BPF_TYPE_ID_TARGET => TypeIdTarget, - BPF_TYPE_EXISTS => TypeExists, - BPF_TYPE_SIZE => TypeSize, - BPF_ENUMVAL_EXISTS => EnumVariantExists, - BPF_ENUMVAL_VALUE => EnumVariantValue, + BPF_CORE_FIELD_BYTE_OFFSET => FieldByteOffset, + BPF_CORE_FIELD_BYTE_SIZE => FieldByteSize, + BPF_CORE_FIELD_EXISTS => FieldExists, + BPF_CORE_FIELD_SIGNED => FieldSigned, + BPF_CORE_FIELD_LSHIFT_U64 => FieldLShift64, + BPF_CORE_FIELD_RSHIFT_U64 => FieldRShift64, + BPF_CORE_TYPE_ID_LOCAL => TypeIdLocal, + BPF_CORE_TYPE_ID_TARGET => TypeIdTarget, + BPF_CORE_TYPE_EXISTS => TypeExists, + BPF_CORE_TYPE_SIZE => TypeSize, + BPF_CORE_ENUMVAL_EXISTS => EnumVariantExists, + BPF_CORE_ENUMVAL_VALUE => EnumVariantValue, kind => return Err(BtfError::InvalidRelocationKind { kind }), }) }