Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions collector/src/bin/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,10 @@ fn generate_diffs(
};
let id_diff = format!("{id1}-{id2}");
let prefix = profiler.prefix();
let prefix2 = profiler.prefix2();
let left = out_dir.join(filename(prefix, id1));
let right = out_dir.join(filename(prefix, id2));
let output = out_dir.join(filename(&format!("{prefix}-diff"), &id_diff));
let output = out_dir.join(filename(&format!("{prefix2}-diff"), &id_diff));

if let Err(e) = profiler.diff(&left, &right, &output) {
errors.incr();
Expand Down Expand Up @@ -1142,7 +1143,7 @@ fn main_result() -> anyhow::Result<i32> {
&profiler,
);
if let [diff] = &diffs[..] {
let short = out_dir.join(format!("{}-diff-latest", profiler.prefix()));
let short = out_dir.join(format!("{}-diff-latest", profiler.prefix2()));
std::fs::copy(diff, &short).expect("copy to short path");
eprintln!("Original diff at: {}", diff.to_string_lossy());
eprintln!("Short path: {}", short.to_string_lossy());
Expand Down
12 changes: 12 additions & 0 deletions collector/src/compile/execute/profiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ impl Profiler {
}
}

/// A file prefix added to all (second-stage) files of this profiler.
pub fn prefix2(&self) -> &'static str {
use Profiler::*;
match self {
Cachegrind => "cgann",
DepGraph => "dep-graph",

SelfProfile | PerfRecord | Oprofile | Samply | Callgrind | Dhat | DhatCopy | Massif
| Bytehound | Eprintln | LlvmLines | MonoItems | LlvmIr => "",
}
}

/// A postfix added to the file that gets diffed.
pub fn postfix(&self) -> &'static str {
use Profiler::*;
Expand Down
Loading