r3945 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Wed Mar 18 10:32:48 CET 2009


Author: phk
Date: 2009-03-18 10:32:48 +0100 (Wed, 18 Mar 2009)
New Revision: 3945

Modified:
   trunk/varnish-cache/bin/varnishd/cache_ban.c
   trunk/varnish-cache/bin/varnishd/storage_persistent.c
Log:
upd



Modified: trunk/varnish-cache/bin/varnishd/cache_ban.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_ban.c	2009-03-17 10:20:28 UTC (rev 3944)
+++ trunk/varnish-cache/bin/varnishd/cache_ban.c	2009-03-18 09:32:48 UTC (rev 3945)
@@ -484,7 +484,6 @@
 	*bb = NULL;
 	Lck_Lock(&ban_mtx);
 	b->refcount--;
-fprintf(stderr, "DEREF %p %u\n", b, b->refcount);
 	Lck_Unlock(&ban_mtx);
 }
 
@@ -501,7 +500,6 @@
 	b = VTAILQ_LAST(&ban_head, banhead);
 	AN(b);
 	b->refcount++;
-fprintf(stderr, "TAILREF %p %u\n", b, b->refcount);
 	return (b);
 }
 
@@ -515,14 +513,12 @@
 	struct ban *b;
 
 	VTAILQ_FOREACH(b, &ban_head, list) {
-fprintf(stderr, "REF...: %g %g %g (%s)\n", b->t0, t0, b->t0 - t0, b->test);
 		if (b == tail)
 			break;
 		if (b->t0 <= t0)
 			break;
 	}
 	AN(b);
-fprintf(stderr, "REF: %p %g %g %g\n", b, b->t0, t0, b->t0 - t0);
 	assert(b->t0 == t0);
 	Lck_Lock(&ban_mtx);
 	b->refcount++;
@@ -582,9 +578,7 @@
 
 	ASSERT_CLI();
 
-	fprintf(stderr, "BAN_MAGIC %u\n", ban_magic->refcount);
 	SMP_NewBan(ban_magic->t0, ban_magic->test);
-	fprintf(stderr, "BAN_MAGIC %u\n", ban_magic->refcount);
 	VTAILQ_FOREACH(b, &ban_head, list) {
 		if (!(b->flags & BAN_F_PENDING))
 			continue;
@@ -743,5 +737,4 @@
 	AN(ban_magic);
 	ban_magic->flags |= BAN_F_GONE;
 	BAN_Insert(ban_magic);
-	fprintf(stderr, "BAN_MAGIC %u\n", ban_magic->refcount);
 }

Modified: trunk/varnish-cache/bin/varnishd/storage_persistent.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_persistent.c	2009-03-17 10:20:28 UTC (rev 3944)
+++ trunk/varnish-cache/bin/varnishd/storage_persistent.c	2009-03-18 09:32:48 UTC (rev 3945)
@@ -161,17 +161,6 @@
 #define SIGN_END(ctx)	((void *)((int8_t *)SIGN_DATA(ctx) + (ctx)->ss->length))
 
 /*--------------------------------------------------------------------
- * debug
- */
-
-static void
-smp_dump_sign(struct smp_signctx *ctx)
-{
-	fprintf(stderr, "%p {%s %x %p %ju}\n", ctx, ctx->id, ctx->unique, ctx->ss, ctx->ss->length);
-}
-
-
-/*--------------------------------------------------------------------
  * Define a signature by location and identifier.
  */
 
@@ -186,7 +175,6 @@
 	ctx->ss = (void*)(sc->ptr + off);
 	ctx->unique = sc->unique;
 	ctx->id = id;
