1
0
forked from aniani/vim

patch 8.2.0739: incomplete profiling when exiting because of a dealy signal

Problem:    Incomplete profiling when exiting because of a dealy signal.
Solution:   Call __gcov_flush() if available.
This commit is contained in:
Bram Moolenaar
2020-05-11 22:13:28 +02:00
parent 91689ea8ae
commit b415168a98
4 changed files with 17 additions and 3 deletions

View File

@@ -11,13 +11,13 @@ _anchors:
- &normal - &normal
BUILD=yes TEST=test FEATURES=normal CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no BUILD=yes TEST=test FEATURES=normal CONFOPT= SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
- &linux-huge - &linux-huge
BUILD=yes TEST="scripttests test_libvterm" CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no BUILD=yes TEST="scripttests test_libvterm" CFLAGS="--coverage -DUSE_GCOV_FLUSH" LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
CONFOPT="--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp" CONFOPT="--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
- &osx-huge # macOS build - &osx-huge # macOS build
BUILD=yes TEST=test FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no BUILD=yes TEST=test FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no
CONFOPT="--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp --enable-tclinterp" CONFOPT="--enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
- &unittests - &unittests
BUILD=no TEST=unittests CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=yes BUILD=no TEST=unittests CFLAGS="--coverage -DUSE_GCOV_FLUSH" LDFLAGS=--coverage FEATURES=huge SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=yes
- &asan # ASAN build - &asan # ASAN build
SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize=address -fno-omit-frame-pointer" SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize=address -fno-omit-frame-pointer"
ASAN_OPTIONS="print_stacktrace=1 log_path=asan" LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/src/testdir/lsan-suppress.txt" ASAN_OPTIONS="print_stacktrace=1 log_path=asan" LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/src/testdir/lsan-suppress.txt"

View File

@@ -686,8 +686,10 @@ LINT_OPTIONS = -beprxzF
# 7. Open the objects/index.html file in a web browser to view the coverage # 7. Open the objects/index.html file in a web browser to view the coverage
# information. # information.
# #
# PROFILE_CFLAGS=-g -O0 -fprofile-arcs -ftest-coverage
# LDFLAGS=--coverage # LDFLAGS=--coverage
# PROFILE_CFLAGS=-g -O0 -fprofile-arcs -ftest-coverage -DWE_ARE_PROFILING -DUSE_GCOV_FLUSH
# Alternate flags
# PROFILE_CFLAGS=-g -O0 --coverage -DWE_ARE_PROFILING -DUSE_GCOV_FLUSH
# Uncomment one of the next two lines to compile Vim with the # Uncomment one of the next two lines to compile Vim with the

View File

@@ -3312,6 +3312,10 @@ exit_scroll(void)
} }
} }
#ifdef USE_GCOV_FLUSH
extern void __gcov_flush();
#endif
void void
mch_exit(int r) mch_exit(int r)
{ {
@@ -3358,6 +3362,12 @@ mch_exit(int r)
} }
out_flush(); out_flush();
ml_close_all(TRUE); // remove all memfiles ml_close_all(TRUE); // remove all memfiles
#ifdef USE_GCOV_FLUSH
// Flush coverage info before possibly being killed by a deadly signal.
__gcov_flush();
#endif
may_core_dump(); may_core_dump();
#ifdef FEAT_GUI #ifdef FEAT_GUI
if (gui.in_use) if (gui.in_use)

View File

@@ -746,6 +746,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
739,
/**/ /**/
738, 738,
/**/ /**/