Mailing List Archive

[master] 4932ce965 Try to regain gcov for tests which panic.
commit 4932ce96544133b806c751e633de82714f0b78da
Author: Poul-Henning Kamp <phk@FreeBSD.org>
Date: Tue Jun 9 21:01:24 2020 +0000

Try to regain gcov for tests which panic.

diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index 407b8eacf..bfee6a1ad 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -63,6 +63,10 @@
*
*/

+#ifdef GCOVING
+ int __llvm_profile_write_file(void);
+#endif
+
static struct vsb pan_vsb_storage, *pan_vsb;
static pthread_mutex_t panicstr_mtx;

@@ -811,6 +815,9 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
VSB_cat(pan_vsb, "\n");
VSB_putc(pan_vsb, '\0'); /* NUL termination */

+#ifdef GCOVING
+ __llvm_profile_write_file();
+#endif
abort();
}

diff --git a/bin/varnishd/mgt/mgt_cli.c b/bin/varnishd/mgt/mgt_cli.c
index b046d20c7..e5aeffdef 100644
--- a/bin/varnishd/mgt/mgt_cli.c
+++ b/bin/varnishd/mgt/mgt_cli.c
@@ -63,6 +63,10 @@ static const struct cli_cmd_desc *cmds[] = {
#include "tbl/cli_cmds.h"
};

+#ifdef GCOVING
+ int __llvm_profile_write_file(void);
+#endif
+
static const int ncmds = sizeof cmds / sizeof cmds[0];

static int cli_i = -1, cli_o = -1;
@@ -108,6 +112,9 @@ mcf_panic(struct cli *cli, const char * const *av, void *priv)
(void)cli;
(void)av;
(void)priv;
+#ifdef GCOVING
+ __llvm_profile_write_file();
+#endif
AZ(strcmp("", "You asked for it"));
/* NOTREACHED */
abort();
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit