From 0802399ea35c73672bf936cfe81751cee5d6b8e0 Mon Sep 17 00:00:00 2001 From: phk Date: Thu, 29 Jun 2006 14:37:15 +0000 Subject: [PATCH] Tag objects with their origin session xid and log it when we clean up. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@266 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache.h | 1 + varnish-cache/bin/varnishd/cache_expire.c | 2 ++ varnish-cache/bin/varnishd/cache_fetch.c | 2 ++ varnish-cache/include/shmlog_tags.h | 2 ++ 4 files changed, 7 insertions(+) diff --git a/varnish-cache/bin/varnishd/cache.h b/varnish-cache/bin/varnishd/cache.h index 6ebdbfe7..797c3719 100644 --- a/varnish-cache/bin/varnishd/cache.h +++ b/varnish-cache/bin/varnishd/cache.h @@ -65,6 +65,7 @@ extern struct stevedore *stevedore; struct object { unsigned refcnt; + unsigned xid; struct objhead *objhead; pthread_cond_t cv; diff --git a/varnish-cache/bin/varnishd/cache_expire.c b/varnish-cache/bin/varnishd/cache_expire.c index d1f60095..c76b842a 100644 --- a/varnish-cache/bin/varnishd/cache_expire.c +++ b/varnish-cache/bin/varnishd/cache_expire.c @@ -52,6 +52,7 @@ exp_hangman(void *arg) } TAILQ_REMOVE(&exp_deathrow, o, deathrow); AZ(pthread_mutex_unlock(&exp_mtx)); + VSL(SLT_ExpKill, 0, "%u", o->xid); HSH_Deref(o); } } @@ -83,6 +84,7 @@ exp_prefetch(void *arg) } binheap_delete(exp_heap, 0); AZ(pthread_mutex_unlock(&exp_mtx)); + VSL(SLT_ExpPick, 0, "%u", o->xid); sp.vcl = GetVCL(); sp.obj = o; diff --git a/varnish-cache/bin/varnishd/cache_fetch.c b/varnish-cache/bin/varnishd/cache_fetch.c index a363e906..45c79371 100644 --- a/varnish-cache/bin/varnishd/cache_fetch.c +++ b/varnish-cache/bin/varnishd/cache_fetch.c @@ -245,6 +245,8 @@ FetchSession(struct worker *w, struct sess *sp) time_t t_req, t_resp; int body; + sp->obj->xid = sp->xid; + fd = VBE_GetFd(sp->backend, &fd_token, sp->xid); assert(fd != -1); VSL(SLT_Backend, sp->fd, "%d %s", fd, sp->backend->vcl_name); diff --git a/varnish-cache/include/shmlog_tags.h b/varnish-cache/include/shmlog_tags.h index bbe13c0c..884ac024 100644 --- a/varnish-cache/include/shmlog_tags.h +++ b/varnish-cache/include/shmlog_tags.h @@ -34,3 +34,5 @@ SLTM(BldHdr) SLTM(LostHeader) SLTM(VCL) SLTM(XID) +SLTM(ExpPick) +SLTM(ExpKill) -- 2.39.5