Bug 914563 - re-enable build resource recording on Windows; r=gps
authorMike Shal <mshal@mozilla.com>
Tue, 15 Jul 2014 13:59:10 -0400
changeset 195343 ade872c15c024a3266722c096d40e52ed70d202e
parent 195342 1e4bf244a89c037e5d585889a58844fc112f5ab7
child 195344 8e5e7c9c0d66f1b5b827159cd4db6fd95dfbe416
push id27177
push userkwierso@gmail.com
push dateTue, 22 Jul 2014 01:00:35 +0000
treeherdermozilla-central@3b3ba206fc05 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs914563
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 914563 - re-enable build resource recording on Windows; r=gps
mach
python/mozbuild/mozbuild/controller/building.py
--- a/mach
+++ b/mach
@@ -66,27 +66,27 @@ def main(args):
     sys.exit(1)
 
 
 if __name__ == '__main__':
     if sys.platform == 'win32':
         # This is a complete hack to work around the fact that Windows
         # multiprocessing needs to import the original module (ie: this
         # file), but only works if it has a .py extension.
-	#
-	# We do this by a sort of two-level function interposing. The first
-	# level interposes forking.get_command_line() with our version defined
-	# in my_get_command_line(). Our version of get_command_line will
-	# replace the command string with the contents of the fork_interpose()
-	# function to be used in the subprocess.
-	#
-	# The subprocess then gets an interposed imp.find_module(), which we
-	# hack up to find 'mach' without the .py extension, since we already
-	# know where it is (it's us!). If we're not looking for 'mach', then
-	# the original find_module will suffice.
+        #
+        # We do this by a sort of two-level function interposing. The first
+        # level interposes forking.get_command_line() with our version defined
+        # in my_get_command_line(). Our version of get_command_line will
+        # replace the command string with the contents of the fork_interpose()
+        # function to be used in the subprocess.
+        #
+        # The subprocess then gets an interposed imp.find_module(), which we
+        # hack up to find 'mach' without the .py extension, since we already
+        # know where it is (it's us!). If we're not looking for 'mach', then
+        # the original find_module will suffice.
         #
         # See also: http://bugs.python.org/issue19946
         # And: https://bugzilla.mozilla.org/show_bug.cgi?id=914563
         import inspect
         from multiprocessing import forking
         global orig_command_line
 
         def fork_interpose():
@@ -101,17 +101,17 @@ if __name__ == '__main__':
                 return orig_find_module(name, dirs)
 
             imp.find_module = my_find_module
             from multiprocessing.forking import main; main()
 
         def my_get_command_line():
             fork_code, lineno = inspect.getsourcelines(fork_interpose)
             # Remove the first line (for 'def fork_interpose():') and the three
-	    # levels of indentation (12 spaces).
+            # levels of indentation (12 spaces).
             fork_string = ''.join(x[12:] for x in fork_code[1:])
             cmdline = orig_command_line()
             cmdline[2] = fork_string
             return cmdline
         orig_command_line = forking.get_command_line
         forking.get_command_line = my_get_command_line
 
     main(sys.argv[1:])
--- a/python/mozbuild/mozbuild/controller/building.py
+++ b/python/mozbuild/mozbuild/controller/building.py
@@ -176,22 +176,16 @@ class BuildMonitor(MozbuildObject):
 
     def start(self):
         """Record the start of the build."""
         self.start_time = time.time()
         self._finder_start_cpu = self._get_finder_cpu_usage()
 
     def start_resource_recording(self):
         # This should be merged into start() once bug 892342 lands.
-
-        # Resource monitoring on Windows is currently busted because of
-        # multiprocessing issues. Bug 914563.
-        if self._is_windows():
-            return
-
         self.resources.start()
         self._resources_started = True
 
     def on_line(self, line):
         """Consume a line of output from the build system.
 
         This will parse the line for state and determine whether more action is
         needed.