r4929 - in trunk/varnish-cache: bin/varnishd bin/varnishhist bin/varnishlog bin/varnishncsa bin/varnishsizes bin/varnishstat bin/varnishtest bin/varnishtop include lib/libvarnishapi

phk at varnish-cache.org phk at varnish-cache.org
Tue Jun 8 11:46:28 CEST 2010


Author: phk
Date: 2010-06-08 11:46:28 +0200 (Tue, 08 Jun 2010)
New Revision: 4929

Added:
   trunk/varnish-cache/include/vsc.h
   trunk/varnish-cache/include/vsl.h
   trunk/varnish-cache/include/vsl_tags.h
Removed:
   trunk/varnish-cache/include/shmlog.h
   trunk/varnish-cache/include/shmlog_tags.h
   trunk/varnish-cache/include/stats.h
Modified:
   trunk/varnish-cache/bin/varnishd/acct_fields.h
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_acceptor.c
   trunk/varnish-cache/bin/varnishd/cache_backend.c
   trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c
   trunk/varnish-cache/bin/varnishd/cache_backend_poll.c
   trunk/varnish-cache/bin/varnishd/cache_ban.c
   trunk/varnish-cache/bin/varnishd/cache_center.c
   trunk/varnish-cache/bin/varnishd/cache_cli.c
   trunk/varnish-cache/bin/varnishd/cache_dir_random.c
   trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c
   trunk/varnish-cache/bin/varnishd/cache_esi.c
   trunk/varnish-cache/bin/varnishd/cache_expire.c
   trunk/varnish-cache/bin/varnishd/cache_fetch.c
   trunk/varnish-cache/bin/varnishd/cache_hash.c
   trunk/varnish-cache/bin/varnishd/cache_http.c
   trunk/varnish-cache/bin/varnishd/cache_httpconn.c
   trunk/varnish-cache/bin/varnishd/cache_lck.c
   trunk/varnish-cache/bin/varnishd/cache_main.c
   trunk/varnish-cache/bin/varnishd/cache_panic.c
   trunk/varnish-cache/bin/varnishd/cache_pipe.c
   trunk/varnish-cache/bin/varnishd/cache_pool.c
   trunk/varnish-cache/bin/varnishd/cache_response.c
   trunk/varnish-cache/bin/varnishd/cache_session.c
   trunk/varnish-cache/bin/varnishd/cache_shmlog.c
   trunk/varnish-cache/bin/varnishd/cache_vcl.c
   trunk/varnish-cache/bin/varnishd/cache_vrt.c
   trunk/varnish-cache/bin/varnishd/cache_vrt_re.c
   trunk/varnish-cache/bin/varnishd/cache_waiter_epoll.c
   trunk/varnish-cache/bin/varnishd/cache_waiter_kqueue.c
   trunk/varnish-cache/bin/varnishd/cache_waiter_poll.c
   trunk/varnish-cache/bin/varnishd/cache_waiter_ports.c
   trunk/varnish-cache/bin/varnishd/cache_wrw.c
   trunk/varnish-cache/bin/varnishd/cache_ws.c
   trunk/varnish-cache/bin/varnishd/common.h
   trunk/varnish-cache/bin/varnishd/hash_classic.c
   trunk/varnish-cache/bin/varnishd/hash_critbit.c
   trunk/varnish-cache/bin/varnishd/hash_simple_list.c
   trunk/varnish-cache/bin/varnishd/mgt_cli.c
   trunk/varnish-cache/bin/varnishd/mgt_shmem.c
   trunk/varnish-cache/bin/varnishd/rfc2616.c
   trunk/varnish-cache/bin/varnishd/storage_file.c
   trunk/varnish-cache/bin/varnishd/storage_malloc.c
   trunk/varnish-cache/bin/varnishd/storage_persistent.c
   trunk/varnish-cache/bin/varnishd/storage_synth.c
   trunk/varnish-cache/bin/varnishd/storage_umem.c
   trunk/varnish-cache/bin/varnishhist/varnishhist.c
   trunk/varnish-cache/bin/varnishlog/varnishlog.c
   trunk/varnish-cache/bin/varnishncsa/varnishncsa.c
   trunk/varnish-cache/bin/varnishsizes/varnishsizes.c
   trunk/varnish-cache/bin/varnishstat/varnishstat.c
   trunk/varnish-cache/bin/varnishstat/varnishstat.h
   trunk/varnish-cache/bin/varnishstat/varnishstat_curses.c
   trunk/varnish-cache/bin/varnishtest/vtc_varnish.c
   trunk/varnish-cache/bin/varnishtop/varnishtop.c
   trunk/varnish-cache/include/Makefile.am
   trunk/varnish-cache/include/varnishapi.h
   trunk/varnish-cache/lib/libvarnishapi/vsl_log.c
   trunk/varnish-cache/lib/libvarnishapi/vsl_stat.c
Log:
Split and rename shmlog.h to vsl.h and vsc.h



Modified: trunk/varnish-cache/bin/varnishd/acct_fields.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/acct_fields.h	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/acct_fields.h	2010-06-08 09:46:28 UTC (rev 4929)
@@ -30,7 +30,7 @@
  *
  * These are the stats we keep track of per session.  They will be summed,
  * via the sp->wrk->stats into the s_<name> fields in the SHM file.
- * NB: Remember to mark those in stat_field.h to be included in struct dstat.
+ * NB: Remember to mark those in vsc_fields.h to be included in struct dstat.
  */
 
 ACCT(sess)

Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2010-06-08 09:46:28 UTC (rev 4929)
@@ -62,6 +62,9 @@
 #include "heritage.h"
 #include "miniobj.h"
 
+#include "vsc.h"
+#include "vsl.h"
+
 enum {
 	/* Fields from the first line of HTTP proto */
 	HTTP_HDR_REQ,
@@ -193,7 +196,7 @@
 #define L1(n)			int n;
 #define MAC_STAT(n, t, l, f, e)	L##l(n)
 struct dstat {
-#include "stat_field.h"
+#include "vsc_fields.h"
 };
 #undef MAC_STAT
 #undef L0

Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_acceptor.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_acceptor.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -46,7 +46,6 @@
 
 #include "cli.h"
 #include "cli_priv.h"
-#include "shmlog.h"
 #include "cache.h"
 #include "cache_waiter.h"
 

Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -44,7 +44,6 @@
 
 #include <sys/socket.h>
 
-#include "shmlog.h"
 #include "cache.h"
 #include "cache_backend.h"
 #include "vrt.h"

Modified: trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -43,7 +43,6 @@
 
 #include <sys/socket.h>
 
-#include "shmlog.h"
 #include "cache.h"
 #include "vrt.h"
 #include "vsha256.h"

Modified: trunk/varnish-cache/bin/varnishd/cache_backend_poll.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend_poll.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_backend_poll.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -49,7 +49,6 @@
 
 #include <sys/socket.h>
 
-#include "shmlog.h"
 #include "cli_priv.h"
 #include "cache.h"
 #include "vrt.h"

Modified: trunk/varnish-cache/bin/varnishd/cache_ban.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_ban.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_ban.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -51,7 +51,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "shmlog.h"
 #include "cli.h"
 #include "cli_priv.h"
 #include "cache.h"

Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -72,7 +72,6 @@
 #include "compat/srandomdev.h"
 #endif
 
-#include "shmlog.h"
 #include "vcl.h"
 #include "cli_priv.h"
 #include "cache.h"

Modified: trunk/varnish-cache/bin/varnishd/cache_cli.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_cli.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_cli.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -46,7 +46,6 @@
 #include <unistd.h>
 #include <poll.h>
 
-#include "shmlog.h"
 #include "cli.h"
 #include "cli_priv.h"
 #include "cli_common.h"
@@ -137,7 +136,7 @@
 	SZOF(struct objhead);
 	SZOF(struct sess);
 	SZOF(struct vbe_conn);
-	SZOF(struct varnish_stats);
+	SZOF(struct vsc_main);
 	SZOF(struct lock);
 }
 

Modified: trunk/varnish-cache/bin/varnishd/cache_dir_random.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_dir_random.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_dir_random.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -53,7 +53,6 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "shmlog.h"
 #include "cache.h"
 #include "cache_backend.h"
 #include "vrt.h"

Modified: trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -40,7 +40,6 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "shmlog.h"
 #include "cache.h"
 #include "cache_backend.h"
 #include "vrt.h"

Modified: trunk/varnish-cache/bin/varnishd/cache_esi.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_esi.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_esi.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -50,7 +50,6 @@
 #include <stdlib.h>
 #include <stdarg.h>
 
-#include "shmlog.h"
 #include "vrt.h"
 #include "vcl.h"
 #include "vct.h"

Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_expire.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_expire.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -48,7 +48,6 @@
 #include <string.h>
 #include <math.h>
 
-#include "shmlog.h"
 #include "binary_heap.h"
 #include "cache.h"
 #include "vcl.h"

Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_fetch.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_fetch.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -38,7 +38,6 @@
 #include <stdlib.h>
 #include <fcntl.h>
 
-#include "shmlog.h"
 #include "cache.h"
 #include "stevedore.h"
 #include "cli_priv.h"
@@ -380,7 +379,7 @@
 		return (__LINE__);
 	}
 
-	/* Checkpoint the shmlog here */
+	/* Checkpoint the vsl.here */
 	WSL_Flush(w, 0);
 
 	/* XXX is this the right place? */

Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_hash.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_hash.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -63,7 +63,6 @@
 #include <sys/types.h>
 #include <fcntl.h>
 
-#include "shmlog.h"
 #include "cache.h"
 #include "stevedore.h"
 #include "hash_slinger.h"

Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -41,7 +41,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "shmlog.h"
 #include "vct.h"
 #include "cache.h"
 

Modified: trunk/varnish-cache/bin/varnishd/cache_httpconn.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_httpconn.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_httpconn.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -40,7 +40,6 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "shmlog.h"
 #include "cache.h"
 
 /*--------------------------------------------------------------------

Modified: trunk/varnish-cache/bin/varnishd/cache_lck.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_lck.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_lck.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -46,7 +46,6 @@
 #endif
 #include <stdlib.h>
 
-#include "shmlog.h"
 #include "cache.h"
 
 /*The constability of lck depends on platform pthreads implementation */

Modified: trunk/varnish-cache/bin/varnishd/cache_main.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_main.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_main.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -37,7 +37,6 @@
 #include <stdlib.h>
 #include <signal.h>
 
-#include "shmlog.h"
 #include "cache.h"
 #include "stevedore.h"
 #include "hash_slinger.h"

Modified: trunk/varnish-cache/bin/varnishd/cache_panic.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_panic.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_panic.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -45,7 +45,6 @@
 #endif
 #include "cache.h"
 #include "vsm.h"
-#include "shmlog.h"
 #include "cache_backend.h"
 #include "vcl.h"
 #include "libvcl.h"

Modified: trunk/varnish-cache/bin/varnishd/cache_pipe.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pipe.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_pipe.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -41,7 +41,6 @@
 #include <stdlib.h>
 #include <sys/socket.h>
 
