mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 18:13:01 +00:00
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.
142 lines
3.8 KiB
Makefile
142 lines
3.8 KiB
Makefile
|
|
AUTOMAKE_OPTIONS = foreign 1.10 dist-bzip2
|
|
|
|
include $(top_srcdir)/Makefile.all.am
|
|
|
|
TOOLS = memcheck \
|
|
cachegrind \
|
|
callgrind \
|
|
helgrind \
|
|
drd \
|
|
massif \
|
|
dhat \
|
|
lackey \
|
|
none
|
|
|
|
EXP_TOOLS = exp-sgcheck \
|
|
exp-bbv
|
|
|
|
# Put docs last because building the HTML is slow and we want to get
|
|
# everything else working before we try it.
|
|
SUBDIRS = \
|
|
include \
|
|
VEX \
|
|
coregrind \
|
|
. \
|
|
$(TOOLS) \
|
|
$(EXP_TOOLS) \
|
|
shared \
|
|
tests \
|
|
perf \
|
|
gdbserver_tests \
|
|
memcheck/tests/vbit-test \
|
|
auxprogs \
|
|
mpi \
|
|
solaris \
|
|
docs
|
|
DIST_SUBDIRS = $(SUBDIRS)
|
|
|
|
SUPP_FILES = \
|
|
glibc-2.2.supp glibc-2.3.supp glibc-2.4.supp glibc-2.5.supp \
|
|
glibc-2.6.supp glibc-2.7.supp glibc-2.X.supp.in \
|
|
xfree-3.supp xfree-4.supp \
|
|
glibc-2.34567-NPTL-helgrind.supp \
|
|
glibc-2.2-LinuxThreads-helgrind.supp \
|
|
glibc-2.X-drd.supp \
|
|
exp-sgcheck.supp \
|
|
darwin9.supp darwin9-drd.supp \
|
|
darwin10.supp darwin10-drd.supp \
|
|
darwin11.supp darwin12.supp darwin13.supp darwin14.supp darwin15.supp \
|
|
darwin16.supp darwin17.supp \
|
|
bionic.supp \
|
|
solaris11.supp solaris12.supp
|
|
DEFAULT_SUPP_FILES = @DEFAULT_SUPP@
|
|
|
|
# We include all the base .supp files in the distribution, but not
|
|
# default.supp, as it is built from the base .supp files at compile-time.
|
|
dist_noinst_DATA = $(SUPP_FILES)
|
|
|
|
vglibdir = $(pkglibdir)
|
|
vglib_DATA = default.supp
|
|
|
|
pkgconfigdir = $(libdir)/pkgconfig
|
|
pkgconfig_DATA = valgrind.pc
|
|
|
|
BUILT_SOURCES = default.supp include/vgversion.h valgrind.pc
|
|
CLEANFILES = default.supp
|
|
|
|
default.supp: $(DEFAULT_SUPP_FILES)
|
|
echo "# This is a generated file, composed of the following suppression rules:" > default.supp
|
|
echo "# " $(DEFAULT_SUPP_FILES) >> default.supp
|
|
cat $^ >> default.supp
|
|
|
|
## Preprend @PERL@ because tests/vg_regtest isn't executable
|
|
## Ensure make exits with error if PERL fails or post_regtest_checks fails.
|
|
regtest: check
|
|
$(top_srcdir)/gdbserver_tests/make_local_links $(GDB)
|
|
if @PERL@ tests/vg_regtest gdbserver_tests $(TOOLS) $(EXP_TOOLS) ; then \
|
|
tests/post_regtest_checks $(abs_top_srcdir) gdbserver_tests $(TOOLS) $(EXP_TOOLS); \
|
|
else \
|
|
tests/post_regtest_checks $(abs_top_srcdir) gdbserver_tests $(TOOLS) $(EXP_TOOLS); \
|
|
false; \
|
|
fi
|
|
post-regtest-checks:
|
|
tests/post_regtest_checks $(abs_top_srcdir) gdbserver_tests $(TOOLS) $(EXP_TOOLS)
|
|
nonexp-regtest: check
|
|
@PERL@ tests/vg_regtest $(TOOLS)
|
|
exp-regtest: check
|
|
@PERL@ tests/vg_regtest gdbserver_tests $(EXP_TOOLS)
|
|
# Nb: gdbserver_tests are put in exp-regtest rather than nonexp-regtest
|
|
# because they are tested with various valgrind tools, so might be using
|
|
# an experimental tool.
|
|
|
|
## Preprend @PERL@ because tests/vg_perf isn't executable
|
|
perf: check
|
|
@PERL@ perf/vg_perf perf
|
|
|
|
# Nb: no need to include any Makefile.am files here, or files included from
|
|
# them, as automake includes them automatically. Also not COPYING, README
|
|
# or NEWS.
|
|
# We include valgrind.spec as well as valgrind.spec.in to save packagers
|
|
# from having to run configure (bug 188560).
|
|
EXTRA_DIST = \
|
|
COPYING.DOCS \
|
|
README_DEVELOPERS \
|
|
README_PACKAGERS \
|
|
README_MISSING_SYSCALL_OR_IOCTL \
|
|
README.s390 \
|
|
README.android \
|
|
README.android_emulator \
|
|
README.mips \
|
|
README.aarch64 \
|
|
README.solaris \
|
|
NEWS.old \
|
|
valgrind.pc.in \
|
|
valgrind.spec.in \
|
|
valgrind.spec \
|
|
autogen.sh
|
|
|
|
dist-hook: include/vgversion.h
|
|
cp -p include/vgversion.h $(distdir)/include/vgversion_dist.h
|
|
|
|
dist_noinst_SCRIPTS = \
|
|
vg-in-place
|
|
|
|
all-local: default.supp include/vgversion.h
|
|
mkdir -p $(inplacedir)
|
|
rm -f $(inplacedir)/default.supp
|
|
ln -s ../default.supp $(inplacedir)
|
|
|
|
clean-local:
|
|
rm -rf $(inplacedir) include/vgversion.h
|
|
|
|
# Need config.h in the installed tree, since some files depend on it
|
|
pkginclude_HEADERS = config.h
|
|
|
|
# vgversion.h defines accurate versions to report with -v --version
|
|
include/vgversion.h:
|
|
$(top_srcdir)/auxprogs/make_or_upd_vgversion_h $(top_srcdir)
|
|
|
|
.PHONY: include/vgversion.h
|
|
|