[master] e49e3cb For now substitute VSC_main for dstat. We will circle back to this laster to get the memory/summing cost back down.
Poul-Henning Kamp
phk at FreeBSD.org
Sat May 27 10:58:06 CEST 2017
commit e49e3cb3083605f59ef19e106fcbe08184ccda04
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Sat May 27 07:55:17 2017 +0000
For now substitute VSC_main for dstat. We will circle back to this
laster to get the memory/summing cost back down.
diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 70ee5f1..86410bd 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -119,6 +119,10 @@ struct vsb;
struct worker;
struct v1l;
+struct VSC_main;
+
+#define dstat VSC_main
+
#define DIGEST_LEN 32
/*--------------------------------------------------------------------*/
diff --git a/bin/varnishd/cache/cache_pool.c b/bin/varnishd/cache/cache_pool.c
index 6f8ba29..03b3911 100644
--- a/bin/varnishd/cache/cache_pool.c
+++ b/bin/varnishd/cache/cache_pool.c
@@ -55,12 +55,7 @@ pool_sumstat(const struct dstat *src)
{
Lck_AssertHeld(&wstat_mtx);
-#define L0(n)
-#define L1(n) (VSC_C_main->n += src->n)
-#define VSC_FF(n,t,l,s,f,v,d,e) L##l(n);
-#include "tbl/vsc_f_main.h"
-#undef L0
-#undef L1
+ VSC_main_Summ(VSC_C_main, src);
}
void
diff --git a/bin/varnishd/cache/cache_priv.h b/bin/varnishd/cache/cache_priv.h
index d83629a..215ebc9 100644
--- a/bin/varnishd/cache/cache_priv.h
+++ b/bin/varnishd/cache/cache_priv.h
@@ -31,18 +31,6 @@
#include "VSC_main.h"
-/*--------------------------------------------------------------------*/
-
-#define L0(t, n)
-#define L1(t, n) t n;
-#define VSC_FF(n,t,l,s,f,v,d,e) L##l(t, n)
-struct dstat {
- unsigned summs;
-#include "tbl/vsc_f_main.h"
-};
-#undef L0
-#undef L1
-
/* Prototypes etc ----------------------------------------------------*/
/* cache_acceptor.c */
diff --git a/bin/varnishd/cache/cache_wrk.c b/bin/varnishd/cache/cache_wrk.c
index be38c8d..0da3ce7 100644
--- a/bin/varnishd/cache/cache_wrk.c
+++ b/bin/varnishd/cache/cache_wrk.c
@@ -144,12 +144,7 @@ pool_addstat(struct dstat *dst, struct dstat *src)
{
dst->summs++;
-#define L0(n)
-#define L1(n) (dst->n += src->n)
-#define VSC_FF(n,t,l,s,f,v,d,e) L##l(n);
-#include "tbl/vsc_f_main.h"
-#undef L0
-#undef L1
+ VSC_main_Summ(dst, src);
memset(src, 0, sizeof *src);
}
diff --git a/bin/varnishd/main.vsc b/bin/varnishd/main.vsc
index 16106f7..d3c939a 100644
--- a/bin/varnishd/main.vsc
+++ b/bin/varnishd/main.vsc
@@ -9,6 +9,9 @@
:oneliner: Main counters
:sumfunction:
+.. varnish_vsc:: summs
+ :oneliner: stat summ operations
+
.. varnish_vsc:: uptime
:oneliner: Child process uptime
diff --git a/include/tbl/vsc_f_main.h b/include/tbl/vsc_f_main.h
index 206cd03..2a109c8 100644
--- a/include/tbl/vsc_f_main.h
+++ b/include/tbl/vsc_f_main.h
@@ -33,6 +33,8 @@
/*lint -save -e525 -e539 */
+VSC_FF(summs, uint64_t, 0, 'c', 'd', debug, "", "")
+
/*--------------------------------------------------------------------
* Globals, not related to traffic
*/
More information about the varnish-commit
mailing list