Checking in version 1761 release binaries.

BUG=
R=chrisha@chromium.org

Review URL: https://codereview.appspot.com/13239047

git-svn-id: http://sawbuck.googlecode.com/svn/trunk/syzygy/binaries@1762 15e8cca8-e42c-11de-a347-f34a4f72eb7d
diff --git a/Benchmark_Chrome-0.1_r1737-py2.6.egg b/Benchmark_Chrome-0.1_r1737-py2.6.egg
index e4f5e9d..49db157 100644
--- a/Benchmark_Chrome-0.1_r1737-py2.6.egg
+++ b/Benchmark_Chrome-0.1_r1737-py2.6.egg
Binary files differ
diff --git a/ETW-0.6.5.0-py2.6.egg b/ETW-0.6.5.0-py2.6.egg
index 945f748..0e1bc5f 100644
--- a/ETW-0.6.5.0-py2.6.egg
+++ b/ETW-0.6.5.0-py2.6.egg
Binary files differ
diff --git a/ETW_Db-0.1_r1543-py2.6.egg b/ETW_Db-0.1_r1543-py2.6.egg
index 649c401..0947229 100644
--- a/ETW_Db-0.1_r1543-py2.6.egg
+++ b/ETW_Db-0.1_r1543-py2.6.egg
Binary files differ
diff --git a/exe/README.TXT b/exe/README.TXT
index 0cd563a..ce08063 100644
--- a/exe/README.TXT
+++ b/exe/README.TXT
@@ -1,8 +1,8 @@
 Syzygy Post-Link Transformation Toolchain

 =========================================

 

-Date:     2013/08/16

-Version:  0.2.28.0 (1739)

+Date:     2013/08/29

+Version:  0.2.29.0 (1761)

 

 The Syzygy project consists of a suite of tools for the instrumentation of

 PE binaries. The various instrumentation modes allow for computing code

@@ -143,6 +143,13 @@
 timed_decomposer.exe

   Repeatedly runs decomposition and reports timing information.

 

+Experimental Python Scripts

+---------------------------

+

+convert_code_tally.py

+  Convert a JSON file generated by code_tally.exe into a format that can be

+  uploaded to the Chromium size viewer app engine instance.

+

 

 USAGE

 -----

diff --git a/exe/RELEASE-NOTES.TXT b/exe/RELEASE-NOTES.TXT
index 7ab7af4..5dce416 100644
--- a/exe/RELEASE-NOTES.TXT
+++ b/exe/RELEASE-NOTES.TXT
@@ -1,6 +1,14 @@
 Syzygy Release Notes

 ====================

 

+Version 0.2.29.0

+

+[r1759] SyzyASan - Add ASAN RTL support for a quarantine size/trailer padding

+        size experiment.

+[r1758] SyzyASan - Use the CRT interceptors by default.

+[r1750] SyzyASan - Adds a parameter to the command line to specify the blocks

+        padding size.

+

 Version 0.2.28.0

 

 [r1738] SyzyASan - Support for new Breakpad exported functions.

