[master] 52b0e59 Redo the vsc_fields.h table definition
Martin Blix Grydeland
martin at varnish-software.com
Tue Jan 27 17:17:56 CET 2015
commit 52b0e59799ae448d3991299426c07dbc9b9f98a1
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date: Tue Jan 27 15:34:58 2015 +0100
Redo the vsc_fields.h table definition
Use 'semantics' instead of 'format' to describe the field semantics.
Switch 'description' and 'explanation' to be short and long texts
respectively.
Reflect this in all macro invocations
diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index fed05d1..d307c38 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -268,7 +268,7 @@ struct acct_bereq {
#define L0(t, n)
#define L1(t, n) t n;
-#define VSC_F(n,t,l,f,v,e,d) L##l(t, n)
+#define VSC_F(n,t,l,s,v,d,e) L##l(t, n)
struct dstat {
unsigned summs;
#include "tbl/vsc_f_main.h"
diff --git a/bin/varnishd/cache/cache_pool.c b/bin/varnishd/cache/cache_pool.c
index 5bf3608..5c1c444 100644
--- a/bin/varnishd/cache/cache_pool.c
+++ b/bin/varnishd/cache/cache_pool.c
@@ -93,7 +93,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_F(n, t, l, f, v, e, d) L##l(n);
+#define VSC_F(n,t,l,s,v,d,e) L##l(n);
#include "tbl/vsc_f_main.h"
#undef VSC_F
#undef L0
@@ -132,7 +132,7 @@ pool_addstat(struct dstat *dst, struct dstat *src)
dst->summs++;
#define L0(n)
#define L1(n) (dst->n += src->n)
-#define VSC_F(n, t, l, f, v, e, d) L##l(n);
+#define VSC_F(n,t,l,s,v,d,e) L##l(n);
#include "tbl/vsc_f_main.h"
#undef VSC_F
#undef L0
diff --git a/include/tbl/vsc_fields.h b/include/tbl/vsc_fields.h
index f6c0bc2..c7bc451 100644
--- a/include/tbl/vsc_fields.h
+++ b/include/tbl/vsc_fields.h
@@ -29,17 +29,17 @@
* Definition of all shared memory statistics below (except main - see
* include/tbl/vsc_f_main.h).
*
- * Fields (n, t, l, f, v, e, d):
+ * Fields (n, t, l, s, v, d, e):
* n - Name: Field name, in C-source and stats programs
- * t - Type: C-type, uint64_t, unless marked in 'f'
+ * t - C-type: uint64_t, unless marked in 's'
* l - Local: Local counter in worker thread.
- * f - Format: Semantics of the value in this field
+ * s - Semantics: Semantics of the value in this field
* 'b' - Bitmap
* 'c' - Counter, never decreases.
* 'g' - Gauge, goes up and down
* v - Verbosity: Counter verbosity level (see vsc_levels.h)
- * e - Explanation: Short explanation of field (for screen use)
- * d - Description: Long explanation of field (for doc use)
+ * d - Description: Short description of field (for screen use)
+ * e - Explanation: Long explanation of field (for doc use)
*
* Please describe Gauge variables as "Number of..." to indicate that
* this is a snapshot, and Counter variables as "Count of" to indicate
diff --git a/include/vapi/vsc.h b/include/vapi/vsc.h
index 039f839..4a7782d 100644
--- a/include/vapi/vsc.h
+++ b/include/vapi/vsc.h
@@ -190,7 +190,7 @@ const struct VSC_level_desc *VSC_LevelDesc(unsigned level);
#undef VSC_TYPE_F
#define VSC_DO(U,l,t) extern const struct VSC_desc VSC_desc_##l[];
-#define VSC_F(n,t,l,f,v,e,d)
+#define VSC_F(n,t,l,s,v,d,e)
#define VSC_DONE(U,l,t)
#include "tbl/vsc_all.h"
#undef VSC_DO
diff --git a/include/vapi/vsc_int.h b/include/vapi/vsc_int.h
index dacb2f4..4a7d4a8 100644
--- a/include/vapi/vsc_int.h
+++ b/include/vapi/vsc_int.h
@@ -46,7 +46,7 @@ enum VSC_level_e {
/* Define the vsc type structs */
#define VSC_DO(u,l,t) struct VSC_C_##l {
-#define VSC_F(n,t,l,f,v,e,d) t n;
+#define VSC_F(n,t,l,s,v,d,e) t n;
#define VSC_DONE(u,l,t) };
#include "tbl/vsc_all.h"
#undef VSC_DO
diff --git a/lib/libvarnishapi/vsc.c b/lib/libvarnishapi/vsc.c
index 4dc7205..fe8c449 100644
--- a/lib/libvarnishapi/vsc.c
+++ b/lib/libvarnishapi/vsc.c
@@ -387,7 +387,7 @@ vsc_add_pt(struct vsc *vsc, const volatile void *ptr,
CHECK_OBJ_NOTNULL(vsc, VSC_MAGIC); \
st = vf->fantom.b;
-#define VSC_F(nn,tt,ll,ff,vv,ee,dd) \
+#define VSC_F(nn,tt,ll,ss,vv,dd,ee) \
vsc_add_pt(vsc, &st->nn, descs++, vf);
#define VSC_DONE(U,l,t) \
@@ -437,7 +437,7 @@ vsc_build_pt_list(struct VSM_data *vd)
CHECK_OBJ_NOTNULL(vf, VSC_VF_MAGIC); \
if (!strcmp(vf->fantom.type, t)) \
iter_##l(vsc, VSC_desc_##l, vf);
-#define VSC_F(n,t,l,f,v,e,d)
+#define VSC_F(n,t,l,s,v,d,e)
#define VSC_DONE(a,b,c)
#include "tbl/vsc_all.h"
#undef VSC_DO
@@ -565,7 +565,7 @@ VSC_LevelDesc(unsigned level)
#undef VSC_TYPE_F
#define VSC_DO(U,l,t) const struct VSC_desc VSC_desc_##l[] = {
-#define VSC_F(n,t,l,f,v,e,d) {#n,#t,f,e,d,&VSC_level_desc_##v},
+#define VSC_F(n,t,l,s,v,d,e) {#n,#t,s,d,e,&VSC_level_desc_##v},
#define VSC_DONE(U,l,t) };
#include "tbl/vsc_all.h"
#undef VSC_DO
diff --git a/man/vsc2rst.c b/man/vsc2rst.c
index a9a99fd..6c00971 100644
--- a/man/vsc2rst.c
+++ b/man/vsc2rst.c
@@ -40,7 +40,7 @@
printf(x "\n", ##__VA_ARGS__)
#define VSC_LEVEL_F(v,l,e,d) \
printf("%s – %s\n\t%s\n\n", l, e, d);
-#define VSC_F(n, t, l, f, v, e, d) \
+#define VSC_F(n, t, l, s, v, d, e) \
printf("%s – %s (%s)\n\t%s\n\n", #n, e, VSC_level_##v, d);
int main(int argc, char **argv)
More information about the varnish-commit
mailing list