[4.1] c855794 Include the current time of the panic in the panic output

PÃ¥l Hermunn Johansen hermunn at varnish-software.com
Wed Nov 16 13:55:05 CET 2016

commit c855794616fd2f3bd74a250cefcb88a8ac3415f9
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Thu Oct 27 14:02:43 2016 +0200

    Include the current time of the panic in the panic output
    Show both the real and the monotonic time in the panic output when the
    panic is created. This is useful to have something to compare other
    panic timestamps against.
    The existing timestamp in the panic output is recorded by the
    management process at the time of receiving the panic from the child
    process. Due to processing and possible core dump creation, this time
    isn't very useful for comparison purposes.

diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index c475605..589f9f5 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -39,6 +39,8 @@
 #include <stdlib.h>
 #include <signal.h>
+#include "vtim.h"
 #include "cache.h"
 #include "cache_filter.h"
@@ -526,6 +528,8 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
 	VSB_printf(pan_vsb, "version = %s\n", VCS_version);
 	VSB_printf(pan_vsb, "ident = %s,%s\n",
 	    VSB_data(vident) + 1, Waiter_GetName());
+	VSB_printf(pan_vsb, "now = %f (mono), %f (real)\n",
+	    VTIM_mono(), VTIM_real());

More information about the varnish-commit mailing list