Struct EunomiaObjectMeta

Source
pub struct EunomiaObjectMeta {
    pub export_types: Vec<ExportedTypesStructMeta>,
    pub bpf_skel: BpfSkeletonMeta,
    pub perf_buffer_pages: usize,
    pub perf_buffer_time_ms: usize,
    pub poll_timeout_ms: i32,
    pub debug_verbose: bool,
    pub print_header: bool,
    pub enable_multiple_export_types: bool,
}
Expand description

global meta data config

Fields§

§export_types: Vec<ExportedTypesStructMeta>

Export types

§bpf_skel: BpfSkeletonMeta

The object skeleton

§perf_buffer_pages: usize

perf buffer related config

§perf_buffer_time_ms: usize

perf buffer related config

§poll_timeout_ms: i32

poll config

§debug_verbose: bool

Whether libbpf should print debug info This will only be apply to libbpf when start running

§print_header: bool

print config print the types and names of export headers

§enable_multiple_export_types: bool

Whether to enable support of multiple export types If set to false, bpf-loader-rs will keep compatibility to the old version If set to true, the field export_config of each map will be used and the export_types field will be ignored

Implementations§

Source§

impl EunomiaObjectMeta

Source

pub fn build_argument_parser(&self) -> Result<Command>

Build an argument parser use the cmdarg sections in .rodata/.bss variables.

Each variable in the .bss or .rodata sections will be mapped into a command line argument.

If a variable has it’s default value, the default value will be used in the command line parser.

Variables with bool will have some special cases:

  • If the variable has no default values, a switch named --<NAME> will be added, indicating to set the value to true or false
  • If the default value if true, a switch named --disable-<NAME> will be added, means set the value to false
  • If the default value if false, a switch named --enable-<NAME> will be added, means to set the value to true.

The first will be used to set the value of the variable to true, second one will be used to set false

Variables with other types will accept values. But values will be checked in parse_arguments_and_fill_skeleton_variables, so here the values input in the command line parser will be regarded as strings.

Source§

impl EunomiaObjectMeta

Source

pub fn parse_arguments_and_fill_skeleton_variables( &mut self, args: &ArgMatches, on_unpresent: UnpresentVariableAction, ) -> Result<()>

Parser the values from the command line parser

The clap parser gives us all values as strings, so here will try to parse the strings into the variable’s own types (e.g, string, int, unsigned int). If it fails, Err will be returned

This function will fill the value field in the DataSectionVariableMeta.

If the on_unpresent behavior is FillWithZero, in this way if we find a command line argument with no values provided (this situation may only happen if the command line argument was created with no default values, a.k.a the value field is None in DataSectionVariableMeta), the value field will still be leaved None. In this way, the section_loader will fill zeros in the corresponding memory areas.

If the on_unpresent behavior is ReportError, in this way if we find a command line argument with no values, we’ll report an error.

Trait Implementations§

Source§

impl Clone for EunomiaObjectMeta

Source§

fn clone(&self) -> EunomiaObjectMeta

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EunomiaObjectMeta

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for EunomiaObjectMeta

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for EunomiaObjectMeta

Source§

fn eq(&self, other: &EunomiaObjectMeta) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for EunomiaObjectMeta

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for EunomiaObjectMeta

Source§

impl StructuralPartialEq for EunomiaObjectMeta

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,