[4.1] dc5e096 Add a debug bit to always keep the vsm file

Nils Goroll nils.goroll at uplex.de
Fri Sep 4 15:54:50 CEST 2015


commit dc5e096ac1f60b900761d938ae4fc16fd06c8e1e
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Jul 14 04:06:20 2015 +0200

    Add a debug bit to always keep the vsm file

diff --git a/bin/varnishd/mgt/mgt_child.c b/bin/varnishd/mgt/mgt_child.c
index 450ec9c..3a6890a 100644
--- a/bin/varnishd/mgt/mgt_child.c
+++ b/bin/varnishd/mgt/mgt_child.c
@@ -94,6 +94,12 @@ MGT_FEATURE(enum feature_bits x)
 	return (mgt_param.feature_bits[(unsigned)x>>3] &
 	    (0x80U >> ((unsigned)x & 7)));
 }
+static inline int
+MGT_DO_DEBUG(enum debug_bits x)
+{
+	return (mgt_param.debug_bits[(unsigned)x>>3] &
+	    (0x80U >> ((unsigned)x & 7)));
+}
 
 static void mgt_reap_child(void);
 
@@ -528,7 +534,7 @@ mgt_reap_child(void)
 		mgt_SHM_Destroy(1);
 		VSC_C_mgt->child_panic = ++static_VSC_C_mgt.child_panic;
 	} else {
-		mgt_SHM_Destroy(0);
+		mgt_SHM_Destroy(MGT_DO_DEBUG(DBG_VSM_KEEP));
 	}
 	mgt_SHM_Create();
 	mgt_SHM_Commit();
diff --git a/include/tbl/debug_bits.h b/include/tbl/debug_bits.h
index 9e5b684..fa0d32f 100644
--- a/include/tbl/debug_bits.h
+++ b/include/tbl/debug_bits.h
@@ -42,4 +42,5 @@ DEBUG_BIT(ESI_CHOP,		esi_chop,	"Chop ESI fetch to bits")
 DEBUG_BIT(FLUSH_HEAD,		flush_head,	"Flush after http1 head")
 DEBUG_BIT(VTC_MODE,		vtc_mode,	"Varnishtest Mode")
 DEBUG_BIT(WITNESS,		witness,	"Emit WITNESS lock records")
+DEBUG_BIT(VSM_KEEP,		vsm_keep,	"Keep the VSM file on restart")
 /*lint -restore */



More information about the varnish-commit mailing list