-fprintf(stderr, "DEF(%p %p %s)\n", ctx, ctx->ss, id);
 }
 
 /*--------------------------------------------------------------------
@@ -219,7 +207,8 @@
 	if (r) {
 		fprintf(stderr, "CHK(%p %p %s) = %d\n",
 		    ctx, ctx->ss, ctx->ss->ident, r);
-		smp_dump_sign(ctx);
+		fprintf(stderr, "%p {%s %x %p %ju}\n",
+		    ctx, ctx->id, ctx->unique, ctx->ss, ctx->ss->length);
 	}
 	return (r);
 }
@@ -453,17 +442,12 @@
 		ARGV_ERR("(-spersistent) failed to mmap (%s)\n",
 		    strerror(errno));
 
-	fprintf(stderr, "i = %d ms = %jd g = %u\n",
-	    i, (intmax_t)sc->mediasize, sc->granularity);
-
 	smp_def_sign(sc, &sc->idn, 0, "SILO");
 	sc->ident = SIGN_DATA(&sc->idn);
 
 	i = smp_valid_silo(sc);
-	fprintf(stderr, "Silo: %d\n", i);
 	if (i)
 		smp_newsilo(sc);
-	fprintf(stderr, "Silo: %d\n", smp_valid_silo(sc));
 	AZ(smp_valid_silo(sc));
 
 	parent->priv = sc;
@@ -499,7 +483,6 @@
 		ss->length = sg->length;
 		ss++;
 		length += sizeof *ss;
-fprintf(stderr, "WR SEG %jx %jx\n", sg->offset, sg->length);
 	}
 	smp_append_sign(ctx, SIGN_DATA(ctx), length);
 	smp_sync_sign(ctx);
@@ -523,11 +506,10 @@
 	struct smp_seg *sg;
 	struct smp_object *so;
 
+	(void)sp;
 	sg = oc->smp_seg;
 	CHECK_OBJ_NOTNULL(sg, SMP_SEG_MAGIC);
 
-fprintf(stderr, "Fixup %p %p\n", sp, oc);
-
 	so = (void*)oc->obj;
 	oc->obj = so->ptr;
 
@@ -543,7 +525,6 @@
 	oc->obj->objcore = oc;
 	oc->obj->objhead = oh;
 	oc->obj->ban = oc->ban;
-fprintf(stderr, "OBJ FIX: %p ban %p\n", oc->obj, oc->obj->ban);
 
 	sg->nfixed++;
 }
@@ -639,14 +620,11 @@
 			break;
 		}
 
-fprintf(stderr, "BAN {%g %u %u \"%s\"}\n", t0, flags, length, ptr);
 		BAN_Reload(t0, flags, (const char *)ptr);
 
 		ptr += length;
 	}
 	assert(ptr <= pe);
-	if (retval)
-fprintf(stderr, "BAN read failed: %d\n", retval);
 	return (retval);
 }
 
@@ -684,7 +662,6 @@
 	CHECK_OBJ_NOTNULL(sg, SMP_SEG_MAGIC);
 	CHECK_OBJ_NOTNULL(sg->sc, SMP_SC_MAGIC);
 
-fprintf(stderr, "OBJ CHG %p ban %10.9f\n", o, t);
 	o->smp_object->ban = t;
 }
 
@@ -735,29 +712,22 @@
 		return;
 	ptr = SIGN_DATA(ctx);
 	length = ctx->ss->length;
-	fprintf(stderr, "Load Seg %p %jx\n", ptr, length);
 	ss = ptr;
-	fprintf(stderr, "Objlist %jx Nalloc %u\n", ss->objlist, ss->nalloc);
 	so = (void*)(sc->ptr + ss->objlist);
 	no = ss->nalloc;
 	for (;no > 0; so++,no--) {
-fprintf(stderr, "TTL: %g %g (%g)\n", so->ttl, t_now, so->ttl - t_now);
 		if (so->ttl < t_now)
 			continue;
-		fprintf(stderr, "OBJ %p dTTL: %g PTR %p\n",
-		    so, so->ttl - t_now, so->ptr);
 		HSH_Prealloc(sp);
 		sp->wrk->nobjcore->flags |= OC_F_PERSISTENT;
 		sp->wrk->nobjcore->flags &= ~OC_F_BUSY;
 		sp->wrk->nobjcore->obj = (void*)so;
 		sp->wrk->nobjcore->smp_seg = sg;
 		sp->wrk->nobjcore->ban = BAN_RefBan(so->ban, sc->tailban);
-fprintf(stderr, "OBJ LOAD: %p ban %10.9f %p\n", so->ptr, so->ban, sp->wrk->nobjcore->ban);
 		memcpy(sp->wrk->nobjhead->digest, so->hash, SHA256_LEN);
 		(void)HSH_Insert(sp);
 		sg->nalloc++;
 	}
-fprintf(stderr, "Got %u objects in seg %p\n", sg->nalloc, sg);
 }
 
 /*--------------------------------------------------------------------
@@ -789,7 +759,6 @@
 		/* XXX: check that they are serial */
 		sg->sc = sc;
 		VTAILQ_INSERT_TAIL(&sc->segments, sg, list);
-fprintf(stderr, "RD SEG %jx %jx\n", sg->offset, sg->length);
 	}
 	return (0);
 }
@@ -825,7 +794,6 @@
 	assert(sg->offset + sg->length <= sc->mediasize);
 
 	VTAILQ_INSERT_TAIL(&sc->segments, sg, list);
-fprintf(stderr, "MK SEG %jx %jx\n", sg->offset, sg->length);
 
 	/* Neuter the new segment in case there is an old one there */
 	AN(sg->offset);
@@ -858,7 +826,6 @@
 
 	(void)sc;
 	/* XXX: if segment is empty, delete instead */
-fprintf(stderr, "Close seg %p na = %jx\n", sg, sg->next_addr);
 	/* Copy the objects into the segment */
 	memcpy(sc->ptr + sg->next_addr,
 	    sg->objs, sizeof *sg->objs * sg->nalloc);
@@ -918,7 +885,6 @@
 	ASSERT_CLI();
 
 	CAST_OBJ_NOTNULL(sc, st->priv, SMP_SC_MAGIC);
-fprintf(stderr, "Open Silo(%p)\n", st);
 
 	Lck_New(&sc->mtx);
 
@@ -960,7 +926,6 @@
 	ASSERT_CLI();
 
 	CAST_OBJ_NOTNULL(sc, st->priv, SMP_SC_MAGIC);
-fprintf(stderr, "Close Silo(%p)\n", st);
 	smp_close_seg(sc, sc->cur_seg);
 
 	/* XXX: reap thread */
@@ -991,7 +956,6 @@
 	so->ban = sp->obj->ban_t;
 	Lck_Unlock(&sc->mtx);
 
-fprintf(stderr, "Object(%p %p)\n", sp, sp->obj);
 }
 
 /*--------------------------------------------------------------------
@@ -1036,7 +1000,6 @@
 	struct smp_seg *sg;
 	const char z[4] = { 0, 0, 0, 0};
 
-fprintf(stderr, "Trim(%p %zu)\n", ss, size);
 	CAST_OBJ_NOTNULL(sc, ss->priv, SMP_SC_MAGIC);
 
 	/* We want 16 bytes alignment */



More information about the varnish-commit mailing list