-#include "shmlog.h"
 #include "cache.h"
 
 static int

Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pool.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_pool.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -54,7 +54,6 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "shmlog.h"
 #include "vcl.h"
 #include "cli_priv.h"
 #include "cache.h"
@@ -98,7 +97,7 @@
 #define L0(n)
 #define L1(n) (VSL_stats->n += w->stats.n)
 #define MAC_STAT(n, t, l, f, d) L##l(n);
-#include "stat_field.h"
+#include "vsc_fields.h"
 #undef MAC_STAT
 #undef L0
 #undef L1
@@ -361,7 +360,7 @@
  */
 
 static void
-wrk_decimate_flock(struct wq *qp, double t_idle, struct varnish_stats *vs)
+wrk_decimate_flock(struct wq *qp, double t_idle, struct vsc_main *vs)
 {
 	struct worker *w = NULL;
 
@@ -403,7 +402,7 @@
 {
 	volatile unsigned u;
 	double t_idle;
-	struct varnish_stats vsm, *vs;
+	struct vsc_main vsm, *vs;
 	int errno_is_multi_threaded;
 
 	THR_SetName("wrk_herdtimer");

Modified: trunk/varnish-cache/bin/varnishd/cache_response.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_response.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_response.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -38,7 +38,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "shmlog.h"
 #include "cache.h"
 #include "vct.h"
 

Modified: trunk/varnish-cache/bin/varnishd/cache_session.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_session.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_session.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -49,7 +49,6 @@
 #include <sys/uio.h>
 #include <sys/socket.h>
 
-#include "shmlog.h"
 #include "cache.h"
 #include "cache_backend.h"
 

Modified: trunk/varnish-cache/bin/varnishd/cache_shmlog.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_shmlog.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_shmlog.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -37,7 +37,6 @@
 #include <stdarg.h>
 
 #include "vsm.h"
-#include "shmlog.h"
 #include "cache.h"
 #include "vmb.h"
 

Modified: trunk/varnish-cache/bin/varnishd/cache_vcl.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vcl.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_vcl.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -44,7 +44,6 @@
 
 #include "cli.h"
 #include "cli_priv.h"
-#include "shmlog.h"
 #include "vcl.h"
 #include "cache.h"
 #include "libvcl.h"

Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -46,7 +46,6 @@
 #include <stdlib.h>
 #include <stdarg.h>
 
-#include "shmlog.h"
 #include "vrt.h"
 #include "vrt_obj.h"
 #include "vcl.h"

Modified: trunk/varnish-cache/bin/varnishd/cache_vrt_re.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt_re.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt_re.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -41,7 +41,6 @@
 #include <ctype.h>
 #include <stdlib.h>
 
-#include "shmlog.h"
 #include "vrt.h"
 #include "vre.h"
 #include "vcl.h"

Modified: trunk/varnish-cache/bin/varnishd/cache_waiter_epoll.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_waiter_epoll.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_waiter_epoll.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -51,7 +51,6 @@
 #  define EPOLLRDHUP 0
 #endif
 
-#include "shmlog.h"
 #include "cache.h"
 #include "cache_waiter.h"
 

Modified: trunk/varnish-cache/bin/varnishd/cache_waiter_kqueue.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_waiter_kqueue.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_waiter_kqueue.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -47,7 +47,6 @@
 
 #include <sys/event.h>
 
-#include "shmlog.h"
 #include "cache.h"
 #include "cache_waiter.h"
 

Modified: trunk/varnish-cache/bin/varnishd/cache_waiter_poll.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_waiter_poll.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_waiter_poll.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -40,7 +40,6 @@
 #include <unistd.h>
 #include <poll.h>
 
-#include "shmlog.h"
 #include "cache.h"
 #include "cache_waiter.h"
 

Modified: trunk/varnish-cache/bin/varnishd/cache_waiter_ports.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_waiter_ports.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_waiter_ports.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -49,7 +49,6 @@
 #include "compat/clock_gettime.h"
 #endif
 
-#include "shmlog.h"
 #include "cache.h"
 #include "cache_waiter.h"
 

Modified: trunk/varnish-cache/bin/varnishd/cache_wrw.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_wrw.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_wrw.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -60,7 +60,6 @@
 #endif
 #endif /* SENDFILE_WORKS */
 
-#include "shmlog.h"
 #include "cache.h"
 
 /*--------------------------------------------------------------------

Modified: trunk/varnish-cache/bin/varnishd/cache_ws.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_ws.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/cache_ws.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -42,7 +42,6 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "shmlog.h"
 #include "vcl.h"
 #include "cli_priv.h"
 #include "cache.h"

Modified: trunk/varnish-cache/bin/varnishd/common.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/common.h	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/common.h	2010-06-08 09:46:28 UTC (rev 4929)
@@ -40,7 +40,7 @@
 
 /* mgt_shmem.c */
 void *mgt_SHM_Alloc(unsigned size, const char *class, const char *type, const char *ident);
-extern struct varnish_stats *VSL_stats;
+extern struct vsc_main *VSL_stats;
 extern struct vsm_head *loghead;
 extern uint32_t			*vsl_log_start;
 extern uint32_t			*vsl_log_end;

Modified: trunk/varnish-cache/bin/varnishd/hash_classic.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/hash_classic.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/hash_classic.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -39,7 +39,6 @@
 #include <string.h>
 #include <sys/types.h>
 
-#include "shmlog.h"
 #include "cache.h"
 #include "hash_slinger.h"
 

Modified: trunk/varnish-cache/bin/varnishd/hash_critbit.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/hash_critbit.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/hash_critbit.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -39,7 +39,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "shmlog.h"
 #include "cache.h"
 #include "hash_slinger.h"
 #include "cli_priv.h"

Modified: trunk/varnish-cache/bin/varnishd/hash_simple_list.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/hash_simple_list.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/hash_simple_list.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -38,7 +38,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "shmlog.h"
 #include "cache.h"
 #include "hash_slinger.h"
 

Modified: trunk/varnish-cache/bin/varnishd/mgt_cli.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_cli.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/mgt_cli.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -55,7 +55,7 @@
 #include "cli_common.h"
 #include "cli_serve.h"
 #include "vev.h"
-#include "shmlog.h"
+#include "vsc.h"
 #include "vlu.h"
 #include "vss.h"
 
@@ -84,7 +84,7 @@
 #define MAC_STAT(n, t, l, f, d) \
 	if (VSL_stats->n != 0) \
 	    cli_out(cli, "%12ju  %s\n", (VSL_stats->n), d);
-#include "stat_field.h"
+#include "vsc_fields.h"
 #undef MAC_STAT
 }
 

Modified: trunk/varnish-cache/bin/varnishd/mgt_shmem.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_shmem.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/mgt_shmem.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -42,7 +42,8 @@
 #include <sys/stat.h>
 
 #include "vsm.h"
-#include "shmlog.h"
+#include "vsc.h"
+#include "vsl.h"
 #include "mgt.h"
 #include "heritage.h"
 #include "vmb.h"
@@ -55,7 +56,7 @@
 #define MAP_NOSYNC 0 /* XXX Linux */
 #endif
 
-struct varnish_stats	*VSL_stats;
+struct vsc_main	*VSL_stats;
 struct vsm_head	*loghead;
 uint32_t		*vsl_log_start;
 uint32_t		*vsl_log_end;
@@ -284,7 +285,7 @@
 	VWMB();
 
 	VSL_stats = mgt_SHM_Alloc(sizeof *VSL_stats,
-	    VSM_CLASS_STAT, VSL_TYPE_STAT, "");
+	    VSC_CLASS, VSC_TYPE_MAIN, "");
 	AN(VSL_stats);
 
 	pp = mgt_SHM_Alloc(sizeof *pp, "Params", "", "");

