mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 02:18:37 +00:00
commit 7dd9a7f8b3118c25014b0a77aff899e517c46bcd has added the flag -finline-functions. This triggers a code generation bug in gcc 6.3.0 (at least with gcc version 6.3.0 20170516 (Debian 6.3.0-18)). (this bug can be reproduced e.g. on gcc67, which is a debian 9.2 system) The bad code causes the debug trace to be indented by more than 500 characters, giving e.g. for the first debug line produced by stage 2: --12305:1:launcher launching /home/philippe/valgrind/git/smallthing/./.in_place/memcheck-amd64-linux --12305:1:debuglog DebugLog system started by Stage 2 (main), level 1 logging requested This commit bypasses the code generation bug, by moving the indent calculation just before its usage. Note: on amd64/x86, the code size of memcheck tool increases by about 12% with -finline-functions. In terms of perf impact (using perf/vg_perf) this gives mixed results : memcheck is usually slightly faster, but some tests are slower (e.g. heap_pdb4) callgrind is usually slower, but some tests are faster helgrind : some tests are slowed down, some tests are faster (some significantly faster such as sarp and ffbench). See below 2 runs of comparing trunk (with -finline-functions) with fixes (which does not have -finline-functions). -- Running tests in perf ---------------------------------------------- -- bigcode1 -- bigcode1 trunk_untouched:0.07s me: 2.2s (32.0x, -----) he: 1.7s (23.9x, -----) ca: 9.0s (129.0x, -----) bigcode1 fixes :0.07s me: 2.3s (32.3x, -0.9%) he: 1.7s (23.9x, 0.0%) ca: 8.8s (125.4x, 2.8%) -- bigcode2 -- bigcode2 trunk_untouched:0.07s me: 5.0s (72.1x, -----) he: 3.2s (46.0x, -----) ca:18.6s (266.4x, -----) bigcode2 fixes :0.07s me: 5.1s (73.0x, -1.2%) he: 3.2s (46.1x, -0.3%) ca:18.4s (262.9x, 1.3%) -- bz2 -- bz2 trunk_untouched:0.43s me: 4.5s (10.4x, -----) he: 6.7s (15.5x, -----) ca:10.4s (24.2x, -----) bz2 fixes :0.43s me: 4.5s (10.5x, -0.4%) he: 6.7s (15.5x, 0.0%) ca:10.1s (23.4x, 3.4%) -- fbench -- fbench trunk_untouched:0.14s me: 2.7s (19.6x, -----) he: 1.9s (13.4x, -----) ca: 4.0s (28.3x, -----) fbench fixes :0.14s me: 2.8s (19.9x, -1.8%) he: 2.0s (14.6x, -8.5%) ca: 3.9s (28.1x, 0.8%) -- ffbench -- ffbench trunk_untouched:0.15s me: 2.6s (17.1x, -----) he: 3.4s (22.4x, -----) ca: 1.5s (10.1x, -----) ffbench fixes :0.15s me: 2.6s (17.3x, -0.8%) he: 3.1s (20.9x, 6.8%) ca: 1.5s (10.0x, 1.3%) -- heap -- heap trunk_untouched:0.05s me: 3.6s (72.8x, -----) he: 5.0s (100.0x, -----) ca: 4.9s (98.2x, -----) heap fixes :0.05s me: 3.7s (73.6x, -1.1%) he: 5.1s (102.4x, -2.4%) ca: 4.8s (95.6x, 2.6%) -- heap_pdb4 -- heap_pdb4 trunk_untouched:0.06s me: 5.9s (97.7x, -----) he: 5.6s (93.7x, -----) ca: 5.2s (86.8x, -----) heap_pdb4 fixes :0.06s me: 5.8s (96.0x, 1.7%) he: 5.7s (95.3x, -1.8%) ca: 5.3s (87.7x, -1.0%) -- many-loss-records -- many-loss-records trunk_untouched:0.01s me: 1.0s (101.0x, -----) he: 0.8s (85.0x, -----) ca: 0.8s (78.0x, -----) many-loss-records fixes :0.01s me: 1.0s (100.0x, 1.0%) he: 0.9s (86.0x, -1.2%) ca: 0.8s (78.0x, 0.0%) -- many-xpts -- many-xpts trunk_untouched:0.03s me: 1.1s (38.3x, -----) he: 1.4s (46.0x, -----) ca: 1.9s (62.7x, -----) many-xpts fixes :0.03s me: 1.1s (37.0x, 3.5%) he: 1.4s (47.0x, -2.2%) ca: 1.8s (61.3x, 2.1%) -- memrw -- memrw trunk_untouched:0.04s me: 0.9s (21.5x, -----) he: 2.3s (58.0x, -----) ca: 1.9s (46.8x, -----) memrw fixes :0.04s me: 0.9s (22.0x, -2.3%) he: 2.3s (58.0x, 0.0%) ca: 1.9s (47.2x, -1.1%) -- sarp -- sarp trunk_untouched:0.02s me: 1.5s (77.0x, -----) he: 3.4s (168.5x, -----) ca: 1.3s (63.0x, -----) sarp fixes :0.02s me: 1.6s (80.0x, -3.9%) he: 4.0s (200.5x,-19.0%) ca: 1.3s (65.5x, -4.0%) -- tinycc -- tinycc trunk_untouched:0.10s me: 6.7s (66.7x, -----) he: 6.6s (65.9x, -----) ca: 7.2s (72.4x, -----) tinycc fixes :0.10s me: 6.6s (66.0x, 1.0%) he: 6.8s (68.0x, -3.2%) ca: 7.2s (72.1x, 0.4%) -- Finished tests in perf ---------------------------------------------- == 12 programs, 72 timings ================= -- Running tests in perf ---------------------------------------------- -- bigcode1 -- bigcode1 trunk_untouched:0.07s me: 2.2s (32.0x, -----) he: 1.7s (23.7x, -----) ca: 9.0s (129.1x, -----) bigcode1 fixes :0.07s me: 2.3s (32.3x, -0.9%) he: 1.7s (23.9x, -0.6%) ca: 8.8s (125.3x, 3.0%) -- bigcode2 -- bigcode2 trunk_untouched:0.07s me: 5.0s (72.1x, -----) he: 3.2s (46.0x, -----) ca:18.7s (266.6x, -----) bigcode2 fixes :0.07s me: 5.1s (72.9x, -1.0%) he: 3.2s (46.0x, 0.0%) ca:18.5s (263.7x, 1.1%) -- bz2 -- bz2 trunk_untouched:0.43s me: 4.5s (10.5x, -----) he: 6.7s (15.5x, -----) ca:10.4s (24.2x, -----) bz2 fixes :0.43s me: 4.5s (10.5x, -0.2%) he: 6.7s (15.5x, -0.2%) ca:10.1s (23.4x, 3.3%) -- fbench -- fbench trunk_untouched:0.14s me: 2.8s (19.6x, -----) he: 1.9s (13.4x, -----) ca: 4.0s (28.2x, -----) fbench fixes :0.14s me: 2.8s (19.9x, -1.1%) he: 2.0s (14.6x, -8.5%) ca: 3.9s (28.1x, 0.3%) -- ffbench -- ffbench trunk_untouched:0.15s me: 2.6s (17.1x, -----) he: 3.4s (22.5x, -----) ca: 1.5s (10.1x, -----) ffbench fixes :0.15s me: 2.6s (17.3x, -0.8%) he: 3.1s (20.8x, 7.4%) ca: 1.5s ( 9.9x, 2.0%) -- heap -- heap trunk_untouched:0.05s me: 3.6s (72.6x, -----) he: 5.0s (99.4x, -----) ca: 4.9s (98.4x, -----) heap fixes :0.05s me: 3.7s (73.6x, -1.4%) he: 5.1s (102.4x, -3.0%) ca: 4.8s (95.2x, 3.3%) -- heap_pdb4 -- heap_pdb4 trunk_untouched:0.06s me: 5.9s (98.0x, -----) he: 5.6s (94.0x, -----) ca: 5.2s (86.8x, -----) heap_pdb4 fixes :0.06s me: 5.8s (96.0x, 2.0%) he: 5.7s (94.8x, -0.9%) ca: 5.2s (87.3x, -0.6%) -- many-loss-records -- many-loss-records trunk_untouched:0.01s me: 1.0s (101.0x, -----) he: 0.8s (85.0x, -----) ca: 0.8s (76.0x, -----) many-loss-records fixes :0.01s me: 1.0s (100.0x, 1.0%) he: 0.9s (87.0x, -2.4%) ca: 0.8s (77.0x, -1.3%) -- many-xpts -- many-xpts trunk_untouched:0.03s me: 1.2s (38.7x, -----) he: 1.4s (45.3x, -----) ca: 1.9s (62.7x, -----) many-xpts fixes :0.03s me: 1.1s (37.0x, 4.3%) he: 1.4s (47.0x, -3.7%) ca: 1.8s (61.3x, 2.1%) -- memrw -- memrw trunk_untouched:0.04s me: 0.9s (22.0x, -----) he: 2.3s (58.2x, -----) ca: 1.9s (46.5x, -----) memrw fixes :0.04s me: 0.9s (21.8x, 1.1%) he: 2.3s (58.2x, 0.0%) ca: 1.9s (47.2x, -1.6%) -- sarp -- sarp trunk_untouched:0.02s me: 1.5s (76.5x, -----) he: 3.4s (167.5x, -----) ca: 1.3s (63.0x, -----) sarp fixes :0.02s me: 1.6s (79.5x, -3.9%) he: 4.0s (200.5x,-19.7%) ca: 1.3s (65.5x, -4.0%) -- tinycc -- tinycc trunk_untouched:0.10s me: 6.6s (66.3x, -----) he: 6.6s (66.2x, -----) ca: 7.2s (72.4x, -----) tinycc fixes :0.10s me: 6.6s (66.1x, 0.3%) he: 6.8s (68.1x, -2.9%) ca: 7.2s (72.2x, 0.3%) -- Finished tests in perf ---------------------------------------------- == 12 programs, 72 timings =================
Darwin13.supp should include suppression for known uninitialised read in pthread_rwlock_init() as required to pass the memcheck/tests/darwin/pth-supp test. Patch and discussion per BZ #339780.
Release notes for Valgrind
~~~~~~~~~~~~~~~~~~~~~~~~~~
If you are building a binary package of Valgrind for distribution,
please read README_PACKAGERS. It contains some important information.
If you are developing Valgrind, please read README_DEVELOPERS. It contains
some useful information.
For instructions on how to build/install, see the end of this file.
If you have problems, consult the FAQ to see if there are workarounds.
Executive Summary
~~~~~~~~~~~~~~~~~
Valgrind is a framework for building dynamic analysis tools. There are
Valgrind tools that can automatically detect many memory management
and threading bugs, and profile your programs in detail. You can also
use Valgrind to build new tools.
The Valgrind distribution currently includes six production-quality
tools: a memory error detector, two thread error detectors, a cache
and branch-prediction profiler, a call-graph generating cache abd
branch-prediction profiler, and a heap profiler. It also includes
three experimental tools: a heap/stack/global array overrun detector,
a different kind of heap profiler, and a SimPoint basic block vector
generator.
Valgrind is closely tied to details of the CPU, operating system and to
a lesser extent, compiler and basic C libraries. This makes it difficult
to make it portable. Nonetheless, it is available for the following
platforms:
- X86/Linux
- AMD64/Linux
- PPC32/Linux
- PPC64/Linux
- ARM/Linux
- x86/macOS
- AMD64/macOS
- S390X/Linux
- MIPS32/Linux
- MIPS64/Linux
- X86/Solaris
- AMD64/Solaris
Note that AMD64 is just another name for x86_64, and Valgrind runs fine
on Intel processors. Also note that the core of macOS is called
"Darwin" and this name is used sometimes.
Valgrind is licensed under the GNU General Public License, version 2.
Read the file COPYING in the source distribution for details.
However: if you contribute code, you need to make it available as GPL
version 2 or later, and not 2-only.
Documentation
~~~~~~~~~~~~~
A comprehensive user guide is supplied. Point your browser at
$PREFIX/share/doc/valgrind/manual.html, where $PREFIX is whatever you
specified with --prefix= when building.
Building and installing it
~~~~~~~~~~~~~~~~~~~~~~~~~~
To install from the GIT repository:
0. Clone the code from GIT, following the instructions at
http://www.valgrind.org/downloads/repository.html.
1. cd into the source directory.
2. Run ./autogen.sh to setup the environment (you need the standard
autoconf tools to do so).
3. Continue with the following instructions...
To install from a tar.bz2 distribution:
4. Run ./configure, with some options if you wish. The only interesting
one is the usual --prefix=/where/you/want/it/installed.
5. Run "make".
6. Run "make install", possibly as root if the destination permissions
require that.
7. See if it works. Try "valgrind ls -l". Either this works, or it
bombs out with some complaint. In that case, please let us know
(see www.valgrind.org).
Important! Do not move the valgrind installation into a place
different from that specified by --prefix at build time. This will
cause things to break in subtle ways, mostly when Valgrind handles
fork/exec calls.
The Valgrind Developers
Description
Languages
C
94.6%
Assembly
1.7%
C++
1.1%
Makefile
0.6%
Perl
0.5%
Other
1.4%