pub struct GenericKernelTaskStateEvent {
pub cpu: Option<i32>,
pub comm: Option<String>,
pub tid: Option<i64>,
pub state: Option<i32>,
pub prio: Option<i32>,
}
Expand description
GenericKernelTaskStateEvent is the standard proto to capture thread state change events in a generic kernel implementation. This is mainly for the case where scheduler events are not directly supported in the kernel’s tracing mechanism.
By capturing these task state events Perfetto is able to infer higher-level events such as context switches and task waking events, providing as much parity as possible with established tracing frameworks such as Linux’s ftrace.
Fields§
§cpu: Option<i32>
CPU in which the event occurred. This field is only relevant with the TASK_STATE_RUNNING state. There is no specific meaning to the cpu field in a non-running state event.
comm: Option<String>
Command name for the thread.
tid: Option<i64>
Thread id.
state: Option<i32>
New state of the thread.
prio: Option<i32>
Priority of the thread. This value is OS agnostic and should only be interpreted based on the kernel who emitted the message.
Implementations§
Source§impl GenericKernelTaskStateEvent
impl GenericKernelTaskStateEvent
Sourcepub fn state(&self) -> TaskStateEnum
pub fn state(&self) -> TaskStateEnum
Returns the enum value of state
, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_state(&mut self, value: TaskStateEnum)
pub fn set_state(&mut self, value: TaskStateEnum)
Sets state
to the provided enum value.
Trait Implementations§
Source§impl Clone for GenericKernelTaskStateEvent
impl Clone for GenericKernelTaskStateEvent
Source§fn clone(&self) -> GenericKernelTaskStateEvent
fn clone(&self) -> GenericKernelTaskStateEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for GenericKernelTaskStateEvent
impl Debug for GenericKernelTaskStateEvent
Source§impl Message for GenericKernelTaskStateEvent
impl Message for GenericKernelTaskStateEvent
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>where
B: BufMut,
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>where
B: Buf,
Self: Default,
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>where
B: Buf,
Self: Sized,
self
.