Modified: trunk/varnish-cache/bin/varnishd/rfc2616.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/rfc2616.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/rfc2616.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -39,7 +39,6 @@
 #include <limits.h>
 #include <math.h>
 
-#include "shmlog.h"
 #include "cache.h"
 
 

Modified: trunk/varnish-cache/bin/varnishd/storage_file.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_file.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/storage_file.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -46,7 +46,6 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "shmlog.h"
 #include "cache.h"
 #include "stevedore.h"
 

Modified: trunk/varnish-cache/bin/varnishd/storage_malloc.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_malloc.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/storage_malloc.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -39,7 +39,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "shmlog.h"
 #include "cache.h"
 #include "stevedore.h"
 
@@ -48,7 +47,7 @@
 #define SMA_SC_MAGIC		0x1ac8a345
 	struct lock		sma_mtx;
 	size_t			sma_max;
-	struct varnish_stats_sma *stats;
+	struct vsc_sma *stats;
 };
 
 struct sma {
@@ -189,7 +188,7 @@
 
 	CAST_OBJ_NOTNULL(sma_sc, st->priv, SMA_SC_MAGIC);
 	sma_sc->stats = mgt_SHM_Alloc(sizeof *sma_sc->stats,
-	    VSM_CLASS_STAT, VSL_TYPE_STAT_SMA, st->ident);
+	    VSC_CLASS, VSC_TYPE_SMA, st->ident);
 	memset(sma_sc->stats, 0, sizeof *sma_sc->stats);
 }
 

Modified: trunk/varnish-cache/bin/varnishd/storage_persistent.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_persistent.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/storage_persistent.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -46,7 +46,6 @@
 #include <sys/param.h>
 #include <sys/mman.h>
 
-#include "shmlog.h"
 #include "cache.h"
 #include "stevedore.h"
 #include "hash_slinger.h"

Modified: trunk/varnish-cache/bin/varnishd/storage_synth.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_synth.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/storage_synth.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -39,7 +39,6 @@
 #include <stdlib.h>
 #include <pthread.h>
 
-#include "shmlog.h"
 #include "cache.h"
 #include "vsb.h"
 #include "stevedore.h"

Modified: trunk/varnish-cache/bin/varnishd/storage_umem.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_umem.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishd/storage_umem.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -45,7 +45,6 @@
 #include <umem.h>
 
 #include "config.h"
-#include "shmlog.h"
 #include "cache.h"
 #include "stevedore.h"
 

Modified: trunk/varnish-cache/bin/varnishhist/varnishhist.c
===================================================================
--- trunk/varnish-cache/bin/varnishhist/varnishhist.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishhist/varnishhist.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -49,7 +49,7 @@
 #include <unistd.h>
 
 #include "libvarnish.h"
-#include "shmlog.h"
+#include "vsl.h"
 #include "varnishapi.h"
 
 #define HIST_N 2000 /* how far back we remember */

Modified: trunk/varnish-cache/bin/varnishlog/varnishlog.c
===================================================================
--- trunk/varnish-cache/bin/varnishlog/varnishlog.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishlog/varnishlog.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -49,7 +49,7 @@
 #include "vpf.h"
 
 #include "libvarnish.h"
-#include "shmlog.h"
+#include "vsl.h"
 #include "vre.h"
 #include "varnishapi.h"
 

