use std::path::Path;
use bcc_sys::bccapi::pid_t;
use crate::error::BccError;
use crate::BPF;
pub fn usdt_generate_args(
mut _contexts: Vec<USDTContext>,
) -> Result<(String, Vec<USDTContext>), BccError> {
Err(BccError::BccVersionTooLow {
cause: "USDT support is not enabled".to_owned(),
min_version: "0.6.1".to_owned(),
})
}
pub struct USDTContext;
impl USDTContext {
pub fn from_pid(pid: pid_t) -> Result<Self, BccError> {
Self::new(Some(pid), None)
}
pub fn from_binary_path<T: AsRef<Path>>(path: T) -> Result<Self, BccError> {
Self::new(None, path.as_ref().to_str())
}
pub fn from_binary_path_and_pid<P: AsRef<Path>>(path: P, pid: pid_t) -> Result<Self, BccError> {
Self::new(Some(pid), path.as_ref().to_str())
}
fn new(_pid: Option<pid_t>, _path: Option<&str>) -> Result<Self, BccError> {
Err(BccError::BccVersionTooLow {
cause: "USDT support is not enabled".to_owned(),
min_version: "0.6.1".to_owned(),
})
}
pub(crate) fn attach(
self,
_bpf: &mut BPF,
_attach_usdt_ignore_pid: bool,
) -> Result<(), BccError> {
Err(BccError::BccVersionTooLow {
cause: "USDT support is not enabled".to_owned(),
min_version: "0.6.1".to_owned(),
})
}
}