Skip to content

Commit 4425072

Browse files
committed
Remove exp-DHAT support, DHAT is much better.
1 parent e140dfe commit 4425072

File tree

4 files changed

+2
-50
lines changed

4 files changed

+2
-50
lines changed

collector/README.md

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -276,31 +276,8 @@ except that `$PROFILER` is one of the following.
276276
text output is also written to files with a `clgann` prefix; this output is
277277
much the same as the `cgann`-prefixed files produced by Cachegrind, but
278278
with extra annotations showing function call counts.
279-
- `exp-dhat`: Profile with [ExpDHAT](http://valgrind.org/docs/manual/dh-manual.html),
280-
an experimental heap profiler that came with Valgrind (`--tool=exp-dhat`)
281-
prior to version 3.15.
282-
- **Purpose**. ExpDHAT is good for finding which parts of the code are
283-
causing a lot of allocations. This is relevant if another profiler such as
284-
`perf-record` or Cachegrind tell you that `malloc` and `free` are hot
285-
functions (as they often are).
286-
- **Slowdown**. Roughly 5--20x.
287-
- **Prerequisites**. ExpDHAT may require a rustc configured with `jemalloc =
288-
false` to work well.
289-
- **Configuration**. ExpDHAT is configured within `profile` to run with the
290-
non-default `--tot-blocks-allocd` option, so that it sorts its output by
291-
the number of blocks allocated rather than the number of bytes allocated.
292-
This is because the number of allocations typically has a greater effect on
293-
speed than the size of those allocations; many small allocations will
294-
typically be slower than a few large allocations.
295-
- **Output**. Human-readable text output is written to files with a `dhat`
296-
prefix. This file includes summary statistics followed by numerous records,
297-
each of which aggregates data about all the allocations associated with a
298-
particular stack trace: the number of allocations, their average size, and
299-
how often they are read from and written to.
300279
- `dhat`: Profile with [DHAT](http://valgrind.org/docs/manual/dh-manual.html),
301-
a heap profiler that comes with Valgrind (`--tool=dhat`) in versions 3.15
302-
and later. It has the same purpose as ExpDHAT, but is significantly more
303-
powerful.
280+
a heap profiler. Requires Valgrind 3.15 or later.
304281
- **Purpose**. DHAT is good for finding which parts of the code are causing a
305282
lot of allocations. This is relevant if another profiler such as
306283
`perf-record` or Cachegrind tell you that `malloc` and `free` are hot

collector/src/bin/rustc-fake.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -155,20 +155,6 @@ fn main() {
155155
assert!(cmd.status().expect("failed to spawn").success());
156156
}
157157

158-
"exp-dhat" => {
159-
let mut cmd = Command::new("valgrind");
160-
let has_valgrind = cmd.output().is_ok();
161-
assert!(has_valgrind);
162-
cmd.arg("--tool=exp-dhat")
163-
.arg("--show-top-n=500")
164-
.arg("--num-callers=4")
165-
.arg("--sort-by=tot-blocks-allocd")
166-
.arg(&rustc)
167-
.args(&args);
168-
169-
assert!(cmd.status().expect("failed to spawn").success());
170-
}
171-
172158
"dhat" => {
173159
let mut cmd = Command::new("valgrind");
174160
let has_valgrind = cmd.output().is_ok();

collector/src/bin/rustc-perf-collector/execute.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ pub enum Profiler {
7979
OProfile,
8080
Cachegrind,
8181
Callgrind,
82-
ExpDHAT,
8382
DHAT,
8483
Massif,
8584
Eprintln,
@@ -105,7 +104,6 @@ impl Profiler {
105104
"oprofile" => Ok(Profiler::OProfile),
106105
"cachegrind" => Ok(Profiler::Cachegrind),
107106
"callgrind" => Ok(Profiler::Callgrind),
108-
"exp-dhat" => Ok(Profiler::ExpDHAT),
109107
"dhat" => Ok(Profiler::DHAT),
110108
"massif" => Ok(Profiler::Massif),
111109
"eprintln" => Ok(Profiler::Eprintln),
@@ -122,7 +120,6 @@ impl Profiler {
122120
Profiler::OProfile => "oprofile",
123121
Profiler::Cachegrind => "cachegrind",
124122
Profiler::Callgrind => "callgrind",
125-
Profiler::ExpDHAT => "exp-dhat",
126123
Profiler::DHAT => "dhat",
127124
Profiler::Massif => "massif",
128125
Profiler::Eprintln => "eprintln",
@@ -607,14 +604,6 @@ impl<'a> Processor for ProfileProcessor<'a> {
607604
fs::write(clgann_file, &output.stdout)?;
608605
}
609606

610-
// ExpDHAT writes its output to stderr. We copy that output into a
611-
// file in the output dir.
612-
Profiler::ExpDHAT => {
613-
let exp_dhat_file = filepath(self.output_dir, &out_file("exp-dhat"));
614-
615-
fs::write(exp_dhat_file, &output.stderr)?;
616-
}
617-
618607
// DHAT produces (via rustc-fake) a data file called 'dhout'. We
619608
// copy it from the temp dir to the output dir, giving it a new
620609
// name in the process.

collector/src/bin/rustc-perf-collector/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ fn main_result() -> anyhow::Result<i32> {
447447
'BaseIncr', 'CleanIncr', 'PatchedIncrs', 'All'")
448448
(@arg PROFILER: +required +takes_value
449449
"One of: 'time-passes', 'perf-record', 'cachegrind',\n\
450-
'callgrind', 'exp-dhat', 'dhat', 'massif', 'eprintln'")
450+
'callgrind', ''dhat', 'massif', 'eprintln'")
451451
(@arg ID: +required +takes_value "Identifier to associate benchmark results with")
452452
)
453453
(@subcommand remove_benchmark =>

0 commit comments

Comments
 (0)