Closed
Description
Hi, I would like to suggest adding register/deregister/listener functionalities for exiting tasks to the Client interface.
It looks like:
/// Register listener with the specific cpumask
///
/// # Arguments
/// * `cpu_mask` - cpumask is specified as an ascii string of comma-separated cpu ranges e.g.
/// to listen to exit data from cpus 1,2,3,5,7,8 the cpumask would be "1-3,5,7-8".
pub fn register_cpumask(&self, cpu_mask: &str) -> Result<()> {
...
}
/// Deregister listener with the specific cpumask
/// If userspace forgets to deregister interest in cpus before closing the listening socket,
/// the kernel cleans up its interest set over time. However, for the sake of efficiency,
/// an explicit deregistration is advisable.
///
/// # Arguments
/// * `cpu_mask` - cpumask is specified as an ascii string of comma-separated cpu ranges e.g.
/// to listen to exit data from cpus 1,2,3,5,7,8 the cpumask would be "1-3,5,7-8".
pub fn deregister_cpumask(&self, cpu_mask: &str) -> Result<()> {
...
}
/// Listen registered cpumask's
///
/// # Return
/// * `Ok(Vec<TaskStats>)`: vector with stats messages. If the current task is NOT the last
/// one in its thread group, only one message is returned in the vector.
/// However, if it is the last task, an additional element containing the per-thread
/// group ID (tgid) statistics is also included. This additional element sums up
/// the statistics for all threads within the thread group, both past and present
pub fn listen_registered(&self) -> Result<Vec<TaskStats>> {
...
}
/// Set receiver buffer size in bytes (SO_RCVBUF socket option, see socket(7))
///
/// # Arguments
/// * `payload` - buffer size in bytes. The kernel doubles this value
/// (to allow space for bookkeeping overhead). The default value is set by the
/// /proc/sys/net/core/rmem_default file, and the maximum allowed value is set by the
/// /proc/sys/net/core/rmem_max file. The minimum (doubled) value for this option is 256.
pub fn set_rx_buf_sz<T>(&self, payload: T) -> Result<()> {
...
}
/// Get receiver buffer size in bytes (SO_RCVBUF socket option, see socket(7))
///
/// # Return
/// * `usize` buffer size in bytes.
/// Kernel returns doubled value, that have been set using [set_rx_buf_sz]
pub fn get_rx_buf_sz(&self) -> Result<usize> {
...
}
Now I am waiting for approval from netlink-sys crate maintainer regarding the 'get_rx_buf_sz/set_rx_buf_sz' methods
Metadata
Metadata
Assignees
Labels
No labels