[master] f8ef73c32 Add a -m ("Miss") argument which also logs the records which do not match

Poul-Henning Kamp phk at FreeBSD.org
Tue Jan 15 12:58:08 UTC 2019


commit f8ef73c329a084879465f36a108901dac7fe64a1
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Jan 15 12:50:09 2019 +0000

    Add a -m ("Miss") argument which also logs the records which do not match

diff --git a/bin/varnishtest/vtc_logexp.c b/bin/varnishtest/vtc_logexp.c
index 43e300acf..521c9ae3b 100644
--- a/bin/varnishtest/vtc_logexp.c
+++ b/bin/varnishtest/vtc_logexp.c
@@ -65,6 +65,8 @@
  * \-q query
  *         Filter records using a query expression, see ``man vsl-query`` for
  *         more information.
+ * \-m
+ *	   Also emit log records for misses (only for debugging)
  *
  * \-start
  *         Start the logexpect thread in the background.
@@ -153,6 +155,7 @@ struct logexp {
 	int				vxid_last;
 	int				tag_last;
 
+	int				m_arg;
 	int				d_arg;
 	enum VSL_grouping_e		g_arg;
 	char				*query;
@@ -308,6 +311,8 @@ logexp_dispatch(struct VSL_data *vsl, struct VSL_transaction * const pt[],
 
 			if (ok)
 				legend = "match";
+			else if (skip && le->m_arg)
+				legend = "miss";
 			else if (skip)
 				legend = NULL;
 			else
@@ -597,6 +602,10 @@ cmd_logexpect(CMD_ARGS)
 			av++;
 			continue;
 		}
+		if (!strcmp(*av, "-m")) {
+			le->m_arg = !le->m_arg;
+			continue;
+		}
 		if (!strcmp(*av, "-start")) {
 			logexp_start(le);
 			continue;


More information about the varnish-commit mailing list