use thiserror::Error;
use crate::event::Event;
#[derive(Debug, Error)]
pub enum PerfEventError {
#[error("{0}")]
IoError(
#[from]
#[source]
std::io::Error,
),
#[error("Error reading counter {0}")]
ErrorReadingCounter(Event),
#[error("Not enough measures to compute perf counters differences")]
NotEnoughSamples,
#[error("Failed to parse online CPU list: {0}")]
ParseCpuList(
#[from]
#[source]
std::num::ParseIntError,
),
#[error("Failed to join a blocking perf_event task: {0}")]
JoinError(
#[from]
#[source]
tokio::task::JoinError,
),
#[error("CPU specification invalid, the provided CPU core {0} is not an online CPU.")]
InvalidCpuCore(u32),
}