Struct kernel::serial_trace::SerialTraceSettings
source · #[non_exhaustive]pub struct SerialTraceSettings {
pub enabled: bool,
pub port: u16,
pub sendbuf_capacity: usize,
pub tracebuf_capacity: usize,
pub initial_level: LevelFilter,
}
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.enabled: bool
Should the serial trace be enabled?
port: u16
SerialMux port for sermux tracing.
sendbuf_capacity: usize
Capacity for the serial port’s send buffer.
tracebuf_capacity: usize
Capacity for the trace ring buffer.
Note that two buffers of this size will be allocated. One buffer is used for the normal trace ring buffer, and another is used for the interrupt service routine trace ring buffer.
initial_level: LevelFilter
Initial level filter used if the debug host does not select a max level.
Implementations§
source§impl SerialTraceSettings
impl SerialTraceSettings
pub const DEFAULT_PORT: u16 = 3u16
pub const DEFAULT_SENDBUF_CAPACITY: usize = 1_024usize
pub const DEFAULT_TRACEBUF_CAPACITY: usize = 4_096usize
pub const DEFAULT_INITIAL_LEVEL: LevelFilter = LevelFilter::INFO
const fn default_port() -> u16
const fn default_sendbuf_capacity() -> usize
const fn default_tracebuf_capacity() -> usize
const fn default_initial_level() -> LevelFilter
pub const fn new() -> Self
sourcepub fn with_port(self, port: impl Into<u16>) -> Self
pub fn with_port(self, port: impl Into<u16>) -> Self
Sets the serial_mux
port on which the binary tracing service is
served.
By default, this is Self::DEFAULT_PORT
(the value of
serial_mux::WellKnown::BinaryTracing
).
sourcepub fn with_initial_level(self, level: impl Into<LevelFilter>) -> Self
pub fn with_initial_level(self, level: impl Into<LevelFilter>) -> Self
Sets the initial LevelFilter
used when no trace client is connected
or when the trace client does not select a level.
By default, this set to Self::DEFAULT_INITIAL_LEVEL
(LevelFilter::OFF
).
sourcepub const fn with_sendbuf_capacity(self, capacity: usize) -> Self
pub const fn with_sendbuf_capacity(self, capacity: usize) -> Self
Sets the maximum capacity of the serial port send buffer (the buffer used for communication between the trace service task and the serial mux server).
By default, this set to Self::DEFAULT_SENDBUF_CAPACITY
(1 KB).
sourcepub const fn with_tracebuf_capacity(self, capacity: usize) -> Self
pub const fn with_tracebuf_capacity(self, capacity: usize) -> Self
Sets the maximum capacity of the trace ring buffer (the buffer into which new traces are serialized before being sent to the worker task).
Note that two buffers of this size will be allocated. One buffer is used for traces emitted by non-interrupt kernel code, and the other is used for traces emitted inside of interrupt service routines (ISRs).
By default, this set to Self::DEFAULT_TRACEBUF_CAPACITY
(64 KB).
Trait Implementations§
source§impl Clone for SerialTraceSettings
impl Clone for SerialTraceSettings
source§fn clone(&self) -> SerialTraceSettings
fn clone(&self) -> SerialTraceSettings
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SerialTraceSettings
impl Debug for SerialTraceSettings
source§impl Default for SerialTraceSettings
impl Default for SerialTraceSettings
source§impl<'de> Deserialize<'de> for SerialTraceSettings
impl<'de> Deserialize<'de> for SerialTraceSettings
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for SerialTraceSettings
impl RefUnwindSafe for SerialTraceSettings
impl Send for SerialTraceSettings
impl Sync for SerialTraceSettings
impl Unpin for SerialTraceSettings
impl UnwindSafe for SerialTraceSettings
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)