[3.0] 66bcd31 Add varnish-counters(7) man page

Tollef Fog Heen tfheen at varnish-cache.org
Thu Oct 6 11:25:21 CEST 2011


commit 66bcd31710a8ecfb18c24adba8d7739d074b34a1
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date:   Wed Sep 21 13:03:54 2011 +0200

    Add varnish-counters(7) man page

diff --git a/.gitignore b/.gitignore
index 6cf0950..f35e990 100644
--- a/.gitignore
+++ b/.gitignore
@@ -54,8 +54,10 @@ TAGS
 /lib/libvmod_std/vcc_if.h
 
 # Man-files and binaries
+/man/vsc2rst
 /man/vcl.7
 /man/varnish-cli.7
+/man/varnish-counters.7
 /bin/varnishadm/varnishadm
 /bin/varnishadm/varnishadm.1
 /bin/varnishd/varnishd
diff --git a/man/Makefile.am b/man/Makefile.am
index bc662b6..da95e8c 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,6 +1,12 @@
 #
 
-dist_man_MANS = vcl.7 varnish-cli.7
+noinst_PROGRAMS = vsc2rst
+vsc2rst_SOURCES = vsc2rst.c \
+	$(top_srcdir)/include/vsc_fields.h
+
+INCLUDES = -I$(top_srcdir)/include
+
+dist_man_MANS = vcl.7 varnish-cli.7 varnish-counters.7
 MAINTAINERCLEANFILES = $(dist_man_MANS)
 
 vcl.7: $(top_srcdir)/doc/sphinx/reference/vcl.rst \
@@ -23,3 +29,13 @@ else
 	@echo "========================================"
 	@false
 endif
+
+varnish-counters.7: vsc2rst
+if HAVE_RST2MAN
+	./vsc2rst | ${RST2MAN} - $@
+else
+	@echo "========================================"
+	@echo "You need rst2man installed to make dist"
+	@echo "========================================"
+	@false
+endif
diff --git a/man/vsc2rst.c b/man/vsc2rst.c
new file mode 100644
index 0000000..9b89cce
--- /dev/null
+++ b/man/vsc2rst.c
@@ -0,0 +1,65 @@
+
+#include <stdio.h>
+
+#define P(x, ...) printf(x "\n", ##__VA_ARGS__)
+#define VSC_F(n, t, l, f, e, d) printf("%s – %s\n\t%s\n\n", #n, e, d);
+
+int main(int argc, char **argv)
+{
+	P("================");
+	P("varnish-counters");
+	P("================");
+	P("");
+
+	P("---------------------------------");
+	P("Varnish counter field definitions");
+	P("---------------------------------");
+
+	P(":Author: Tollef Fog Heen");
+	P(":Date:   2011-09-20");
+	P(":Version: 1.0");
+	P(":Manual section: 7");
+	P("");
+
+	P("MAIN COUNTERS");
+	P("=============");
+	P("");
+#define VSC_DO_MAIN
+#include "vsc_fields.h"
+#undef VSC_DO_MAIN
+
+	P("");
+	P("LOCK COUNTERS");
+	P("=============");
+	P("");
+#define VSC_DO_LCK
+#include "vsc_fields.h"
+#undef VSC_DO_LCK
+
+	P("");
+	P("PER MALLOC STORAGE COUNTERS");
+	P("===========================");
+	P("");
+#define VSC_DO_SMA
+#include "vsc_fields.h"
+#undef  VSC_DO_SMA
+
+	P("");
+	P("PER FILE STORAGE COUNTERS");
+	P("=========================");
+	P("");
+#define VSC_DO_SMF
+#include "vsc_fields.h"
+#undef VSC_DO_SMF
+
+	P("");
+	P("PER BACKEND COUNTERS");
+	P("====================");
+	P("");
+#define VSC_DO_VBE
+#include "vsc_fields.h"
+#undef VSC_DO_VBE
+
+	return 0;
+}
+



More information about the varnish-commit mailing list