diff --git a/exe/agent_logger.exe b/exe/agent_logger.exe
index cc40437..2010dbe 100644
--- a/exe/agent_logger.exe
+++ b/exe/agent_logger.exe
Binary files differ
diff --git a/exe/asan_rtl.dll b/exe/asan_rtl.dll
index 83216f7..7193336 100644
--- a/exe/asan_rtl.dll
+++ b/exe/asan_rtl.dll
Binary files differ
diff --git a/exe/asan_rtl.dll.pdb b/exe/asan_rtl.dll.pdb
index e81d9a7..82c846c 100644
--- a/exe/asan_rtl.dll.pdb
+++ b/exe/asan_rtl.dll.pdb
Binary files differ
diff --git a/exe/basic_block_entry_client.dll b/exe/basic_block_entry_client.dll
index ae50829..31400dc 100644
--- a/exe/basic_block_entry_client.dll
+++ b/exe/basic_block_entry_client.dll
Binary files differ
diff --git a/exe/basic_block_entry_client.dll.pdb b/exe/basic_block_entry_client.dll.pdb
index b5ce14a..cd10a91 100644
--- a/exe/basic_block_entry_client.dll.pdb
+++ b/exe/basic_block_entry_client.dll.pdb
Binary files differ
diff --git a/exe/call_trace_client.dll b/exe/call_trace_client.dll
index e2c919f..92053d6 100644
--- a/exe/call_trace_client.dll
+++ b/exe/call_trace_client.dll
Binary files differ
diff --git a/exe/call_trace_client.dll.pdb b/exe/call_trace_client.dll.pdb
index 88ff046..a691ef5 100644
--- a/exe/call_trace_client.dll.pdb
+++ b/exe/call_trace_client.dll.pdb
Binary files differ
diff --git a/exe/call_trace_control.exe b/exe/call_trace_control.exe
index 0865f04..20b0233 100644
--- a/exe/call_trace_control.exe
+++ b/exe/call_trace_control.exe
Binary files differ
diff --git a/exe/call_trace_service.exe b/exe/call_trace_service.exe
index 011cea1..76b2901 100644
--- a/exe/call_trace_service.exe
+++ b/exe/call_trace_service.exe
Binary files differ
diff --git a/exe/coverage_client.dll b/exe/coverage_client.dll
index c6327b4..3086378 100644
--- a/exe/coverage_client.dll
+++ b/exe/coverage_client.dll
Binary files differ
diff --git a/exe/coverage_client.dll.pdb b/exe/coverage_client.dll.pdb
index 9ab206f..d012aa3 100644
--- a/exe/coverage_client.dll.pdb
+++ b/exe/coverage_client.dll.pdb
Binary files differ
diff --git a/exe/decompose.exe b/exe/decompose.exe
index 19ebeb6..cb20445 100644
--- a/exe/decompose.exe
+++ b/exe/decompose.exe
Binary files differ
diff --git a/exe/decompose_image_to_text.exe b/exe/decompose_image_to_text.exe
index 958265f..e651621 100644
--- a/exe/decompose_image_to_text.exe
+++ b/exe/decompose_image_to_text.exe
Binary files differ
diff --git a/exe/dump_trace.exe b/exe/dump_trace.exe
index 6b3217d..045a4a6 100644
--- a/exe/dump_trace.exe
+++ b/exe/dump_trace.exe
Binary files differ
diff --git a/exe/experimental/code_tally.exe b/exe/experimental/code_tally.exe
index 756cade..792f20a 100644
--- a/exe/experimental/code_tally.exe
+++ b/exe/experimental/code_tally.exe
Binary files differ
diff --git a/exe/experimental/compare.exe b/exe/experimental/compare.exe
index 24f79b1..449bfaf 100644
--- a/exe/experimental/compare.exe
+++ b/exe/experimental/compare.exe
Binary files differ
diff --git a/exe/experimental/convert_code_tally.py b/exe/experimental/convert_code_tally.py
new file mode 100644
index 0000000..c708b93
--- /dev/null
+++ b/exe/experimental/convert_code_tally.py
@@ -0,0 +1,215 @@
+#!/usr/bin/python2.7
+#
+# Copyright 2013 Google Inc. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Convert a code_tally.exe json file to a json file that can be uploaded to
+# the app engine size server.
+
+
+import json
+import optparse
+import os
+import sys
+
+
+def _json_default(obj):
+  """Handles JSON serializablity of Entity class."""
+  if isinstance(obj, Entity):
+    return obj.__dict__
+  raise TypeError(repr(obj) + ' is not JSON serializable')
+
+
+class Entity(object):
+  """An entity is a unit representing a single source file or folder that
+  contributed to the dll.
+  """
+
+  def __init__(self, parent, name, size, is_directory=False):
+    self.parent = parent
+    self.name = name
+    self.size = size
+    self.is_directory = is_directory
+
+
+def _normalize_paths(input_json):
+  """Ensure that all paths are lower case (to prevent potential mis-matches,
+  since Windows is case-insensitive.
+  """
+  normalized_json = input_json.copy()
+  for i in range(len(normalized_json['sources'])):
+    normalized_json['sources'][i] = normalized_json['sources'][i].lower()
+
+  return normalized_json
+
+
+def _calculate_sizes(input_json):
+  """Calculate the sizes of all the source files, returning a list of floats
+  representing the size in the same order as input_json['sources'].
+  """
+  source_sizes = [0.0] * len(input_json['sources'])
+
+  for obj_name, value in input_json['objects'].iteritems():
+    for func_name, func_prop in value.iteritems():
+      # Even if we have the size property, without the contribs we are unable
+      # to properly assign the sizes.
+      if 'contribs' not in func_prop:
+        continue
+
+      contribs = func_prop['contribs']
+      # The contribs value is a list where all the even elements are the source
+      # file number, and the odd elements are the contributions for that file
+      # (of the form [line position, size, line position, size, etc...]).
+      contributors = contribs[::2]
+      sizes = contribs[1::2]
+      for contributor, size in zip(contributors, sizes):
+        # TODO: include the line positions in the converted data.
+        line_positions = size[::2]
+        line_contributions = size[1::2]
+
+        source_sizes[contributor] += sum(line_contributions)
+
+  return source_sizes
+
+
+def _generate_source_tree(sources, sizes):
+  """Generates a dict equivalent to the source tree. Each element is either a
+  file (so its value is its size) or a folder (so its value is a dictionary of
+  all the files or folders found inside it).
+
+  |sources| is a list of files to build the source tree out of, and |sizes|
+  has the size for every file in |sources|.
+
+  An example of a dict that might get returned:
+  {
+    'c': {
+        'file1': 18.0,
+        'folder': {'file2': 20}
+         }
+  }
+  """
+  source_tree = {}
+  for filepath, size in zip(sources, sizes):
+    split_path = filepath.split('\\')
+
+    # Ensure that all the parent folders have been created.
+    parent = source_tree
+    for section in split_path[:-1]:
+      parent = parent.setdefault(section, {})
+
+    # Set the appropriate size for the file.
+    parent[split_path[-1]] = size
+
+  return source_tree
+
+
+def _convert_subtree_to_entities(source_tree, parent):
+  """Given a |source_tree| dictionary representing files and folders, rooted at
+  |parent|, return the list of entities that contains all the tree's elements.
+
+  An example of the |source_tree| input is:
+  {
+    'c': {
+        'file1': 18.0,
+        'folder': {'file2': 20}
+         }
+  }
+  """
+  entities = []
+  for key, value in source_tree.iteritems():
+    if isinstance(value, float):
+      # A basic file entity.
+      entities.append(Entity(parent, name=key, size=value))
+    else:
+      new_parent = key if not parent else parent + '\\' + key
+      children = _convert_subtree_to_entities(value, new_parent)
+
+      # Find the size of this directory, based on the sizes of it children.
+      # Ignore any children's children, since they are already included in
+      # their parent's sum.
+      total_size = sum([child.size for child in children
+                        if child.parent == new_parent])
+
+      entities.extend(children)
+      entities.append(
+          Entity(parent, name=key, size=total_size, is_directory=True))
+
+  return entities
+
+
+def _generate_entities(input_json):
+  """Convert the given input json data to a list of entities."""
+  normalized_json = _normalize_paths(input_json)
+
+  sizes = _calculate_sizes(normalized_json)
+  source_tree = _generate_source_tree(normalized_json['sources'], sizes)
+
+  return _convert_subtree_to_entities(source_tree, '')
+
+
+def _output_converted_json(output_file, options, name, entities):
+  """Store the list of entities in the given output file, also including the
+  appropriate general fields (such as builder name, builder number, etc).
+  """
+  output_json = {
+      'master.id': options.master_id,
+      'buildername': options.builder_name,
+      'buildnumber': options.build_number,
+      'name': name,
+      'revision': options.revision,
+      'entities': entities,
+      }
+
+  print 'Saving converted file \'%s\'' % output_file
+  json.dump(output_json, output_file, indent=2, default=_json_default)
+
+
+def main():
+  usage = "usage: %prog [options] input_code_tally_file output_json_file"
+  parser = optparse.OptionParser(usage=usage)
+  parser.add_option('--master_id', default='master',
+                    help='The master of the machine that generated the code '
+                         'tally.')
+  parser.add_option('--builder_name', default='builder',
+                    help='The name of the builder that generated the code '
+                    'tally.')
+  parser.add_option('--build_number', default='1',
+                    help='The build number.')
+  parser.add_option('--revision', default='1',
+                    help='The revision of the code this code tally refers to.')
+  (options, args) = parser.parse_args()
+
+  if len(args) != 2:
+    parser.error('Please list the input and output files.')
+
+  input_file = args[0]
+  output_file = args[1]
+
+  if not os.path.exists(input_file):
+    parser.error('The given input file, \'%s\', doesn\'t exist' % input_file)
+
+  with open(input_file, 'r') as f:
+    input_data = json.load(f)
+
+  entities = _generate_entities(input_json)
+
+  with open(output_file, 'w') as f:
+    _output_converted_json(f,
+                           options,
+                           input_json['executable']['name'],
+                           entities)
+
+
+if __name__ == '__main__':
+  sys.exit(main())
diff --git a/exe/experimental/pdb_dumper.exe b/exe/experimental/pdb_dumper.exe
index 3f07129..30beacd 100644
--- a/exe/experimental/pdb_dumper.exe
+++ b/exe/experimental/pdb_dumper.exe
Binary files differ
diff --git a/exe/experimental/timed_decomposer.exe b/exe/experimental/timed_decomposer.exe
index 771e43e..6a706d9 100644
--- a/exe/experimental/timed_decomposer.exe
+++ b/exe/experimental/timed_decomposer.exe
Binary files differ
diff --git a/exe/genfilter.exe b/exe/genfilter.exe
index bb9d42f..b99ffe6 100644
--- a/exe/genfilter.exe
+++ b/exe/genfilter.exe
Binary files differ
diff --git a/exe/grinder.exe b/exe/grinder.exe
index ae80101..fbef978 100644
--- a/exe/grinder.exe
+++ b/exe/grinder.exe
Binary files differ
diff --git a/exe/instrument.exe b/exe/instrument.exe
index ce4a2d1..cf8c3d2 100644
--- a/exe/instrument.exe
+++ b/exe/instrument.exe
Binary files differ
diff --git a/exe/pdbfind.exe b/exe/pdbfind.exe
index a8099e2..b398385 100644
--- a/exe/pdbfind.exe
+++ b/exe/pdbfind.exe
Binary files differ
diff --git a/exe/profile_client.dll b/exe/profile_client.dll
index 990932c..b33ba93 100644
--- a/exe/profile_client.dll
+++ b/exe/profile_client.dll
Binary files differ
diff --git a/exe/profile_client.dll.pdb b/exe/profile_client.dll.pdb
index 1549059..583d882 100644
--- a/exe/profile_client.dll.pdb
+++ b/exe/profile_client.dll.pdb
Binary files differ
diff --git a/exe/relink.exe b/exe/relink.exe
index 178d2ab..7456f20 100644
--- a/exe/relink.exe
+++ b/exe/relink.exe
Binary files differ
diff --git a/exe/reorder.exe b/exe/reorder.exe
index 12cfb2a..c79a0d6 100644
--- a/exe/reorder.exe
+++ b/exe/reorder.exe
Binary files differ
diff --git a/exe/run_in_snapshot.exe b/exe/run_in_snapshot.exe
index 8c6d79e..3ffbe02 100644
--- a/exe/run_in_snapshot.exe
+++ b/exe/run_in_snapshot.exe
Binary files differ
diff --git a/exe/run_in_snapshot_x64.exe b/exe/run_in_snapshot_x64.exe
index 3e8a114..6ee2e37 100644
--- a/exe/run_in_snapshot_x64.exe
+++ b/exe/run_in_snapshot_x64.exe
Binary files differ
diff --git a/exe/run_in_snapshot_xp.exe b/exe/run_in_snapshot_xp.exe
index f6dc9f4..fafcefc 100644
--- a/exe/run_in_snapshot_xp.exe
+++ b/exe/run_in_snapshot_xp.exe
Binary files differ
diff --git a/exe/sampler.exe b/exe/sampler.exe
index 74c921d..2979c41 100644
--- a/exe/sampler.exe
+++ b/exe/sampler.exe
Binary files differ
diff --git a/exe/simulate.exe b/exe/simulate.exe
index 33de075..6eaa58c 100644
--- a/exe/simulate.exe
+++ b/exe/simulate.exe
Binary files differ
diff --git a/exe/wsdump.exe b/exe/wsdump.exe
index 787d0f8..bc0087d 100644
--- a/exe/wsdump.exe
+++ b/exe/wsdump.exe
Binary files differ
diff --git a/exe/zap_timestamp.exe b/exe/zap_timestamp.exe
index 98bcadb..b4f7e35 100644
--- a/exe/zap_timestamp.exe
+++ b/exe/zap_timestamp.exe
Binary files differ