|
|
@ -1099,6 +1099,22 @@ impl ProgramInfo {
|
|
|
|
Ok(ProgramFd(fd))
|
|
|
|
Ok(ProgramFd(fd))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// The duration the program has been running, in nanoseconds.
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// Note this field is only updated for as long as [`BPF_ENABLE_STATS`](crate::Ebpf::enable_stats_fd)
|
|
|
|
|
|
|
|
/// is enabled with [`BPF_STATS_RUN_TIME`](aya_obj::BpfStatsType::RunTime) type set.
|
|
|
|
|
|
|
|
pub fn run_time_ns(&self) -> u64 {
|
|
|
|
|
|
|
|
self.0.run_time_ns
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// The number of times the program has ran.
|
|
|
|
|
|
|
|
///
|
|
|
|
|
|
|
|
/// Note this field is only updated for as long as [`BPF_ENABLE_STATS`](crate::Ebpf::enable_stats_fd)
|
|
|
|
|
|
|
|
/// is enabled with [`BPF_STATS_RUN_TIME`](aya_obj::BpfStatsType::RunTime) type set.
|
|
|
|
|
|
|
|
pub fn run_cnt(&self) -> u64 {
|
|
|
|
|
|
|
|
self.0.run_cnt
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Loads a program from a pinned path in bpffs.
|
|
|
|
/// Loads a program from a pinned path in bpffs.
|
|
|
|
pub fn from_pin<P: AsRef<Path>>(path: P) -> Result<Self, ProgramError> {
|
|
|
|
pub fn from_pin<P: AsRef<Path>>(path: P) -> Result<Self, ProgramError> {
|
|
|
|
use std::os::unix::ffi::OsStrExt as _;
|
|
|
|
use std::os::unix::ffi::OsStrExt as _;
|
|
|
|