Modified: trunk/varnish-cache/bin/varnishncsa/varnishncsa.c
===================================================================
--- trunk/varnish-cache/bin/varnishncsa/varnishncsa.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishncsa/varnishncsa.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -78,7 +78,7 @@
 #include "vpf.h"
 
 #include "libvarnish.h"
-#include "shmlog.h"
+#include "vsl.h"
 #include "varnishapi.h"
 
 static volatile sig_atomic_t reopen;

Modified: trunk/varnish-cache/bin/varnishsizes/varnishsizes.c
===================================================================
--- trunk/varnish-cache/bin/varnishsizes/varnishsizes.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishsizes/varnishsizes.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -49,7 +49,7 @@
 #include <unistd.h>
 
 #include "libvarnish.h"
-#include "shmlog.h"
+#include "vsl.h"
 #include "varnishapi.h"
 
 #define HIST_N 2000 /* how far back we remember */

Modified: trunk/varnish-cache/bin/varnishstat/varnishstat.c
===================================================================
--- trunk/varnish-cache/bin/varnishstat/varnishstat.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishstat/varnishstat.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -45,7 +45,7 @@
 #include <unistd.h>
 
 #include "libvarnish.h"
-#include "shmlog.h"
+#include "vsc.h"
 #include "varnishapi.h"
 #include "varnishstat.h"
 
@@ -121,7 +121,7 @@
 }
 
 static void
