pub struct SampleFlags(/* private fields */);Expand description
Specifies which fields to include in the sample.
These values correspond to PERF_SAMPLE_x values. See the
manpage for documentation on what they mean.
Implementations§
Source§impl SampleFlags
impl SampleFlags
pub const IP: SampleFlags
pub const TID: SampleFlags
pub const TIME: SampleFlags
pub const ADDR: SampleFlags
pub const READ: SampleFlags
pub const CALLCHAIN: SampleFlags
pub const ID: SampleFlags
pub const CPU: SampleFlags
pub const PERIOD: SampleFlags
pub const STREAM_ID: SampleFlags
pub const RAW: SampleFlags
pub const BRANCH_STACK: SampleFlags
pub const REGS_USER: SampleFlags
pub const STACK_USER: SampleFlags
pub const WEIGHT: SampleFlags
pub const DATA_SRC: SampleFlags
pub const IDENTIFIER: SampleFlags
pub const TRANSACTION: SampleFlags
pub const REGS_INTR: SampleFlags
pub const PHYS_ADDR: SampleFlags
pub const AUX: SampleFlags
pub const CGROUP: SampleFlags
pub const DATA_PAGE_SIZE: SampleFlags
pub const CODE_PAGE_SIZE: SampleFlags
pub const WEIGHT_STRUCT: SampleFlags
Source§impl SampleFlags
impl SampleFlags
Sourcepub const fn empty() -> SampleFlags
pub const fn empty() -> SampleFlags
Get a flags value with all bits unset.
Sourcepub const fn all() -> SampleFlags
pub const fn all() -> SampleFlags
Get a flags value with all known bits set.
Sourcepub const fn bits(&self) -> u64
pub const fn bits(&self) -> u64
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
Sourcepub const fn from_bits(bits: u64) -> Option<SampleFlags>
pub const fn from_bits(bits: u64) -> Option<SampleFlags>
Convert from a bits value.
This method will return None if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u64) -> SampleFlags
pub const fn from_bits_truncate(bits: u64) -> SampleFlags
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u64) -> SampleFlags
pub const fn from_bits_retain(bits: u64) -> SampleFlags
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<SampleFlags>
pub fn from_name(name: &str) -> Option<SampleFlags>
Get a flags value with the bits of a flag with the given name set.
This method will return None if name is empty or doesn’t
correspond to any named flag.
Sourcepub const fn intersects(&self, other: SampleFlags) -> bool
pub const fn intersects(&self, other: SampleFlags) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
Sourcepub const fn contains(&self, other: SampleFlags) -> bool
pub const fn contains(&self, other: SampleFlags) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
Sourcepub fn insert(&mut self, other: SampleFlags)
pub fn insert(&mut self, other: SampleFlags)
The bitwise or (|) of the bits in two flags values.
Sourcepub fn remove(&mut self, other: SampleFlags)
pub fn remove(&mut self, other: SampleFlags)
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
remove won’t truncate other, but the ! operator will.
Sourcepub fn toggle(&mut self, other: SampleFlags)
pub fn toggle(&mut self, other: SampleFlags)
The bitwise exclusive-or (^) of the bits in two flags values.
Sourcepub fn set(&mut self, other: SampleFlags, value: bool)
pub fn set(&mut self, other: SampleFlags, value: bool)
Call insert when value is true or remove when value is false.
Sourcepub const fn intersection(self, other: SampleFlags) -> SampleFlags
pub const fn intersection(self, other: SampleFlags) -> SampleFlags
The bitwise and (&) of the bits in two flags values.
Sourcepub const fn union(self, other: SampleFlags) -> SampleFlags
pub const fn union(self, other: SampleFlags) -> SampleFlags
The bitwise or (|) of the bits in two flags values.
Sourcepub const fn difference(self, other: SampleFlags) -> SampleFlags
pub const fn difference(self, other: SampleFlags) -> SampleFlags
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
Sourcepub const fn symmetric_difference(self, other: SampleFlags) -> SampleFlags
pub const fn symmetric_difference(self, other: SampleFlags) -> SampleFlags
The bitwise exclusive-or (^) of the bits in two flags values.
Sourcepub const fn complement(self) -> SampleFlags
pub const fn complement(self) -> SampleFlags
The bitwise negation (!) of the bits in a flags value, truncating the result.
Source§impl SampleFlags
impl SampleFlags
Sourcepub const fn iter(&self) -> Iter<SampleFlags> ⓘ
pub const fn iter(&self) -> Iter<SampleFlags> ⓘ
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
Sourcepub const fn iter_names(&self) -> IterNames<SampleFlags> ⓘ
pub const fn iter_names(&self) -> IterNames<SampleFlags> ⓘ
Yield a set of contained named flags values.
This method is like iter, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Trait Implementations§
Source§impl Binary for SampleFlags
impl Binary for SampleFlags
Source§impl BitAnd for SampleFlags
impl BitAnd for SampleFlags
Source§fn bitand(self, other: SampleFlags) -> SampleFlags
fn bitand(self, other: SampleFlags) -> SampleFlags
The bitwise and (&) of the bits in two flags values.
Source§type Output = SampleFlags
type Output = SampleFlags
& operator.Source§impl BitAndAssign for SampleFlags
impl BitAndAssign for SampleFlags
Source§fn bitand_assign(&mut self, other: SampleFlags)
fn bitand_assign(&mut self, other: SampleFlags)
The bitwise and (&) of the bits in two flags values.
Source§impl BitOr for SampleFlags
impl BitOr for SampleFlags
Source§fn bitor(self, other: SampleFlags) -> SampleFlags
fn bitor(self, other: SampleFlags) -> SampleFlags
The bitwise or (|) of the bits in two flags values.
Source§type Output = SampleFlags
type Output = SampleFlags
| operator.Source§impl BitOrAssign for SampleFlags
impl BitOrAssign for SampleFlags
Source§fn bitor_assign(&mut self, other: SampleFlags)
fn bitor_assign(&mut self, other: SampleFlags)
The bitwise or (|) of the bits in two flags values.
Source§impl BitXor for SampleFlags
impl BitXor for SampleFlags
Source§fn bitxor(self, other: SampleFlags) -> SampleFlags
fn bitxor(self, other: SampleFlags) -> SampleFlags
The bitwise exclusive-or (^) of the bits in two flags values.
Source§type Output = SampleFlags
type Output = SampleFlags
^ operator.Source§impl BitXorAssign for SampleFlags
impl BitXorAssign for SampleFlags
Source§fn bitxor_assign(&mut self, other: SampleFlags)
fn bitxor_assign(&mut self, other: SampleFlags)
The bitwise exclusive-or (^) of the bits in two flags values.
Source§impl Clone for SampleFlags
impl Clone for SampleFlags
Source§fn clone(&self) -> SampleFlags
fn clone(&self) -> SampleFlags
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SampleFlags
Source§impl Debug for SampleFlags
impl Debug for SampleFlags
Source§impl Default for SampleFlags
impl Default for SampleFlags
Source§fn default() -> SampleFlags
fn default() -> SampleFlags
impl Eq for SampleFlags
Source§impl Extend<SampleFlags> for SampleFlags
impl Extend<SampleFlags> for SampleFlags
Source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = SampleFlags>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = SampleFlags>,
The bitwise or (|) of the bits in each flags value.
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl Flags for SampleFlags
impl Flags for SampleFlags
Source§const FLAGS: &'static [Flag<SampleFlags>]
const FLAGS: &'static [Flag<SampleFlags>]
Source§fn from_bits_retain(bits: u64) -> SampleFlags
fn from_bits_retain(bits: u64) -> SampleFlags
Source§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
Source§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
Source§fn iter_names(&self) -> IterNames<Self> ⓘ
fn iter_names(&self) -> IterNames<Self> ⓘ
Source§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|) of the bits in two flags values.Source§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!). Read moreSource§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^) of the bits in two flags values.Source§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&) of the bits in two flags values.Source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!). Read moreSource§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^) of the bits in two flags values.Source§fn complement(self) -> Self
fn complement(self) -> Self
!) of the bits in a flags value, truncating the result.Source§impl FromIterator<SampleFlags> for SampleFlags
impl FromIterator<SampleFlags> for SampleFlags
Source§fn from_iter<T>(iterator: T) -> SampleFlagswhere
T: IntoIterator<Item = SampleFlags>,
fn from_iter<T>(iterator: T) -> SampleFlagswhere
T: IntoIterator<Item = SampleFlags>,
The bitwise or (|) of the bits in each flags value.
Source§impl Hash for SampleFlags
impl Hash for SampleFlags
Source§impl IntoIterator for SampleFlags
impl IntoIterator for SampleFlags
Source§type Item = SampleFlags
type Item = SampleFlags
Source§type IntoIter = Iter<SampleFlags>
type IntoIter = Iter<SampleFlags>
Source§fn into_iter(self) -> <SampleFlags as IntoIterator>::IntoIter
fn into_iter(self) -> <SampleFlags as IntoIterator>::IntoIter
Source§impl LowerHex for SampleFlags
impl LowerHex for SampleFlags
Source§impl Not for SampleFlags
impl Not for SampleFlags
Source§fn not(self) -> SampleFlags
fn not(self) -> SampleFlags
The bitwise negation (!) of the bits in a flags value, truncating the result.
Source§type Output = SampleFlags
type Output = SampleFlags
! operator.Source§impl Octal for SampleFlags
impl Octal for SampleFlags
Source§impl PartialEq for SampleFlags
impl PartialEq for SampleFlags
impl StructuralPartialEq for SampleFlags
Source§impl Sub for SampleFlags
impl Sub for SampleFlags
Source§fn sub(self, other: SampleFlags) -> SampleFlags
fn sub(self, other: SampleFlags) -> SampleFlags
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
Source§type Output = SampleFlags
type Output = SampleFlags
- operator.Source§impl SubAssign for SampleFlags
impl SubAssign for SampleFlags
Source§fn sub_assign(&mut self, other: SampleFlags)
fn sub_assign(&mut self, other: SampleFlags)
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.