1 // Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0. 2 3 #[derive(Debug, thiserror::Error)] 4 pub enum Error { 5 #[error("{0}")] 6 NixError(#[from] nix::Error), 7 #[error("{0}")] 8 IoError(#[from] std::io::Error), 9 #[error("create profiler error")] 10 CreatingError, 11 #[error("start running cpu profiler error")] 12 Running, 13 #[error("stop running cpu profiler error")] 14 NotRunning, 15 } 16 17 pub type Result<T> = std::result::Result<T, Error>; 18