-do_once(const struct VSL_data *vd, const struct varnish_stats *VSL_stats)
+do_once(const struct VSL_data *vd, const struct vsc_main *VSL_stats)
 {
 	struct once_priv op;
 
@@ -193,7 +193,7 @@
 {
 	int c;
 	struct VSL_data *vd;
-	const struct varnish_stats *VSL_stats;
+	const struct vsc_main *VSL_stats;
 	int delay = 1, once = 0, xml = 0;
 
 	vd = VSL_New();

Modified: trunk/varnish-cache/bin/varnishstat/varnishstat.h
===================================================================
--- trunk/varnish-cache/bin/varnishstat/varnishstat.h	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishstat/varnishstat.h	2010-06-08 09:46:28 UTC (rev 4929)
@@ -27,4 +27,4 @@
  *
  */
 
-void do_curses(struct VSL_data *vd, const struct varnish_stats *VSL_stats, int delay);
+void do_curses(struct VSL_data *vd, const struct vsc_main *VSL_stats, int delay);

Modified: trunk/varnish-cache/bin/varnishstat/varnishstat_curses.c
===================================================================
--- trunk/varnish-cache/bin/varnishstat/varnishstat_curses.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishstat/varnishstat_curses.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -47,7 +47,7 @@
 #include <unistd.h>
 
 #include "libvarnish.h"
-#include "shmlog.h"
+#include "vsc.h"
 #include "vqueue.h"
 #include "varnishapi.h"
 #include "varnishstat.h"
@@ -123,7 +123,7 @@
 }
 
 void
-do_curses(struct VSL_data *vd, const struct varnish_stats *VSL_stats,
+do_curses(struct VSL_data *vd, const struct vsc_main *VSL_stats,
     int delay)
 {
 	intmax_t ju;

Modified: trunk/varnish-cache/bin/varnishtest/vtc_varnish.c
===================================================================
--- trunk/varnish-cache/bin/varnishtest/vtc_varnish.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishtest/vtc_varnish.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -67,7 +67,7 @@
 	struct vtclog		*vl1;
 	VTAILQ_ENTRY(varnish)	list;
 
-	struct varnish_stats	*stats;
+	struct vsc_main	*stats;
 
 	struct vsb		*storage;
 

Modified: trunk/varnish-cache/bin/varnishtop/varnishtop.c
===================================================================
--- trunk/varnish-cache/bin/varnishtop/varnishtop.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/bin/varnishtop/varnishtop.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -51,7 +51,7 @@
 #include "vsb.h"
 
 #include "libvarnish.h"
-#include "shmlog.h"
+#include "vsl.h"
 #include "varnishapi.h"
 
 #define AC(x) assert((x) != ERR)

Modified: trunk/varnish-cache/include/Makefile.am
===================================================================
--- trunk/varnish-cache/include/Makefile.am	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/include/Makefile.am	2010-06-08 09:46:28 UTC (rev 4929)
@@ -2,10 +2,10 @@
 
 pkginclude_HEADERS = \
 	vsm.h \
-	shmlog.h \
-	shmlog_tags.h \
-	stat_field.h \
-	stats.h \
+	vsl.h \
+	vsl_tags.h \
+	vsc_fields.h \
+	vsc.h \
 	varnishapi.h
 
 nobase_noinst_HEADERS = \

Deleted: trunk/varnish-cache/include/shmlog.h
===================================================================
--- trunk/varnish-cache/include/shmlog.h	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/include/shmlog.h	2010-06-08 09:46:28 UTC (rev 4929)
@@ -1,80 +0,0 @@
-/*-
- * Copyright (c) 2006 Verdens Gang AS
- * Copyright (c) 2006-2009 Linpro AS
- * All rights reserved.
- *
- * Author: Poul-Henning Kamp <phk at phk.freebsd.dk>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Define the layout of the shared memory log segment.
- *
- * NB: THIS IS NOT A PUBLIC API TO VARNISH!
- */
-
-#ifndef SHMLOG_H_INCLUDED
-#define SHMLOG_H_INCLUDED
-
-#include "stats.h"
-
-#define VSM_CLASS_LOG		"Log"
-#define VSM_CLASS_STAT		"Stat"
-
-/*
- * Shared memory log format
- *
- * The log is structured as an array of 32bit unsigned integers.
- *
- * The first integer contains a non-zero serial number, which changes
- * whenever writing the log starts from the front.
- *
- * Each logrecord consist of:
- *	[n]		= ((type & 0xff) << 24) | (length & 0xffff)
- *	[n + 1]		= identifier
- *	[n + 2] ... [m]	= content
- */
-
-#define VSL_WORDS(len)		(((len) + 3) / 4)
-#define VSL_END(ptr, len)	((ptr) + 2 + VSL_WORDS(len))
-#define VSL_NEXT(ptr)		VSL_END(ptr, VSL_LEN(ptr))
-#define VSL_LEN(ptr)		((ptr)[0] & 0xffff)
-#define VSL_TAG(ptr)		((ptr)[0] >> 24)
-#define VSL_ID(ptr)		((ptr)[1])
-#define VSL_DATA(ptr)		((char*)((ptr)+2))
-
-#define VSL_ENDMARKER	(((uint32_t)SLT_Reserved << 24) | 0x454545) /* "EEE" */
-#define VSL_WRAPMARKER	(((uint32_t)SLT_Reserved << 24) | 0x575757) /* "WWW" */
-
-/*
- * The identifiers in shmlogtag are "SLT_" + XML tag.  A script may be run
- * on this file to extract the table rather than handcode it
- */
-enum shmlogtag {
-#define SLTM(foo)	SLT_##foo,
-#include "shmlog_tags.h"
-#undef SLTM
-	SLT_Reserved = 255
-};
-
-#endif

Deleted: trunk/varnish-cache/include/shmlog_tags.h
===================================================================
--- trunk/varnish-cache/include/shmlog_tags.h	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/include/shmlog_tags.h	2010-06-08 09:46:28 UTC (rev 4929)
@@ -1,98 +0,0 @@
-/*-
- * Copyright (c) 2006 Verdens Gang AS
- * Copyright (c) 2006-2009 Linpro AS
- * All rights reserved.
- *
- * Author: Poul-Henning Kamp <phk at phk.freebsd.dk>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- *
- * Define the tags in the shared memory in a reusable format.
- * Whoever includes this get to define what the SLTM macro does.
- *
- * REMEMBER to update the documentation (especially the varnishlog(1) man
- * page) whenever this list changes.
- *
- * XXX: Please add new entries a the end to not break saved log-segments.
- * XXX: we can resort them when we have a major release.
- */
-
-SLTM(Debug)
-SLTM(Error)
-SLTM(CLI)
-SLTM(StatSess)
-SLTM(ReqEnd)
-SLTM(SessionOpen)
-SLTM(SessionClose)
-SLTM(BackendOpen)
-SLTM(BackendXID)
-SLTM(BackendReuse)
-SLTM(BackendClose)
-SLTM(HttpGarbage)
-SLTM(Backend)
-SLTM(Length)
-
-SLTM(FetchError)
-
-SLTM(RxRequest)
-SLTM(RxResponse)
-SLTM(RxStatus)
-SLTM(RxURL)
-SLTM(RxProtocol)
-SLTM(RxHeader)
-
-SLTM(TxRequest)
-SLTM(TxResponse)
-SLTM(TxStatus)
-SLTM(TxURL)
-SLTM(TxProtocol)
-SLTM(TxHeader)
-
-SLTM(ObjRequest)
-SLTM(ObjResponse)
-SLTM(ObjStatus)
-SLTM(ObjURL)
-SLTM(ObjProtocol)
-SLTM(ObjHeader)
-
-SLTM(LostHeader)
-
-SLTM(TTL)
-SLTM(VCL_acl)
-SLTM(VCL_call)
-SLTM(VCL_trace)
-SLTM(VCL_return)
-SLTM(VCL_error)
-SLTM(ReqStart)
-SLTM(Hit)
-SLTM(HitPass)
-SLTM(ExpBan)
-SLTM(ExpKill)
-SLTM(WorkThread)
-
-SLTM(ESI_xmlerror)
-
-SLTM(Hash)
-
-SLTM(Backend_health)

Deleted: trunk/varnish-cache/include/stats.h
===================================================================
--- trunk/varnish-cache/include/stats.h	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/include/stats.h	2010-06-08 09:46:28 UTC (rev 4929)
@@ -1,48 +0,0 @@
-/*-
- * Copyright (c) 2006 Verdens Gang AS
- * Copyright (c) 2006-2009 Linpro AS
- * All rights reserved.
- *
- * Author: Poul-Henning Kamp <phk at phk.freebsd.dk>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $Id$
- */
-
-#include <stdint.h>
-
-#define VSL_TYPE_STAT		""
-
-struct varnish_stats {
-#define MAC_STAT(n, t, l, f, e)	t n;
-#include "stat_field.h"
-#undef MAC_STAT
-};
-
-#define VSL_TYPE_STAT_SMA	"SMA"
-
-struct varnish_stats_sma {
-#define MAC_STAT_SMA(n, t, l, f, e)	t n;
-#include "stat_field.h"
-#undef MAC_STAT_SMA
-};

Modified: trunk/varnish-cache/include/varnishapi.h
===================================================================
--- trunk/varnish-cache/include/varnishapi.h	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/include/varnishapi.h	2010-06-08 09:46:28 UTC (rev 4929)
@@ -32,7 +32,7 @@
 #ifndef VARNISHAPI_H_INCLUDED
 #define VARNISHAPI_H_INCLUDED
 
-#include "shmlog.h"
+#include "vsl.h"
 
 /*
  * Various notes:
@@ -133,7 +133,7 @@
 int VSL_NextLog(struct VSL_data *lh, uint32_t **pp);
 int VSL_Log_Arg(struct VSL_data *vd, int arg, const char *opt);
 int VSL_Stat_Arg(struct VSL_data *vd, int arg, const char *opt);
-struct varnish_stats *VSL_OpenStats(struct VSL_data *vd);
+struct vsc_main *VSL_OpenStats(struct VSL_data *vd);
 extern const char *VSL_tags[256];
 
 

Copied: trunk/varnish-cache/include/vsc.h (from rev 4916, trunk/varnish-cache/include/stats.h)
===================================================================
--- trunk/varnish-cache/include/vsc.h	                        (rev 0)
+++ trunk/varnish-cache/include/vsc.h	2010-06-08 09:46:28 UTC (rev 4929)
@@ -0,0 +1,50 @@
+/*-
+ * Copyright (c) 2006 Verdens Gang AS
+ * Copyright (c) 2006-2009 Linpro AS
+ * All rights reserved.
+ *
+ * Author: Poul-Henning Kamp <phk at phk.freebsd.dk>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $Id$
+ */
+
+#include <stdint.h>
+
+#define VSC_CLASS          "Stat"
+
+#define VSC_TYPE_MAIN		""
+
+struct vsc_main {
+#define MAC_STAT(n, t, l, f, e)	t n;
+#include "vsc_fields.h"
+#undef MAC_STAT
+};
+
+#define VSC_TYPE_SMA	"SMA"
+
+struct vsc_sma {
+#define MAC_STAT_SMA(n, t, l, f, e)	t n;
+#include "vsc_fields.h"
+#undef MAC_STAT_SMA
+};

Copied: trunk/varnish-cache/include/vsl.h (from rev 4928, trunk/varnish-cache/include/shmlog.h)
===================================================================
--- trunk/varnish-cache/include/vsl.h	                        (rev 0)
+++ trunk/varnish-cache/include/vsl.h	2010-06-08 09:46:28 UTC (rev 4929)
@@ -0,0 +1,77 @@
+/*-
+ * Copyright (c) 2006 Verdens Gang AS
+ * Copyright (c) 2006-2009 Linpro AS
+ * All rights reserved.
+ *
+ * Author: Poul-Henning Kamp <phk at phk.freebsd.dk>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $Id$
+ *
+ * Define the layout of the shared memory log segment.
+ *
+ * NB: THIS IS NOT A PUBLIC API TO VARNISH!
+ */
+
+#ifndef SHMLOG_H_INCLUDED
+#define SHMLOG_H_INCLUDED
+
+#define VSM_CLASS_LOG		"Log"
+
+/*
+ * Shared memory log format
+ *
+ * The log is structured as an array of 32bit unsigned integers.
+ *
+ * The first integer contains a non-zero serial number, which changes
+ * whenever writing the log starts from the front.
+ *
+ * Each logrecord consist of:
+ *	[n]		= ((type & 0xff) << 24) | (length & 0xffff)
+ *	[n + 1]		= identifier
+ *	[n + 2] ... [m]	= content
+ */
+
+#define VSL_WORDS(len)		(((len) + 3) / 4)
+#define VSL_END(ptr, len)	((ptr) + 2 + VSL_WORDS(len))
+#define VSL_NEXT(ptr)		VSL_END(ptr, VSL_LEN(ptr))
+#define VSL_LEN(ptr)		((ptr)[0] & 0xffff)
+#define VSL_TAG(ptr)		((ptr)[0] >> 24)
+#define VSL_ID(ptr)		((ptr)[1])
+#define VSL_DATA(ptr)		((char*)((ptr)+2))
+
+#define VSL_ENDMARKER	(((uint32_t)SLT_Reserved << 24) | 0x454545) /* "EEE" */
+#define VSL_WRAPMARKER	(((uint32_t)SLT_Reserved << 24) | 0x575757) /* "WWW" */
+
+/*
+ * The identifiers in shmlogtag are "SLT_" + XML tag.  A script may be run
+ * on this file to extract the table rather than handcode it
+ */
+enum shmlogtag {
+#define SLTM(foo)	SLT_##foo,
+#include "vsl_tags.h"
+#undef SLTM
+	SLT_Reserved = 255
+};
+
+#endif

Copied: trunk/varnish-cache/include/vsl_tags.h (from rev 4916, trunk/varnish-cache/include/shmlog_tags.h)
===================================================================
--- trunk/varnish-cache/include/vsl_tags.h	                        (rev 0)
+++ trunk/varnish-cache/include/vsl_tags.h	2010-06-08 09:46:28 UTC (rev 4929)
@@ -0,0 +1,98 @@
+/*-
+ * Copyright (c) 2006 Verdens Gang AS
+ * Copyright (c) 2006-2009 Linpro AS
+ * All rights reserved.
+ *
+ * Author: Poul-Henning Kamp <phk at phk.freebsd.dk>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $Id$
+ *
+ * Define the tags in the shared memory in a reusable format.
+ * Whoever includes this get to define what the SLTM macro does.
+ *
+ * REMEMBER to update the documentation (especially the varnishlog(1) man
+ * page) whenever this list changes.
+ *
+ * XXX: Please add new entries a the end to not break saved log-segments.
+ * XXX: we can resort them when we have a major release.
+ */
+
+SLTM(Debug)
+SLTM(Error)
+SLTM(CLI)
+SLTM(StatSess)
+SLTM(ReqEnd)
+SLTM(SessionOpen)
+SLTM(SessionClose)
+SLTM(BackendOpen)
+SLTM(BackendXID)
+SLTM(BackendReuse)
+SLTM(BackendClose)
+SLTM(HttpGarbage)
+SLTM(Backend)
+SLTM(Length)
+
+SLTM(FetchError)
+
+SLTM(RxRequest)
+SLTM(RxResponse)
+SLTM(RxStatus)
+SLTM(RxURL)
+SLTM(RxProtocol)
+SLTM(RxHeader)
+
+SLTM(TxRequest)
+SLTM(TxResponse)
+SLTM(TxStatus)
+SLTM(TxURL)
+SLTM(TxProtocol)
+SLTM(TxHeader)
+
+SLTM(ObjRequest)
+SLTM(ObjResponse)
+SLTM(ObjStatus)
+SLTM(ObjURL)
+SLTM(ObjProtocol)
+SLTM(ObjHeader)
+
+SLTM(LostHeader)
+
+SLTM(TTL)
+SLTM(VCL_acl)
+SLTM(VCL_call)
+SLTM(VCL_trace)
+SLTM(VCL_return)
+SLTM(VCL_error)
+SLTM(ReqStart)
+SLTM(Hit)
+SLTM(HitPass)
+SLTM(ExpBan)
+SLTM(ExpKill)
+SLTM(WorkThread)
+
+SLTM(ESI_xmlerror)
+
+SLTM(Hash)
+
+SLTM(Backend_health)

Modified: trunk/varnish-cache/lib/libvarnishapi/vsl_log.c
===================================================================
--- trunk/varnish-cache/lib/libvarnishapi/vsl_log.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/lib/libvarnishapi/vsl_log.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -42,7 +42,7 @@
 
 #include "vas.h"
 #include "vsm.h"
-#include "shmlog.h"
+#include "vsl.h"
 #include "vre.h"
 #include "vbm.h"
 #include "vqueue.h"
@@ -58,7 +58,7 @@
 
 const char *VSL_tags[256] = {
 #define SLTM(foo)       [SLT_##foo] = #foo,
-#include "shmlog_tags.h"
+#include "vsl_tags.h"
 #undef SLTM
 };
 

Modified: trunk/varnish-cache/lib/libvarnishapi/vsl_stat.c
===================================================================
--- trunk/varnish-cache/lib/libvarnishapi/vsl_stat.c	2010-06-08 09:23:38 UTC (rev 4928)
+++ trunk/varnish-cache/lib/libvarnishapi/vsl_stat.c	2010-06-08 09:46:28 UTC (rev 4929)
@@ -38,7 +38,7 @@
 
 #include "vas.h"
 #include "vsm.h"
-#include "shmlog.h"
+#include "vsc.h"
 #include "vre.h"
 #include "vqueue.h"
 #include "miniobj.h"
@@ -48,14 +48,14 @@
 
 /*--------------------------------------------------------------------*/
 
-struct varnish_stats *
+struct vsc_main *
 VSL_OpenStats(struct VSL_data *vd)
 {
 	struct vsm_chunk *sha;
 
 	CHECK_OBJ_NOTNULL(vd, VSL_MAGIC);
 
-	sha = vsl_find_alloc(vd, VSM_CLASS_STAT, "", "");
+	sha = vsl_find_alloc(vd, VSC_CLASS, "", "");
 	assert(sha != NULL);
 	return (VSM_PTR(sha));
 }
@@ -108,7 +108,7 @@
 iter_main(const struct VSL_data *vd, struct vsm_chunk *sha, vsl_stat_f *func,
     void *priv)
 {
-	struct varnish_stats *st = VSM_PTR(sha);
+	struct vsc_main *st = VSM_PTR(sha);
 	struct vsl_statpt sp;
 	int i;
 
@@ -123,7 +123,7 @@
 	i = iter_call(vd, func, priv, &sp);				\
 	if (i)								\
 		return(i);
-#include "stat_field.h"
+#include "vsc_fields.h"
 #undef MAC_STAT
 	return (0);
 }
@@ -132,11 +132,11 @@
 iter_sma(const struct VSL_data *vd, struct vsm_chunk *sha, vsl_stat_f *func,
     void *priv)
 {
-	struct varnish_stats_sma *st = VSM_PTR(sha);
+	struct vsc_sma *st = VSM_PTR(sha);
 	struct vsl_statpt sp;
 	int i;
 
-	sp.class = VSL_TYPE_STAT_SMA;
+	sp.class = VSC_TYPE_SMA;
 	sp.ident = sha->ident;
 #define MAC_STAT_SMA(nn, tt, ll, ff, dd)				\
 	sp.name = #nn;							\
@@ -147,7 +147,7 @@
 	i = iter_call(vd, func, priv, &sp);				\
 	if (i)								\
 		return(i);
-#include "stat_field.h"
+#include "vsc_fields.h"
 #undef MAC_STAT_SMA
 	return (0);
 }
@@ -161,11 +161,11 @@
 	i = 0;
 	VSL_FOREACH(sha, vd) {
 		CHECK_OBJ_NOTNULL(sha, VSM_CHUNK_MAGIC);
-		if (strcmp(sha->class, VSM_CLASS_STAT))
+		if (strcmp(sha->class, VSC_CLASS))
 			continue;
-		if (!strcmp(sha->type, VSL_TYPE_STAT))
+		if (!strcmp(sha->type, VSC_TYPE_MAIN))
 			i = iter_main(vd, sha, func, priv);
-		else if (!strcmp(sha->type, VSL_TYPE_STAT_SMA))
+		else if (!strcmp(sha->type, VSC_TYPE_SMA))
 			i = iter_sma(vd, sha, func, priv);
 		else
 			i = -1;




More information about the varnish-commit mailing list