]> git.ipfire.org Git - thirdparty/valgrind.git/commit
Overhaul DHAT.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 4 Oct 2018 01:00:22 +0000 (11:00 +1000)
committerNicholas Nethercote <nnethercote@mozilla.com>
Fri, 1 Feb 2019 03:54:34 +0000 (14:54 +1100)
commit441bfc5f51c7f5f80cc6491d23cbe2dc711d191f
treef3d39272104b48aacc52e9a92ac594e519c1c65e
parentb19f6882cf17a0d0bf8cbc342ac16db0c7430721
Overhaul DHAT.

This commit thoroughly overhauls DHAT, moving it out of the
"experimental" ghetto. It makes moderate changes to DHAT itself,
including dumping profiling data to a JSON format output file. It also
implements a new data viewer (as a web app, in dhat/dh_view.html).

The main benefits over the old DHAT are as follows.

- The separation of data collection and presentation means you can run a
  program once under DHAT and then sort the data in various ways. Also,
  full data is in the output file, and the viewer chooses what to omit.

- The data can be sorted in more ways than previously. Some of these
  sorts involve useful filters such as "short-lived" and "zero reads or
  zero writes".

- The tree structure view avoids the need to choose stack trace depth.
  This avoids both the problem of not enough depth (when records that
  should be distinct are combined, and may not contain enough
  information to be actionable) and the problem of too much depth (when
  records that should be combined are separated, making them seem less
  important than they really are).

- Byte and block measures are shown with a percentage relative to the
  global count, which helps gauge relative significance of different
  parts of the profile.

- Byte and blocks measures are also shown with an allocation rate
  (bytes and blocks per million instructions), which enables comparisons
  across multiple profiles, even if those profiles represent different
  workloads.

- Both global and per-node measurements are taken at the global heap
  peak ("At t-gmax"), which gives Massif-like insight into the point of
  peak memory use.

- The final/liftimes stats are a bit more useful than the old deaths
  stats. (E.g. the old deaths stats didn't take into account lifetimes
  of unfreed blocks.)

- The handling of realloc() has changed. The sequence `p = malloc(100);
  realloc(p, 200);` now increases the total block count by 2 and the
  total byte count by 300. Previously it increased them by 1 and 200.
  The new handling is a more operational view that better reflects the
  effect of allocations on performance. It makes a significant
  difference in the results, giving paths involving reallocation (e.g.
  repeated pushing to a growing vector) more prominence.

Other things of note:

- There is now testing, both regression tests that run within the
  standard test suite, and viewer-specific tests that cannot run within
  the standard test suite. The latter are run by loading
  dh_view.html?test=1 in a web browser.

- The commit puts all tool lists in Makefiles (and similar files) in the
  following consistent order: memcheck, cachegrind, callgrind, helgrind,
  drd, massif, dhat, lackey, none; exp-sgcheck, exp-bbv.

- A lot of fields in dh_main.c have been given more descriptive names.
  Those names now match those used in dh_view.js.
45 files changed:
.gitignore
Makefile.am
NEWS
configure.ac
coregrind/m_libcsetjmp.c
coregrind/m_main.c
coregrind/pub_core_libcsetjmp.h
dhat/Makefile.am [moved from exp-dhat/Makefile.am with 50% similarity]
dhat/dh_main.c [moved from exp-dhat/dh_main.c with 66% similarity]
dhat/dh_test.js [new file with mode: 0644]
dhat/dh_view.css [new file with mode: 0644]
dhat/dh_view.html [new file with mode: 0644]
dhat/dh_view.js [new file with mode: 0644]
dhat/docs/dh-manual.xml [new file with mode: 0644]
dhat/tests/Makefile.am [new file with mode: 0644]
dhat/tests/acc.c [new file with mode: 0644]
dhat/tests/acc.stderr.exp [new file with mode: 0644]
dhat/tests/acc.vgtest [new file with mode: 0644]
dhat/tests/basic.c [new file with mode: 0644]
dhat/tests/basic.stderr.exp [new file with mode: 0644]
dhat/tests/basic.vgtest [new file with mode: 0644]
dhat/tests/big.c [new file with mode: 0644]
dhat/tests/big.stderr.exp [new file with mode: 0644]
dhat/tests/big.vgtest [new file with mode: 0644]
dhat/tests/empty.c [new file with mode: 0644]
dhat/tests/empty.stderr.exp [new file with mode: 0644]
dhat/tests/empty.vgtest [new file with mode: 0644]
dhat/tests/filter_stderr [new file with mode: 0755]
dhat/tests/sig.c [new file with mode: 0644]
dhat/tests/sig.stderr.exp [new file with mode: 0644]
dhat/tests/sig.vgtest [new file with mode: 0644]
dhat/tests/single.c [new file with mode: 0644]
dhat/tests/single.stderr.exp [new file with mode: 0644]
dhat/tests/single.vgtest [new file with mode: 0644]
docs/Makefile.am
docs/README
docs/images/dh-tree.png [new file with mode: 0644]
docs/xml/manual-core.xml
docs/xml/manual.xml
exp-dhat/docs/dh-manual.xml [deleted file]
exp-dhat/tests/Makefile.am [deleted file]
include/pub_tool_libcsetjmp.h
massif/ms_main.c
solaris/valgrind.p5m
tests/check_headers_and_includes