aya: change variant names

pull/376/head
conectado 2 years ago
parent 7b143199fb
commit c30ae6e001
No known key found for this signature in database
GPG Key ID: 338C2256E2EB62D4

@ -197,15 +197,15 @@ pub struct BpfLoader<'a> {
} }
bitflags! { bitflags! {
/// Used to set the verifier log level in [BpfLoader](BpfLoader::verifier_log_level()). /// Used to set the verifier log level flags in [BpfLoader](BpfLoader::verifier_log_level()).
pub struct VerifierLogLevel: u32 { pub struct VerifierLogLevel: u32 {
/// Used to disable all logging. /// Sets no verifier logging.
const DISABLE = 0; const DISABLE = 0;
/// Logs tracing with details level 1 /// Enables debug verifier logging.
const LEVEL1 = 1; const DEBUG = 1;
/// Log tracing with details level 2 /// Enables verbose verifier logging.
const LEVEL2 = 2 | Self::LEVEL1.bits; const VERBOSE = 2 | Self::DEBUG.bits;
/// Logs eBPF verifier stats /// Enables verifier stats
const STATS = 4; const STATS = 4;
} }
} }
@ -213,7 +213,7 @@ bitflags! {
impl Default for VerifierLogLevel { impl Default for VerifierLogLevel {
fn default() -> Self { fn default() -> Self {
Self { Self {
bits: Self::LEVEL1.bits | Self::STATS.bits, bits: Self::DEBUG.bits | Self::STATS.bits,
} }
} }
} }
@ -345,7 +345,7 @@ impl<'a> BpfLoader<'a> {
/// use aya::{BpfLoader, VerifierLogLevel}; /// use aya::{BpfLoader, VerifierLogLevel};
/// ///
/// let bpf = BpfLoader::new() /// let bpf = BpfLoader::new()
/// .verifier_log_level(VerifierLogLevel::LEVEL2 | VerifierLogLevel::STATS) /// .verifier_log_level(VerifierLogLevel::VERBOSE | VerifierLogLevel::STATS)
/// .load_file("file.o")?; /// .load_file("file.o")?;
/// # Ok::<(), aya::BpfError>(()) /// # Ok::<(), aya::BpfError>(())
/// ``` /// ```

Loading…
Cancel
Save