diff options
Diffstat (limited to 'dist')
-rw-r--r-- | dist/stat.py | 12 | ||||
-rw-r--r-- | dist/stat_data.py | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/dist/stat.py b/dist/stat.py index 3c4be936aed..e6021cab18d 100644 --- a/dist/stat.py +++ b/dist/stat.py @@ -1,5 +1,5 @@ # Read the source files and output the statistics #defines plus the -# initialize and clear code. +# initialize and refresh code. import re, string, sys, textwrap from dist import compare_srcfile @@ -94,6 +94,9 @@ def print_func(name, list): void __wt_stat_init_''' + name + '''_stats(WT_''' + name.upper() + '''_STATS *stats) { +\t/* Clear, so can also be called for reinitialization. */ +\tmemset(stats, 0, sizeof(*stats)); + ''') for l in sorted(list): o = '\tstats->' + l.name + '.desc = "' + l.desc + '";\n' @@ -105,7 +108,7 @@ __wt_stat_init_''' + name + '''_stats(WT_''' + name.upper() + '''_STATS *stats) f.write(''' void -__wt_stat_clear_''' + name + '''_stats(void *stats_arg) +__wt_stat_refresh_''' + name + '''_stats(void *stats_arg) { \tWT_''' + name.upper() + '''_STATS *stats; @@ -123,7 +126,8 @@ __wt_stat_clear_''' + name + '''_stats(void *stats_arg) f.write(''' void -__wt_stat_aggregate_''' + name + '''_stats(void *child, void *parent) +__wt_stat_aggregate_''' + name + +'''_stats(const void *child, const void *parent) { \tWT_''' + name.upper() + '''_STATS *c, *p; @@ -141,7 +145,7 @@ __wt_stat_aggregate_''' + name + '''_stats(void *child, void *parent) f.write('\t' + o + '\n') f.write('}\n') -# Write the stat initialization and clear routines to the stat.c file. +# Write the stat initialization and refresh routines to the stat.c file. f = open(tmp_file, 'w') f.write('/* DO NOT EDIT: automatically built by dist/stat.py. */\n\n') f.write('#include "wt_internal.h"\n') diff --git a/dist/stat_data.py b/dist/stat_data.py index 03b07c6305f..8cd0c38bb77 100644 --- a/dist/stat_data.py +++ b/dist/stat_data.py @@ -7,7 +7,7 @@ # currently open'. # # Optional configuration flags: -# no_clear Value ignored by the statistics clear function +# no_clear Value ignored by the statistics refresh function # no_aggregate Ignore the value when aggregating statistics # max_aggregate Take the maximum value when aggregating statistics # no_scale Don't scale value per second in the logging tool script |