Commit 6ce506eb authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add a argument to the stat_field macro, to be used with locking evilness

shortly.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3794 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 22f0b084
......@@ -84,7 +84,7 @@ mcf_stats(struct cli *cli, const char * const *av, void *priv)
(void)priv;
AN(VSL_stats);
#define MAC_STAT(n, t, f, d) \
#define MAC_STAT(n, t, l, f, d) \
cli_out(cli, "%12ju %s\n", (VSL_stats->n), d);
#include "stat_field.h"
#undef MAC_STAT
......
......@@ -146,7 +146,7 @@ do_curses(struct varnish_stats *VSL_stats, int delay, const char *fields)
mvprintw(2, 0, "Hitrate avg: %8.4f %8.4f %8.4f", a1, a2, a3);
line = 3;
#define MAC_STAT(n, t, f, d) \
#define MAC_STAT(n, t, l, f, d) \
if ((fields == NULL || show_field( #n, fields )) && line < LINES) { \
ju = VSL_stats->n; \
if (ju == 0 && !seen.n) { \
......@@ -228,7 +228,7 @@ do_once(struct varnish_stats *VSL_stats, const char* fields)
". ", "Child uptime");
} while (0);
#define MAC_STAT(n, t, f, d) \
#define MAC_STAT(n, t, l, f, d) \
do { \
if (fields != NULL && ! show_field( #n, fields )) break; \
intmax_t ju = VSL_stats->n; \
......@@ -271,7 +271,7 @@ list_fields(void)
fprintf(stderr, "---------- -----------\n");
fprintf(stderr, "uptime Child uptime\n");
#define MAC_STAT(n, t, f, d) \
#define MAC_STAT(n, t, l, f, d) \
do { \
fprintf(stderr, "%-20s %s\n", #n, d);\
} while (0);
......@@ -285,7 +285,7 @@ valid_fields(const char* fields)
int i, valid_field, field_length;
const char *all_fields[] = {
"uptime",
#define MAC_STAT(n, t, f, d) \
#define MAC_STAT(n, t, l, f, d) \
#n,
#include "stat_field.h"
#undef MAC_STAT
......
......@@ -451,7 +451,7 @@ varnish_expect(const struct varnish *v, char * const *av) {
for (i = 0; i < 10; i++, usleep(100000)) {
#define MAC_STAT(n, t, f, d) \
#define MAC_STAT(n, t, l, f, d) \
if (!strcmp(av[0], #n)) { \
val = v->stats->n; \
} else
......
This diff is collapsed.
......@@ -33,7 +33,7 @@
struct varnish_stats {
time_t start_time;
#define MAC_STAT(n,t,f,e) t n;
#define MAC_STAT(n, t, l, f, e) t n;
#include "stat_field.h"
#undef MAC_STAT
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment