diff options
Diffstat (limited to 'src/third_party/wiredtiger/dist')
22 files changed, 276 insertions, 51 deletions
diff --git a/src/third_party/wiredtiger/dist/api_config.py b/src/third_party/wiredtiger/dist/api_config.py index 0471bde51fd..66bf3e4fd3c 100644 --- a/src/third_party/wiredtiger/dist/api_config.py +++ b/src/third_party/wiredtiger/dist/api_config.py @@ -2,7 +2,7 @@ import os, re, sys, textwrap import api_data -from dist import compare_srcfile +from dist import compare_srcfile, format_srcfile # Temporary file. tmp_file = '__tmp' @@ -124,7 +124,7 @@ for line in open(f, 'r'): tfile.write(prefix + '@configstart{' + config_name + ', see dist/api_data.py}\n') - w = textwrap.TextWrapper(width=80-len(prefix.expandtabs()), + w = textwrap.TextWrapper(width=100-len(prefix.expandtabs()), break_on_hyphens=False, replace_whitespace=False, fix_sentence_endings=True) @@ -337,6 +337,7 @@ __wt_conn_config_match(const char *method) ''') tfile.close() +format_srcfile(tmp_file) compare_srcfile(tmp_file, f) # Update the config.h file with the #defines for the configuration entries. @@ -354,4 +355,5 @@ for line in open('../src/include/config.h', 'r'): tfile.write(' */\n') tfile.write(config_defines) tfile.close() +format_srcfile(tmp_file) compare_srcfile(tmp_file, '../src/include/config.h') diff --git a/src/third_party/wiredtiger/dist/api_err.py b/src/third_party/wiredtiger/dist/api_err.py index cc6b9a6610a..64be5b37a79 100644 --- a/src/third_party/wiredtiger/dist/api_err.py +++ b/src/third_party/wiredtiger/dist/api_err.py @@ -2,7 +2,7 @@ # message code in strerror.c. import re, textwrap -from dist import compare_srcfile +from dist import compare_srcfile, format_srcfile class Error: def __init__(self, name, value, desc, long_desc=None, **flags): @@ -165,6 +165,7 @@ wiredtiger_strerror(int error) } ''') tfile.close() +format_srcfile(tmp_file) compare_srcfile(tmp_file, '../src/conn/api_strerror.c') # Update the error documentation block. @@ -189,4 +190,5 @@ for line in open(doc, 'r'): '@par <code>' + err.name.upper() + '</code>\n' + " ".join(err.long_desc.split()) + '\n\n') tfile.close() +format_srcfile(tmp_file) compare_srcfile(tmp_file, doc) diff --git a/src/third_party/wiredtiger/dist/dist.py b/src/third_party/wiredtiger/dist/dist.py index bd3f1b2b7e9..99a4385885d 100644 --- a/src/third_party/wiredtiger/dist/dist.py +++ b/src/third_party/wiredtiger/dist/dist.py @@ -1,4 +1,4 @@ -import filecmp, fnmatch, glob, os, re, shutil +import filecmp, fnmatch, glob, os, re, shutil, subprocess # source_files -- # Return a list of the WiredTiger source file names. @@ -59,3 +59,9 @@ def compare_srcfile(tmp, src): print('Updating ' + src) shutil.copyfile(tmp, src) os.remove(tmp) + +# format_srcfile -- +# Format a source file. +def format_srcfile(src): + src = os.path.abspath(src) + subprocess.check_call(['./s_clang-format', src]) diff --git a/src/third_party/wiredtiger/dist/function.py b/src/third_party/wiredtiger/dist/function.py index 7c632b4e227..789d77370c0 100644 --- a/src/third_party/wiredtiger/dist/function.py +++ b/src/third_party/wiredtiger/dist/function.py @@ -24,9 +24,16 @@ def missing_comment(): def function_args_alpha(text): s = text.strip() s = re.sub("[*]","", s) - s = re.sub("^const ","", s) - s = re.sub("^static ","", s) - s = re.sub("^volatile ","", s) + s = s.split() + def merge_specifier(words, specifier): + if len(words) > 2 and words[0] == specifier: + words[1] += specifier + words = words[1:] + return words + s = merge_specifier(s, 'const') + s = merge_specifier(s, 'static') + s = merge_specifier(s, 'volatile') + s = ' '.join(s) return s # List of illegal types. @@ -90,10 +97,15 @@ def function_args(name, line): line = re.sub("^static ", "", line) line = re.sub("^volatile ", "", line) - # Let WT_UNUSED terminate the parse. It often appears at the beginning - # of the function and looks like a WT_XXX variable declaration. + # Let WT_ASSERT, WT_UNUSED and WT_RET terminate the parse. They often appear + # at the beginning of the function and looks like a WT_XXX variable + # declaration. + if re.search('^WT_ASSERT', line): + return False,0 if re.search('^WT_UNUSED', line): return False,0 + if re.search('^WT_RET', line): + return False,0 # Let lines not terminated with a semicolon terminate the parse, it means # there's some kind of interesting line split we probably can't handle. @@ -141,7 +153,7 @@ def function_declaration(): found,n = function_args(name, line) if found: # List statics first. - if re.search("^\sstatic", line): + if re.search("^\s+static", line): static_list[n].append(line) continue diff --git a/src/third_party/wiredtiger/dist/java_doc.py b/src/third_party/wiredtiger/dist/java_doc.py index 71dfd93d3a8..1c91318cbee 100644 --- a/src/third_party/wiredtiger/dist/java_doc.py +++ b/src/third_party/wiredtiger/dist/java_doc.py @@ -22,7 +22,7 @@ tfile.write('''/* DO NOT EDIT: automatically built by dist/java_doc.py. */ ''') cclass_re = re.compile('^struct __([a-z_]*) {') -cfunc_re = re.compile('\t.*? __F\(([a-z_]*)\)') +cfunc_re = re.compile('\s+.*? __F\(([a-z_]*)\)') curr_class = "" for line in open(f, 'r'): diff --git a/src/third_party/wiredtiger/dist/log.py b/src/third_party/wiredtiger/dist/log.py index b3e6a71b63a..b2c5b5d1af9 100644 --- a/src/third_party/wiredtiger/dist/log.py +++ b/src/third_party/wiredtiger/dist/log.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import os, re, sys, textwrap -from dist import compare_srcfile +from dist import compare_srcfile, format_srcfile import log_data # Temporary file. @@ -333,7 +333,7 @@ for optype in log_data.optypes: }) tfile.write(''' -\tWT_ILLEGAL_VALUE(session, optype); +\tdefault:\n\t\treturn (__wt_illegal_value(session, optype)); \t} \treturn (0); @@ -341,4 +341,5 @@ tfile.write(''' ''') tfile.close() +format_srcfile(tmp_file) compare_srcfile(tmp_file, f) diff --git a/src/third_party/wiredtiger/dist/s_all b/src/third_party/wiredtiger/dist/s_all index 51ea98ab154..29965aff103 100755 --- a/src/third_party/wiredtiger/dist/s_all +++ b/src/third_party/wiredtiger/dist/s_all @@ -78,10 +78,11 @@ run "python flags.py" run "python log.py" run "python stat.py" run "python java_doc.py" -run "sh ./s_prototypes" -run "sh ./s_typedef -b" run "sh ./s_copyright" run "sh ./s_style" +run "./s_clang-format" +run "sh ./s_prototypes" +run "sh ./s_typedef -b" COMMANDS=" 2>&1 ./s_define > ${t_pfx}s_define diff --git a/src/third_party/wiredtiger/dist/s_clang-format b/src/third_party/wiredtiger/dist/s_clang-format new file mode 100755 index 00000000000..92d375333d2 --- /dev/null +++ b/src/third_party/wiredtiger/dist/s_clang-format @@ -0,0 +1,60 @@ +#! /bin/bash + +set -o pipefail + +download_clang_format() { + if [ `uname` = "Linux" ]; then + wget https://s3.amazonaws.com/boxes.10gen.com/build/clang-format-3.8-rhel55.tar.gz -O dist/clang-format.tar.gz + tar --strip=2 -C dist/ -xf dist/clang-format.tar.gz build/bin/clang-format && rm dist/clang-format.tar.gz + elif [ `uname` = "Darwin" ]; then + wget https://s3.amazonaws.com/boxes.10gen.com/build/clang%2Bllvm-3.8.0-x86_64-apple-darwin.tar.xz -O dist/clang-format.tar.gz + tar --strip=2 -C dist/ -xf dist/clang-format.tar.gz clang+llvm-3.8.0-x86_64-apple-darwin/bin/clang-format && rm dist/clang-format.tar.gz + else + echo "$0: unsupported environment $(uname)" + exit 1 + fi +} + +# Find the top-level WiredTiger directory and move to there. +cd `git rev-parse --show-toplevel` || exit 1 + +# Override existing Clang Format versions in the PATH. +export PATH="${PWD}/dist":$PATH + +# Ensure that we have the correct version of clang-format. +clang_format_version="3.8.0" +clang-format --version | grep "version $clang_format_version" >/dev/null 2>&1 +if test $? -ne 0; then + download_clang_format +fi + +case $# in +0) + # Get all source files that aren't in s_clang-format.list. + search=`find bench examples ext src test -name '*.[chi]'` + for f in `cat dist/s_clang-format.list`; do + search=`echo "$search" | sed "\#$f#d"` + done;; +1) + search="$1";; +*) + echo "usage: $0 [file]" + exit 1;; +esac + +# Don't format inplace with -i flag. +# We want to be able to detect modifications. +for f in $search; do + tempfile=$(mktemp) + cat "$f" | \ + clang-format --fallback-style=none | \ + python dist/s_goto.py | \ + python dist/s_comment.py > "$tempfile" || exit 1 + cmp --silent "$f" "$tempfile" + if test $? -ne 0; then + if test $# -eq 0 ; then + echo "Modifying $f" + fi + mv "$tempfile" "$f" + fi +done diff --git a/src/third_party/wiredtiger/dist/s_clang-format.list b/src/third_party/wiredtiger/dist/s_clang-format.list new file mode 100644 index 00000000000..6e3be3f98ed --- /dev/null +++ b/src/third_party/wiredtiger/dist/s_clang-format.list @@ -0,0 +1,18 @@ +bench/workgen/workgen.h +bench/workgen/workgen_int.h +bench/workgen/workgen_time.h +src/config/config_def.c +src/conn/api_strerror.c +src/include/bitstring.i +src/include/config.h +src/include/extern.h +src/include/extern_posix.h +src/include/extern_win.h +src/include/queue.h +src/include/stat.h +src/include/wt_internal.h +src/log/log_auto.c +src/os_posix/os_getopt.c +src/support/hash_city.c +src/support/hash_fnv.c +src/support/stat.c diff --git a/src/third_party/wiredtiger/dist/s_comment.py b/src/third_party/wiredtiger/dist/s_comment.py new file mode 100644 index 00000000000..556862f0fcc --- /dev/null +++ b/src/third_party/wiredtiger/dist/s_comment.py @@ -0,0 +1,109 @@ +# Fill out block comments to the full line length (currently 100). +# +# We're defining a "block comment" to be a multiline comment where each line +# begins with an alphabetic character. +# +# We also have some special logic to handle function description comments even +# though those don't conform to our definition of a "block comment". +import re, sys + +# List of words in the current block comment. +words = [] + +# Whether we're inside a potential block comment. +multiline = False + +# The maximum allowed line length. +line_length = 100 + +# How far to indent the current block comment. +indentation = 0 + +# Whether we're inside a function description comment. This is not a block +# comment by our definition but we want to fill these too. +function_desc = False + +# Whether we've seen a line in the multiline comment to indicate that it is NOT +# a block comment. In that case don't use the refilling logic and just print the +# contents verbatim. +block = False + +# The literal contents of the current block comment. If we realise halfway +# through the comment that it's not a block comment then we'll just print this +# out and pretend none of this ever happened. +comment = str() + +for line in sys.stdin: + sline = line.strip() + # Beginning of a block comment. + if sline == '/*': + comment = line + assert not multiline + multiline = True + block = True + # Figure out how far we need to indent. + indentation = 0 + for c in line: + if c == ' ': + indentation += 1 + elif c == '\t': + indentation += 8 + else: + break + # End of a block comment. + elif sline.endswith('*/'): + comment += line + # Don't mess with generated comments. + # Scripts in dist rely on them to figure out where to generate code. + if 'DO NOT EDIT' in comment: + block = False + if multiline and not block: + sys.stdout.write(comment) + elif multiline: + indent_ws = ' ' * indentation + sys.stdout.write('{}/*\n'.format(indent_ws)) + current_line = indent_ws + ' *' + for word in words: + if word == '--' and function_desc: + sys.stdout.write(current_line + ' ' + word + '\n') + current_line = indent_ws + ' *' + ' ' * 4 + continue + if word == '\n': + sys.stdout.write(current_line + '\n') + sys.stdout.write(indent_ws + ' *' + '\n') + current_line = indent_ws + ' *' + continue + if len(current_line) + len(word) >= line_length: + sys.stdout.write(current_line + '\n') + current_line = indent_ws + ' *' + if function_desc: + current_line += ' ' * 4 + current_line += ' ' + word + sys.stdout.write(current_line + '\n') + sys.stdout.write('{} */\n'.format(indent_ws)) + else: + sys.stdout.write(line) + block = False + words = [] + multiline = False + function_desc = False + elif multiline: + comment += line + # Function names begin with either a lowercase char or an underscore. + if (len(sline) >= 3 and sline.startswith('*') and sline[1] == ' ' and + (sline[2].islower() or sline[2] == '_') and sline.endswith('--')): + function_desc = True + # We're only reformatting block comments where each line begins with a + # space and an alphabetic character after the asterisk. The only + # exceptions are function descriptions. + block = block and \ + (len(sline) >= 3 and sline.startswith('*') and + sline[1] == ' ' and sline[2].isalpha()) or function_desc + # Trim asterisks at the beginning of each line in a multiline comment. + if sline.startswith('*'): + sline = sline[1:] + # Might be trailing whitespace after the asterisk. Leading strip again. + sline = sline.lstrip() + words.extend(sline.split()) + else: + sys.stdout.write(line) diff --git a/src/third_party/wiredtiger/dist/s_function b/src/third_party/wiredtiger/dist/s_function index 314a8c5bb06..c16dcaf67e8 100755 --- a/src/third_party/wiredtiger/dist/s_function +++ b/src/third_party/wiredtiger/dist/s_function @@ -23,7 +23,7 @@ file_parse() # where there's a jump to the error label after the error label. for f in `find bench examples ext src test -name '*.[ci]'`; do file_parse $f | - egrep '(WT_ERR[_A-Z]*|WT_ILLEGAL_VALUE_ERR)\(.*(WT_ILLEGAL_VALUE|WT_RET[_A-Z]*)\(.*err:|[^a-z_]err:.*(WT_ERR|WT_ILLEGAL_VALUE_ERR)\(' | + egrep '(WT_ERR[_A-Z]*)\(.*(WT_RET[_A-Z]*)\(.*err:|[^a-z_]err:.*(WT_ERR)\(' | sed 's/:.*//' > $t test -s $t && { @@ -37,7 +37,7 @@ done for f in `find bench examples ext src test -name '*.[ci]'`; do file_parse $f | sed "s=^=$f:=" done | python dist/s_function_loop.py | - egrep '\{@[^@]*(WT_ILLEGAL_VALUE|WT_RET[_A-Z]*)\([^@]*(WT_ERR[_A-Z]*|WT_ILLEGAL_VALUE_ERR)\(.*err:' | + egrep '\{@[^@]*(WT_RET[_A-Z]*)\([^@]*(WT_ERR[_A-Z]*)\(.*err:' | sed -e 's/^\([^:]*\): *\([^:]*\):.*/\1:\2: mix of returns and jump to the error label within a loop/' # Return of 0 in functions after a jump to the error label. @@ -59,7 +59,7 @@ for f in `find bench examples ext src test -name '*.[ci]'`; do egrep 'va_start.*(WT_RET|goto).*va_end' | sed 's/:.*//' > $t file_parse $f | - egrep -v 'va_start.*WT_ERR.*[^a-z_]err: va_end' | + egrep -v 'va_start.*WT_ERR.*[^a-z_]err:.*va_end' | egrep 'va_start.*WT_ERR.*va_end' | sed 's/:.*//' >> $t diff --git a/src/third_party/wiredtiger/dist/s_goto.py b/src/third_party/wiredtiger/dist/s_goto.py new file mode 100644 index 00000000000..032084168cc --- /dev/null +++ b/src/third_party/wiredtiger/dist/s_goto.py @@ -0,0 +1,18 @@ +# Trim all trailing whitespace in front of goto labels. +# This is a workaround for a Clang Format limitation where goto labels are +# automatically indented according to nesting. +import re, sys + +# 1. Zero or more whitespace characters. +# 2. One or more lowercase ASCII characters. +# 3. Colon character. +p = re.compile('^\s*[a-z]+:$') +for line in sys.stdin: + m = p.search(line) + if m is not None: + sline = line.lstrip() + # The "default" tag in a switch statement looks identical so we need + # to filter these out here. + if not sline.startswith('default'): + line = sline + sys.stdout.write(line) diff --git a/src/third_party/wiredtiger/dist/s_longlines b/src/third_party/wiredtiger/dist/s_longlines index 69fe22ac3ee..f35296c780a 100755 --- a/src/third_party/wiredtiger/dist/s_longlines +++ b/src/third_party/wiredtiger/dist/s_longlines @@ -20,7 +20,7 @@ l=`(cd .. && for f in $l ; do expand -t8 < ../$f | awk -- \ - "{if(length(\$0) > 80) printf(\"%s:%d\\n\", \"$f\", NR)}" + "{if(length(\$0) > 100) printf(\"%s:%d\\n\", \"$f\", NR)}" done exit 0 diff --git a/src/third_party/wiredtiger/dist/s_prototypes b/src/third_party/wiredtiger/dist/s_prototypes index 75863cf8f87..57f73cff249 100755 --- a/src/third_party/wiredtiger/dist/s_prototypes +++ b/src/third_party/wiredtiger/dist/s_prototypes @@ -60,6 +60,7 @@ EOF for i in $l; do proto ../$i done) > $t + ./s_clang-format "${PWD}/$t" cmp $t $f > /dev/null 2>&1 || (echo "Building $f" && rm -f $f && cp $t $f) } @@ -67,13 +68,13 @@ EOF f=../src/include/extern_win.h l=`sed \ -e '/os_win/!d' \ - -e 's/[ ].*$//' filelist` + -e 's/[ ].*$//' filelist` externs f=../src/include/extern_posix.h l=`sed \ -e '/os_posix/!d' \ - -e 's/[ ].*$//' filelist` + -e 's/[ ].*$//' filelist` externs f=../src/include/extern.h @@ -84,7 +85,7 @@ l=`sed \ -e '/\/checksum\/zseries/d' \ -e '/os_posix/d' \ -e '/os_win/d' \ - -e 's/[ ].*$//' filelist` + -e 's/[ ].*$//' filelist` externs exit 0 diff --git a/src/third_party/wiredtiger/dist/s_stat b/src/third_party/wiredtiger/dist/s_stat index d0ea3ab9cce..ecc8ee67e8e 100755 --- a/src/third_party/wiredtiger/dist/s_stat +++ b/src/third_party/wiredtiger/dist/s_stat @@ -16,7 +16,7 @@ l="$l `echo ../src/include/*.i ../src/include/os.h`" ( # Get the list of statistics fields. search=`sed \ - -e 's/^ int64_t \([a-z_*]*\);$/\1/p' \ + -e 's/^ int64_t \([a-z_*]*\);$/\1/p' \ -e d ../src/include/stat.h | sort` diff --git a/src/third_party/wiredtiger/dist/s_string.ok b/src/third_party/wiredtiger/dist/s_string.ok index 3f336d0443b..fd9eb3964c9 100644 --- a/src/third_party/wiredtiger/dist/s_string.ok +++ b/src/third_party/wiredtiger/dist/s_string.ok @@ -402,6 +402,7 @@ Uryyb VARCHAR VLDB VMSG +VPM VR VX Vc @@ -1342,6 +1343,7 @@ versa vfprintf vm vpack +vpmsum vprintf vrfy vsize diff --git a/src/third_party/wiredtiger/dist/s_style b/src/third_party/wiredtiger/dist/s_style index 9c1dd6fa506..7e835f6c880 100755 --- a/src/third_party/wiredtiger/dist/s_style +++ b/src/third_party/wiredtiger/dist/s_style @@ -187,24 +187,10 @@ else fi tr -cd '[:alnum:][:space:][:punct:]' < $f | - unexpand | - sed -e 's/){/) {/' \ - -e 's/\([ ]\)for(/\1for (/' \ - -e 's/\([ ]\)if(/\1if (/' \ - -e 's/\([ ]\)index(/\1strchr(/' \ - -e 's/\([ ]\)return(/\1return (/' \ - -e 's/\([ ]\)return \([^()]*\);/\1return (\2);/' \ - -e 's/\([ ]\)rindex(/\1strrchr(/' \ - -e 's/\([ ]\)sizeof (/\1sizeof(/g' \ - -e 's/\([ ]\)switch(/\1switch (/' \ - -e 's/\([ ]\)while(/\1while (/' \ - -e 's/\([|&=+-]\) *\([^*]\)/\1 \2/' \ - -e 's/[ ](void) \([a-zA-Z_]\)/(void)\1/' \ - -e '/for /!s/;;$/;/' \ + sed -e '/for /!s/;;$/;/' \ -e 's/(EOPNOTSUPP)/(ENOTSUP)/' \ -e 's/(unsigned)/(u_int)/' \ - -e 's/hazard reference/hazard pointer/' \ - -e 's/^#define /#define /' >$t + -e 's/hazard reference/hazard pointer/' >$t cmp $t $f > /dev/null 2>&1 || (echo "modifying $f" && cp $t $f) fi diff --git a/src/third_party/wiredtiger/dist/s_typedef b/src/third_party/wiredtiger/dist/s_typedef index 87b488fc3c9..22c72223c8c 100755 --- a/src/third_party/wiredtiger/dist/s_typedef +++ b/src/third_party/wiredtiger/dist/s_typedef @@ -21,11 +21,11 @@ build() { l=`ls ../src/include/*.[hi] ../src/include/*.in | sed -e '/wiredtiger.*/d' -e '/queue.h/d'` egrep -h \ - '^[ ]*(((struct|union)[ ].*__wt_.*{)|WT_PACKED_STRUCT_BEGIN)' \ + '^\s*(((struct|union)\s.*__wt_.*{)|WT_PACKED_STRUCT_BEGIN)' \ $l | sed -e 's/WT_PACKED_STRUCT_BEGIN(\(.*\))/struct \1 {/' \ -e 's/WT_COMPILER_TYPE_ALIGN(.*)[ ]*//' \ - -e 's/^[ ]*//' -e 's/[ ]*{.*//' | sort -u | \ + -e 's/^[ ]*//' -e 's/[ ]*{.*//' | sort -u | \ while read t n; do upper=`echo $n | sed -e 's/^__//' | tr [a-z] [A-Z]` echo "$t $n;" @@ -42,6 +42,7 @@ build() { -e 'p' \ -e '}' \ -e 'd' < $f) > $t + ./s_clang-format "${PWD}/$t" cmp $t $f > /dev/null 2>&1 || (echo "Building $f" && rm -f $f && cp $t $f) } diff --git a/src/third_party/wiredtiger/dist/s_void b/src/third_party/wiredtiger/dist/s_void index 2bb8b7abf0a..1b12ab09812 100755 --- a/src/third_party/wiredtiger/dist/s_void +++ b/src/third_party/wiredtiger/dist/s_void @@ -150,7 +150,6 @@ for f in `find bench ext src test -name '*.[ci]'`; do -e '/WT_CURSOR_NEEDKEY(/d' \ -e '/WT_CURSOR_NEEDVALUE(/d' \ -e '/WT_ERR[A-Z_]*(/d' \ - -e '/WT_ILLEGAL_VALUE[A-Z_]*(/d' \ -e '/WT_PANIC[A-Z_]*(/d' \ -e '/WT_RET[A-Z_]*(/d' \ -e '/WT_SIZE_CHECK_PACK(/d' \ @@ -179,7 +178,6 @@ for f in `find bench ext src test -name '*.[ci]'`; do -e '/WT_CURSOR_NEEDKEY/d' \ -e '/WT_CURSOR_NEEDVALUE/d' \ -e '/WT_ERR/d' \ - -e '/WT_ILLEGAL_VALUE_ERR/d' \ -e '/WT_SYSCALL.*ret/d' \ -e '/WT_TRET/d' \ -e 's/^\([^(]*\).*/\1/' \ diff --git a/src/third_party/wiredtiger/dist/stat.py b/src/third_party/wiredtiger/dist/stat.py index dfea67d8e21..2354c123a7d 100644 --- a/src/third_party/wiredtiger/dist/stat.py +++ b/src/third_party/wiredtiger/dist/stat.py @@ -2,7 +2,7 @@ # initialize and refresh code. import re, string, sys, textwrap -from dist import compare_srcfile +from dist import compare_srcfile, format_srcfile # Read the source files. from stat_data import groups, dsrc_stats, connection_stats, join_stats, \ @@ -39,6 +39,7 @@ for line in open('../src/include/stat.h', 'r'): print_struct('join cursors', 'join', 3000, join_stats) print_struct('session', 'session', 4000, session_stats) f.close() +format_srcfile(tmp_file) compare_srcfile(tmp_file, '../src/include/stat.h') def print_defines_one(capname, base, stats): @@ -256,4 +257,5 @@ print_func('connection', 'WT_CONNECTION_IMPL', connection_stats) print_func('join', None, join_stats) print_func('session', None, session_stats) f.close() +format_srcfile(tmp_file) compare_srcfile(tmp_file, '../src/support/stat.c') diff --git a/src/third_party/wiredtiger/dist/stat_data.py b/src/third_party/wiredtiger/dist/stat_data.py index 34d957a75ec..b1849c31fa9 100644 --- a/src/third_party/wiredtiger/dist/stat_data.py +++ b/src/third_party/wiredtiger/dist/stat_data.py @@ -220,13 +220,15 @@ connection_stats = [ CacheStat('cache_eviction_dirty', 'modified pages evicted'), CacheStat('cache_eviction_empty_score', 'eviction empty score', 'no_clear,no_scale'), CacheStat('cache_eviction_fail', 'pages selected for eviction unable to be evicted'), - CacheStat('cache_eviction_force', 'pages evicted because they exceeded the in-memory maximum count'), - CacheStat('cache_eviction_force_delete', 'pages evicted because they had chains of deleted items count'), - CacheStat('cache_eviction_force_delete_time', 'pages evicted because they had chains of deleted items time (usecs)'), - CacheStat('cache_eviction_force_fail', 'failed eviction of pages that exceeded the in-memory maximum count'), - CacheStat('cache_eviction_force_fail_time', 'failed eviction of pages that exceeded the in-memory maximum time (usecs)'), + CacheStat('cache_eviction_force', 'forced eviction - pages selected count'), + CacheStat('cache_eviction_force_clean', 'forced eviction - pages evicted that were clean count'), + CacheStat('cache_eviction_force_clean_time', 'forced eviction - pages evicted that were clean time (usecs)'), + CacheStat('cache_eviction_force_delete', 'forced eviction - pages selected because of too many deleted items count'), + CacheStat('cache_eviction_force_dirty', 'forced eviction - pages evicted that were dirty count'), + CacheStat('cache_eviction_force_dirty_time', 'forced eviction - pages evicted that were dirty time (usecs)'), + CacheStat('cache_eviction_force_fail', 'forced eviction - pages selected unable to be evicted count'), + CacheStat('cache_eviction_force_fail_time', 'forced eviction - pages selected unable to be evicted time'), CacheStat('cache_eviction_force_retune', 'force re-tuning of eviction workers once in a while'), - CacheStat('cache_eviction_force_time', 'pages evicted because they exceeded the in-memory maximum time (usecs)'), CacheStat('cache_eviction_get_ref', 'eviction calls to get a page'), CacheStat('cache_eviction_get_ref_empty', 'eviction calls to get a page found queue empty'), CacheStat('cache_eviction_get_ref_empty2', 'eviction calls to get a page found queue empty after locking'), @@ -235,6 +237,7 @@ connection_stats = [ CacheStat('cache_eviction_maximum_page_size', 'maximum page size at eviction', 'no_clear,no_scale,size'), CacheStat('cache_eviction_pages_queued', 'pages queued for eviction'), CacheStat('cache_eviction_pages_queued_oldest', 'pages queued for urgent eviction during walk'), + CacheStat('cache_eviction_pages_queued_post_lru', 'pages queued for eviction post lru sorting'), CacheStat('cache_eviction_pages_queued_urgent', 'pages queued for urgent eviction'), CacheStat('cache_eviction_pages_seen', 'pages seen by eviction walk'), CacheStat('cache_eviction_queue_empty', 'eviction server candidate queue empty when topping up'), @@ -253,6 +256,9 @@ connection_stats = [ CacheStat('cache_eviction_target_page_lt64', 'eviction walk target pages histogram - 32-63'), CacheStat('cache_eviction_walk', 'pages walked for eviction'), CacheStat('cache_eviction_walk_from_root', 'eviction walks started from root of tree'), + CacheStat('cache_eviction_walk_internal_yield', 'eviction server waiting for an internal page yields'), + CacheStat('cache_eviction_walk_internal_wait', 'eviction server waiting for an internal page sleep (usec)'), + CacheStat('cache_eviction_walk_leaf_notfound', 'eviction server waiting for a leaf page'), CacheStat('cache_eviction_walk_passes', 'eviction passes of a file'), CacheStat('cache_eviction_walk_saved_pos', 'eviction walks started from saved location in tree'), CacheStat('cache_eviction_walks_abandoned', 'eviction walks abandoned'), diff --git a/src/third_party/wiredtiger/dist/style.py b/src/third_party/wiredtiger/dist/style.py index 9336333cb67..d0cb9d78afc 100755 --- a/src/third_party/wiredtiger/dist/style.py +++ b/src/third_party/wiredtiger/dist/style.py @@ -15,7 +15,7 @@ def lines_could_join(): for m in match_re.finditer(s): if len(m.group(1).expandtabs()) + \ - len(m.group(2).expandtabs()) < 80: + len(m.group(2).expandtabs()) < 100: print f + ': lines may be combined: ' print '\t' + m.group(1).lstrip() + m.group(2) print |