mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 10:21:20 +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.
288 lines
8.0 KiB
Plaintext
288 lines
8.0 KiB
Plaintext
|
|
Valgrind Documentation
|
|
----------------------
|
|
This text assumes the following directory structure:
|
|
|
|
Distribution text files (eg. AUTHORS, NEWS, ...):
|
|
valgrind/
|
|
|
|
Main /docs/ dir:
|
|
valgrind/docs/
|
|
|
|
Top-level XML files:
|
|
valgrind/docs/xml/
|
|
|
|
Tool specific XML docs:
|
|
valgrind/<toolname>/docs/
|
|
|
|
All images used in the docs:
|
|
valgrind/docs/images/
|
|
|
|
Stylesheets, catalogs, parsing/formatting scripts:
|
|
valgrind/docs/lib/
|
|
|
|
Some files of note:
|
|
docs/xml/index.xml: Top-level book-set wrapper
|
|
docs/xml/FAQ.xml: The FAQ
|
|
docs/valgrind-manpage.xml The valgrind manpage
|
|
docs/xml/vg-entities.xml: Various strings, dates etc. used all over
|
|
docs/xml/xml_help.txt: Basic guide to common XML tags.
|
|
|
|
The docs/internals directory contains some useful high-level stuff about
|
|
Valgrind's internals. It's not relevant for the rest of this discussion.
|
|
|
|
|
|
Overview
|
|
---------
|
|
The Documentation Set contains all books, articles, manpages,
|
|
etc. pertaining to Valgrind, and is designed to be built as:
|
|
- chunked html files
|
|
- PDF file
|
|
- PS file
|
|
- manpage
|
|
|
|
The whole thing is a "book set", made up of multiple books (the user
|
|
manual, the FAQ, the tech-docs, the licenses). Each book could be
|
|
made individually, but the build system doesn't do that.
|
|
|
|
CSS: the style-sheet used by the docs is the same as that used by the
|
|
website (consistency is king). It might be worth doing a pre-build diff
|
|
to check whether the website stylesheet has changed.
|
|
|
|
|
|
The build process
|
|
-----------------
|
|
It's not obvious exactly when things get built, and so on. Here's an
|
|
overview:
|
|
|
|
- The HTML docs can be built manually by running 'make html-docs' in
|
|
valgrind/docs/. (Don't use 'make html'; that is a valid built-in
|
|
automake target, but does nothing.) Likewise for PDF/PS with 'make
|
|
print-docs'.
|
|
|
|
- 'make dist' (nb: at the top level, not in docs/) puts the XML files
|
|
into the tarball. It also builds the HTML docs and puts them in too,
|
|
in valgrind/docs/html/ (including style sheets, images, etc).
|
|
|
|
- 'make install' installs the HTML docs in
|
|
$(install)/share/doc/valgrind/html/, if they are present. (They will
|
|
be present if you are installing from the result of a 'make dist'.
|
|
They might not be present if you are developing in a git workspace and
|
|
have not built them.) It doesn't install the XML docs, as they're not
|
|
useful installed.
|
|
|
|
If the XML processing tools ever mature enough to become standard, we
|
|
could just build the docs from XML when doing 'make install', which
|
|
would be simpler.
|
|
|
|
|
|
Notes on building HTML / PDF / PS documents
|
|
-------------------------------------------
|
|
Below are random notes and recollections about how to build documents
|
|
from the XML source at various times on various Linux distros. They're
|
|
mostly about the PDF/PS documents, because they are the hardest to
|
|
build.
|
|
|
|
Notes [Jan 2019]
|
|
-----------------
|
|
For Ubuntu 18.04, to build HTML docs I had to:
|
|
|
|
sudo apt-get install xsltproc
|
|
|
|
Notes [May 2017]
|
|
----------------
|
|
Fedora 25: the "Notes [Sept 2015]" are still valid. But to summarise,
|
|
two steps are necessary:
|
|
|
|
(1) install packages as listed below
|
|
(2) apply Mark's epstopdf-base.sty hack as documented in "Notes [Mar 2015]"
|
|
|
|
Packages to install:
|
|
|
|
sudo dnf install texlive-xmltex texlive-xmltex-bin texlive-xmltex-doc \
|
|
texlive dblatex texlive-xmltex docbook-style-xsl docbook-dtds \
|
|
docbook-style-xsl.noarch docbook-simple.noarch docbook-simple.noarch \
|
|
docbook-slides.noarch docbook-style-dsssl.noarch docbook-utils.noarch \
|
|
docbook-utils-pdf.noarch docbook5-schemas.noarch \
|
|
docbook5-style-xsl.noarch passivetex
|
|
|
|
|
|
Notes [Sept 2015]
|
|
-----------------
|
|
Fedora 21 and 22: Had mucho trouble with building the print docs on
|
|
F21/22 even with the [Mar 2015] package set (or something similarish)
|
|
installed. Eventually installed "passivetex" and that fixes the
|
|
failures.
|
|
|
|
Installing the packages below on Fedora _might_ get you a working setup.
|
|
Also you need the epstopdf-base.sty hack detailed below.
|
|
|
|
texlive-xmltex texlive-xmltex-bin texlive-xmltex-doc texlive dblatex
|
|
texlive-xmltex docbook-style-xsl docbook-dtds docbook-style-xsl.noarch
|
|
docbook-simple.noarch docbook-simple.noarch docbook-slides.noarch
|
|
docbook-style-dsssl.noarch docbook-utils.noarch
|
|
docbook-utils-pdf.noarch docbook5-schemas.noarch
|
|
docbook5-style-xsl.noarch passivetex
|
|
|
|
Notes [Mar 2015]
|
|
----------------
|
|
On Ubuntu 14.04.2 LTS the following is known to work:
|
|
|
|
Required packages:
|
|
texlive
|
|
dblatex
|
|
xsltproc
|
|
xmltex
|
|
docbook-xml
|
|
docbook-xsl
|
|
|
|
Additional the following lines need to be changed in
|
|
/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
|
|
around line 450 from
|
|
|
|
|
|
\ifETE@prepend
|
|
\expandafter\PrependGraphicsExtensions
|
|
\else
|
|
\expandafter\AppendGraphicsExtensions
|
|
\fi
|
|
{.eps}
|
|
|
|
|
|
to
|
|
|
|
|
|
%% \ifETE@prepend
|
|
%% \expandafter\PrependGraphicsExtensions
|
|
%% \else
|
|
%% \expandafter\AppendGraphicsExtensions
|
|
%% \fi
|
|
%% {.eps}
|
|
|
|
This hack was devised by Mark Wielaard.
|
|
|
|
|
|
Notes [Aug. 2012]
|
|
-----------------
|
|
On Ubuntu 10.04 there was a new capacity-related failure whilst
|
|
building the print docs in the run up to the 3.8.0 release. This was
|
|
fixed by editing /etc/texmf/texmf.cnf and changing pool_size to
|
|
2000000.
|
|
|
|
|
|
Notes [May 2009]
|
|
-----------------
|
|
For Ubuntu 9.04, to build HTML docs I had to:
|
|
|
|
sudo apt-get install docbook docbook-xsl
|
|
|
|
Actually, I'm not sure if the 'docbook' is necessary, but 'docbook-xsl'
|
|
definitely is.
|
|
|
|
To build the man pages I also changed the Makefile.am to try this
|
|
stylesheet:
|
|
|
|
/usr/share/xml/docbook/stylesheet/nwalsh/current/manpages/docbook.xsl
|
|
|
|
if it can't find this one:
|
|
|
|
/usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl
|
|
|
|
I haven't succeeded in building the print docs.
|
|
|
|
|
|
Notes [Mar. 2007]
|
|
-----------------
|
|
For SuSE 10.1, I have to install the following packages to get a
|
|
working toolchain. Non-indented ones I asked YaST to install;
|
|
indented ones are extras it added on:
|
|
|
|
docbook_4
|
|
iso_ent
|
|
xmlcharent
|
|
docbook-dsssl-stylesheets
|
|
docbook_3
|
|
docbook-xsl-stylesheets
|
|
xmltex
|
|
gd
|
|
latex-ucs
|
|
te_latex
|
|
tetex
|
|
xaw3d
|
|
passivetex
|
|
xpdf
|
|
xpdf-tools
|
|
|
|
pdfxmltex still bombs when building the print docs. On SuSE 10.1 I
|
|
edited /etc/texmf/web2c/texmf.cnf and changed
|
|
pool_size.pdfxmltex = 500000
|
|
to
|
|
pool_size.pdfxmltex = 1500000
|
|
and that fixes it.
|
|
|
|
It is also reported that the print docs build OK on Fedora Core 5.
|
|
|
|
|
|
Notes [Nov. 2005]
|
|
-----------------
|
|
After upgrading to Suse 10, found a (known) bug in PassiveTex which
|
|
broke the build, so added a bug-fix to 'docs/lib/vg-fo.xsl'.
|
|
Bug-fix related links:
|
|
http://lists.oasis-open.org/archives/docbook/200509/msg00032.html
|
|
http://www.dpawson.co.uk/docbook/tools.html#d850e300
|
|
http://www.haskell.org/pipermail/glasgow-haskell-bugs/2005-January.txt
|
|
|
|
|
|
Notes [July 2005]
|
|
-----------------
|
|
jrs had to install zillions of packages on SuSE 9.2 in order to
|
|
build the print docs (make print-docs), including
|
|
passivetex
|
|
xpdf (for pdftops, which does the nicest job)
|
|
|
|
Even then, pdfxmltex eventually dies with "TeX capacity exceeded,
|
|
sorry [pool size = 67555]" or some such. To fix this, he edited
|
|
/etc/texmf/texmf.cnf and changed
|
|
pool_size.pdfxmltex = 500000
|
|
to
|
|
pool_size.pdfxmltex = 1500000
|
|
and that fixed it.
|
|
|
|
|
|
Notes [Nov. 2004]:
|
|
-----------------
|
|
- the end of file.xml must have only ONE newline after the last tag:
|
|
</book>
|
|
- pdfxmltex barfs if given a filename with an underscore in it
|
|
|
|
|
|
References:
|
|
----------
|
|
- samba have got all the stuff
|
|
http://websvn.samba.org/listing.php?rep=4&path=/trunk/&opt=dir&sc=1
|
|
|
|
excellent on-line howto reference:
|
|
- http://www.cogent.ca/
|
|
|
|
using automake with docbook:
|
|
- http://www.movement.uklinux.net/docs/docbook-autotools/index.html
|
|
|
|
Debugging catalog processing:
|
|
- http://xmlsoft.org/catalog.html#Declaring
|
|
xmlcatalog -v <catalog-file>
|
|
|
|
shell script to generate xml catalogs for docbook 4.1.2:
|
|
- http://xmlsoft.org/XSLT/docbook.html
|
|
|
|
configure.in re pdfxmltex
|
|
- http://cvs.sourceforge.net/viewcvs.py/logreport/service/configure.in?rev=1.325
|
|
|
|
some useful xls stylesheets in cvs:
|
|
- http://cvs.sourceforge.net/viewcvs.py/perl-xml/perl-xml-faq/
|
|
|
|
|
|
TODO LESS CRUCIAL:
|
|
------------------
|
|
- concat titlepage + subtitle page in fo output
|
|
- try and get the QuickStart and FAQ titlepage+toc+content onto one page
|