diff options
author | Dave Barach <dave@barachs.net> | 2019-05-06 10:49:41 -0400 |
---|---|---|
committer | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2019-05-06 20:48:51 +0000 |
commit | ad64687e8bc3e208797ce1d5b16936f51d6cf632 (patch) | |
tree | 14f15c2f326bda0bbc4d05c2f73bae9f5c71c0c0 /src/vlib | |
parent | d7566cb70bbd1917e25e47c08a26c72451d86794 (diff) |
gcov / test framework: sigterm not sigkill
Otherwise, gcov data vanishes without a trace.
Add a __gcov_flush() call to the unix signal handler, under #ifdef
CLIB_GCOV. Add -DCLIB_GCOV to vpp_gcov_TAG_CFLAGS.
Change-Id: I2726e671b26dfbe7fae88f46a8207bb2b5106884
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlib')
-rwxr-xr-x | src/vlib/unix/main.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/vlib/unix/main.c b/src/vlib/unix/main.c index ed909b65feb..82de8ec7632 100755 --- a/src/vlib/unix/main.c +++ b/src/vlib/unix/main.c @@ -139,6 +139,17 @@ unix_signal_handler (int signum, siginfo_t * si, ucontext_t * uc) break; } +#ifdef CLIB_GCOV + /* + * Test framework sends SIGTERM, so we need to flush the + * code coverage stats here. + */ + { + void __gcov_flush (void); + __gcov_flush (); + } +#endif + /* Null terminate. */ vec_add1 (syslog_msg, 0); |