@@ -234,26 +234,48 @@ except that `$PROFILER` is one of the following.
234
234
text output is also written to files with a ` clgann ` prefix; this output is
235
235
much the same as the ` cgann ` -prefixed files produced by Cachegrind, but
236
236
with extra annotations showing function call counts.
237
- - ` dhat ` : Profile with [ DHAT] ( http://valgrind.org/docs/manual/dh-manual.html ) ,
238
- a heap profiler.
239
- - ** Purpose** . DHAT is good for finding which parts of the code are causing a
240
- lot of allocations. This is relevant if another profiler such as
237
+ - ` exp-dhat ` : Profile with [ ExpDHAT] ( http://valgrind.org/docs/manual/dh-manual.html ) ,
238
+ an experimental heap profiler that came with Valgrind (` --tool=exp-dhat ` )
239
+ prior to version 3.15.
240
+ - ** Purpose** . ExpDHAT is good for finding which parts of the code are
241
+ causing a lot of allocations. This is relevant if another profiler such as
241
242
` perf-record ` or Cachegrind tell you that ` malloc ` and ` free ` are hot
242
243
functions (as they often are).
243
244
- ** Slowdown** . Roughly 5--20x.
244
- - ** Prerequisites** . DHAT may require a rustc configured with `use-jemalloc =
245
- false` to work well.
246
- - ** Configuration** . DHAT is configured within ` profile ` to run with the
247
- non-default ` --tot-blocks-allocd ` option, so that it sorts its
248
- output by the number of blocks allocated rather than the number of bytes
249
- allocated. This is because the number of allocations typically has a
250
- greater effect on speed than the size of those allocations; many small
251
- allocations will typically be slower than a few large allocations.
245
+ - ** Prerequisites** . ExpDHAT may require a rustc configured with
246
+ ` use-jemalloc = false` to work well.
247
+ - ** Configuration** . ExpDHAT is configured within ` profile ` to run with the
248
+ non-default ` --tot-blocks-allocd ` option, so that it sorts its output by
249
+ the number of blocks allocated rather than the number of bytes allocated.
250
+ This is because the number of allocations typically has a greater effect on
251
+ speed than the size of those allocations; many small allocations will
252
+ typically be slower than a few large allocations.
252
253
- ** Output** . Human-readable text output is written to files with a ` dhat `
253
254
prefix. This file includes summary statistics followed by numerous records,
254
255
each of which aggregates data about all the allocations associated with a
255
256
particular stack trace: the number of allocations, their average size, and
256
257
how often they are read from and written to.
258
+ - ` dhat ` : Profile with [ DHAT] ( http://valgrind.org/docs/manual/dh-manual.html ) ,
259
+ a heap profiler that comes with Valgrind (` --tool=dhat ` ) in versions 3.15
260
+ and later. It has the same purpose as ExpDHAT, but is significantly more
261
+ powerful.
262
+ - ** Purpose** . DHAT is good for finding which parts of the code are causing a
263
+ lot of allocations. This is relevant if another profiler such as
264
+ ` perf-record ` or Cachegrind tell you that ` malloc ` and ` free ` are hot
265
+ functions (as they often are). It also gives insight into peak memory
266
+ usage, similar to Massif.
267
+ - ** Slowdown** . Roughly 5--20x.
268
+ - ** Prerequisites** . DHAT may require a rustc configured with `use-jemalloc =
269
+ false` to work well.
270
+ - ** Configuration** . DHAT is configured within ` profile ` to run with the
271
+ non-default ` --num-callers=4 ` option, which dictates stack depths. (This
272
+ value of 4 does not include inlined stack frames, so in practice the depths
273
+ of stack traces are a lot more than 4.) This is almost always enough, but
274
+ on the rare occasion it isn't, you can the value in ` rustc-fake.rs ` and
275
+ rebuild ` collector ` . Note that higher values make DHAT run more slowly and
276
+ increase the size of its data files.
277
+ - ** Output** . Raw output is written to files with a ` dhout ` prefix. Those
278
+ files can be viewed with DHAT's viewer (` dh_view.html ` ).
257
279
- ` massif ` : Profile with
258
280
[ Massif] ( http://valgrind.org/docs/manual/ms-manual.html ) , a heap profiler.
259
281
- ** Purpose** . Massif is designed to give insight into a program's peak
0 commit comments