pub struct ToolOutputPath {
pub kind: ToolOutputPathKind,
pub tool: ValgrindTool,
pub baseline_kind: BaselineKind,
pub dir: PathBuf,
pub name: String,
pub modifiers: Vec<String>,
}
runner
only.Fields§
§kind: ToolOutputPathKind
§tool: ValgrindTool
§baseline_kind: BaselineKind
§dir: PathBuf
The final directory of all the output files
name: String
§modifiers: Vec<String>
Implementations§
source§impl ToolOutputPath
impl ToolOutputPath
sourcepub fn new(
kind: ToolOutputPathKind,
tool: ValgrindTool,
baseline_kind: &BaselineKind,
base_dir: &Path,
module: &ModulePath,
name: &str,
) -> Self
pub fn new( kind: ToolOutputPathKind, tool: ValgrindTool, baseline_kind: &BaselineKind, base_dir: &Path, module: &ModulePath, name: &str, ) -> Self
Create a new ToolOutputPath
.
The base_dir
is supposed to be the same as crate::runner::meta::Metadata::target_dir
.
sourcepub fn with_init(
kind: ToolOutputPathKind,
tool: ValgrindTool,
baseline_kind: &BaselineKind,
base_dir: &Path,
module: &str,
name: &str,
) -> Result<Self>
pub fn with_init( kind: ToolOutputPathKind, tool: ValgrindTool, baseline_kind: &BaselineKind, base_dir: &Path, module: &str, name: &str, ) -> Result<Self>
Initialize and create the output directory and organize files
This method moves the old output to $TOOL_ID.*.out.old
pub fn init(&self) -> Result<()>
pub fn clear(&self) -> Result<()>
pub fn shift(&self) -> Result<()>
pub fn exists(&self) -> bool
pub fn is_multiple(&self) -> bool
pub fn to_base_path(&self) -> Self
pub fn to_tool_output(&self, tool: ValgrindTool) -> Self
pub fn to_log_output(&self) -> Self
pub fn dump_log(&self, log_level: Level, writer: &mut impl Write) -> Result<()>
sourcepub fn extension(&self) -> String
pub fn extension(&self) -> String
This method can only be used to create the path passed to the tools
The modifiers are extrapolated by the tools and won’t match any real path name.
pub fn with_modifiers<I, T>(&self, modifiers: T) -> Self
pub fn to_path(&self) -> PathBuf
sourcepub fn walk_dir(&self) -> Result<impl Iterator<Item = DirEntry>>
pub fn walk_dir(&self) -> Result<impl Iterator<Item = DirEntry>>
Walk the benchmark directory (non-recursive)
sourcepub fn strip_prefix<'a>(&self, file_name: &'a str) -> Option<&'a str>
pub fn strip_prefix<'a>(&self, file_name: &'a str) -> Option<&'a str>
Strip the <tool>.<name>
prefix from a file_name
sourcepub fn real_paths(&self) -> Result<Vec<PathBuf>>
pub fn real_paths(&self) -> Result<Vec<PathBuf>>
Return the real
paths of a tool’s output files
A tool can have many output files so Self::to_path
is not enough
pub fn real_paths_with_modifier(&self) -> Result<Vec<(PathBuf, Option<String>)>>
sourcepub fn sanitize_callgrind(&self) -> Result<()>
pub fn sanitize_callgrind(&self) -> Result<()>
Sanitize callgrind output file names
This method will remove empty files which are occasionally produced by callgrind and only cause problems in the parser. The files are renamed from the callgrind file naming scheme to ours which is easier to handle.
The information about pids, parts and threads is obtained by parsing the header from the
callgrind output files instead of relying on the sometimes flaky file names produced by
callgrind
. The header is around 10-20 lines, so this method should be still sufficiently
fast. Additionally, callgrind
might change the naming scheme of its files, so using the
headers makes us more independent of a specific valgrind/callgrind version.
pub fn sanitize_bbv(&self) -> Result<()>
sourcepub fn sanitize_generic(&self) -> Result<()>
pub fn sanitize_generic(&self) -> Result<()>
Sanitize file names of all tools if not sanitized by a more specific method
The pids are removed from the file name if there was only a single process (pid). Additionally, we check for empty files and remove them.
Trait Implementations§
source§impl Clone for ToolOutputPath
impl Clone for ToolOutputPath
source§fn clone(&self) -> ToolOutputPath
fn clone(&self) -> ToolOutputPath
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ToolOutputPath
impl Debug for ToolOutputPath
source§impl Display for ToolOutputPath
impl Display for ToolOutputPath
source§impl PartialEq for ToolOutputPath
impl PartialEq for ToolOutputPath
impl Eq for ToolOutputPath
impl StructuralPartialEq for ToolOutputPath
Auto Trait Implementations§
impl Freeze for ToolOutputPath
impl RefUnwindSafe for ToolOutputPath
impl Send for ToolOutputPath
impl Sync for ToolOutputPath
impl Unpin for ToolOutputPath
impl UnwindSafe for ToolOutputPath
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more