[experimental-ims] 495b9f5 Move 3 more debug bits from diag_bitmaps to debug
Poul-Henning Kamp
phk at FreeBSD.org
Thu Dec 18 10:27:55 CET 2014
commit 495b9f51c6a7cc67e1c6b5609251cbcfb50ea3c2
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Aug 27 20:19:33 2012 +0000
Move 3 more debug bits from diag_bitmaps to debug
XXX: doc-update needed
diff --git a/bin/varnishd/cache/cache_ban.c b/bin/varnishd/cache/cache_ban.c
index c949acc..2054d3e 100644
--- a/bin/varnishd/cache/cache_ban.c
+++ b/bin/varnishd/cache/cache_ban.c
@@ -836,13 +836,13 @@ ban_lurker_work(struct worker *wrk, struct vsl_log *vsl, unsigned pass)
b->flags &= ~BAN_F_LURK;
b->flags |= pass;
}
- if (cache_param->diag_bitmap & 0x80000)
+ if (DO_DEBUG(DBG_LURKER))
VSLb(vsl, SLT_Debug, "lurker: %d actionable bans", i);
if (i == 0)
return (0);
VTAILQ_FOREACH_REVERSE(b, &ban_head, banhead_s, list) {
- if (cache_param->diag_bitmap & 0x80000)
+ if (DO_DEBUG(DBG_LURKER))
VSLb(vsl, SLT_Debug, "lurker doing %f %d",
ban_time(b->spec), b->refcount);
while (1) {
@@ -851,7 +851,7 @@ ban_lurker_work(struct worker *wrk, struct vsl_log *vsl, unsigned pass)
if (oc == NULL)
break;
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
- if (cache_param->diag_bitmap & 0x80000)
+ if (DO_DEBUG(DBG_LURKER))
VSLb(vsl, SLT_Debug, "test: %p %u %u",
oc, oc->flags & OC_F_LURK, pass);
if ((oc->flags & OC_F_LURK) == pass)
@@ -903,7 +903,7 @@ ban_lurker_work(struct worker *wrk, struct vsl_log *vsl, unsigned pass)
*/
o = oc_getobj(&wrk->stats, oc);
i = ban_check_object(o, vsl, NULL);
- if (cache_param->diag_bitmap & 0x80000)
+ if (DO_DEBUG(DBG_LURKER))
VSLb(vsl, SLT_Debug, "lurker got: %p %d",
oc, i);
if (i == -1) {
@@ -915,7 +915,7 @@ ban_lurker_work(struct worker *wrk, struct vsl_log *vsl, unsigned pass)
Lck_Unlock(&ban_mtx);
}
Lck_Unlock(&oh->mtx);
- if (cache_param->diag_bitmap & 0x80000)
+ if (DO_DEBUG(DBG_LURKER))
VSLb(vsl, SLT_Debug, "lurker done: %p %u %u",
oc, oc->flags & OC_F_LURK, pass);
(void)HSH_Deref(&wrk->stats, NULL, &o);
@@ -927,7 +927,7 @@ ban_lurker_work(struct worker *wrk, struct vsl_log *vsl, unsigned pass)
b->flags |= BAN_F_GONE;
VSC_C_main->bans_gone++;
}
- if (cache_param->diag_bitmap & 0x80000)
+ if (DO_DEBUG(DBG_LURKER))
VSLb(vsl, SLT_Debug, "lurker BAN %f now gone",
ban_time(b->spec));
}
@@ -1091,7 +1091,7 @@ ccf_ban_list(struct cli *cli, const char * const *av, void *priv)
VCLI_Out(cli, "Present bans:\n");
VTAILQ_FOREACH(b, &ban_head, list) {
- if (b == bl && !(cache_param->diag_bitmap & 0x80000))
+ if (b == bl && !DO_DEBUG(DBG_LURKER))
break;
VCLI_Out(cli, "%10.6f %5u%s\t", ban_time(b->spec),
bl == b ? b->refcount - 1 : b->refcount,
@@ -1100,7 +1100,7 @@ ccf_ban_list(struct cli *cli, const char * const *av, void *priv)
VCLI_Out(cli, "\n");
if (VCLI_Overflow(cli))
break;
- if (cache_param->diag_bitmap & 0x80000) {
+ if (DO_DEBUG(DBG_LURKER)) {
Lck_Lock(&ban_mtx);
struct objcore *oc;
VTAILQ_FOREACH(oc, &b->objcore, ban_list)
diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index fcf447a..932cb67 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -305,7 +305,7 @@ HSH_Lookup(struct req *req)
AN(hash);
hsh_prealloc(wrk);
- if (cache_param->diag_bitmap & 0x80000000)
+ if (DO_DEBUG(DBG_HASHEDGE))
hsh_testmagic(req->digest);
if (req->hash_objhead != NULL) {
diff --git a/bin/varnishd/cache/cache_session.c b/bin/varnishd/cache/cache_session.c
index 6cffa69..5caf03f 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -140,10 +140,8 @@ ses_req_pool_task(struct worker *wrk, void *arg)
HTTP1_Session(wrk, req);
WS_Assert(wrk->aws);
AZ(wrk->wrw);
- if (cache_param->diag_bitmap & 0x00040000) {
- if (wrk->vcl != NULL)
- VCL_Rel(&wrk->vcl);
- }
+ if (DO_DEBUG(DBG_VCLREL) && wrk->vcl != NULL)
+ VCL_Rel(&wrk->vcl);
THR_SetRequest(NULL);
}
diff --git a/bin/varnishd/mgt/mgt_param.c b/bin/varnishd/mgt/mgt_param.c
index 2c8ad86..a6f75b8 100644
--- a/bin/varnishd/mgt/mgt_param.c
+++ b/bin/varnishd/mgt/mgt_param.c
@@ -1054,9 +1054,6 @@ static const struct parspec input_parspec[] = {
" 0x00002000 - only short panic message.\n"
" 0x00004000 - panic to stderr.\n"
" 0x00020000 - synchronous start of persistence.\n"
- " 0x00040000 - release VCL early.\n"
- " 0x00080000 - ban-lurker debugging.\n"
- " 0x80000000 - do edge-detection on digest.\n"
"\n"
"Use 0x notation and do the bitor in your head :-)\n"
"\n"
diff --git a/bin/varnishtest/tests/c00023.vtc b/bin/varnishtest/tests/c00023.vtc
index b57c8c1..0e6aff1 100644
--- a/bin/varnishtest/tests/c00023.vtc
+++ b/bin/varnishtest/tests/c00023.vtc
@@ -31,7 +31,7 @@ server s1 {
} -start
varnish v1 -arg "-hcritbit" -vcl+backend { } -start
-varnish v1 -cliok "param.set diag_bitmap 0x80000000"
+varnish v1 -cliok "param.set debug +hashedge"
client c1 {
txreq -url "/1"
diff --git a/bin/varnishtest/tests/c00049.vtc b/bin/varnishtest/tests/c00049.vtc
index 59e6c14..2e31705 100644
--- a/bin/varnishtest/tests/c00049.vtc
+++ b/bin/varnishtest/tests/c00049.vtc
@@ -36,7 +36,7 @@ varnish v1 -vcl+backend {
} -start
varnish v1 -cliok "param.set ban_lurker_sleep 0"
-varnish v1 -cliok "param.set diag_bitmap 0x80000"
+varnish v1 -cliok "param.set debug +lurker"
varnish v1 -cliok "ban.list"
diff --git a/bin/varnishtest/tests/m00001.vtc b/bin/varnishtest/tests/m00001.vtc
index dd2b064..9f4a743 100644
--- a/bin/varnishtest/tests/m00001.vtc
+++ b/bin/varnishtest/tests/m00001.vtc
@@ -15,7 +15,7 @@ varnish v1 -arg "-pthread_pools=1" -vcl+backend {
}
} -start
-varnish v1 -cliok "param.set diag_bitmap 0x40000"
+varnish v1 -cliok "param.set debug +vclrel"
client c1 {
txreq -url "/bar"
diff --git a/bin/varnishtest/tests/p00005.vtc b/bin/varnishtest/tests/p00005.vtc
index b41ded3..e519cc1 100644
--- a/bin/varnishtest/tests/p00005.vtc
+++ b/bin/varnishtest/tests/p00005.vtc
@@ -8,7 +8,6 @@ server s1 {
} -start
varnish v1 \
- -arg "-pdiag_bitmap=0x30000" \
-storage "-spersistent,${tmpdir}/_.per,10m" \
-arg "-pban_lurker_sleep=0" \
-vcl+backend {
@@ -17,6 +16,9 @@ varnish v1 \
}
} -start
+varnish v1 -cliok "param.set debug +syncvsl"
+varnish v1 -cliok "param.set diag_bitmap 0x20000"
+
client c1 {
txreq -url "/foo"
rxresp
diff --git a/include/tbl/debug_bits.h b/include/tbl/debug_bits.h
index ece0fc4..72d298d 100644
--- a/include/tbl/debug_bits.h
+++ b/include/tbl/debug_bits.h
@@ -34,3 +34,6 @@ DEBUG_BIT(WORKSPACE, workspace, "", "VSL Workspace operations")
DEBUG_BIT(WAITER, waiter, "\t","VSL Waiter internals")
DEBUG_BIT(WAITINGLIST, waitinglist, "", "VSL Waitinglist events")
DEBUG_BIT(SYNCVSL, syncvsl, "\t","Make VSL synchronous")
+DEBUG_BIT(HASHEDGE, hashedge, "", "Edge cases in Hash")
+DEBUG_BIT(VCLREL, vclrel, "\t","Rapid VCL release")
+DEBUG_BIT(LURKER, lurker, "\t","VSL Ban lurker")
More information about the varnish-commit
mailing list