Bug 1341962 - Update ccache stats parser for version 3.3.3. r=glandium
☠☠ backed out by e1b741382dc0 ☠ ☠
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 23 Feb 2017 11:35:39 +0800
changeset 394188 2a15e34e2d2241ed7f2072219b0c94d22d674878
parent 394187 eb4e310f304053f436b08ce6fdd0add014b7e1f6
child 394189 478066c98ffb371df13ac20e3156d469cbc1f0cb
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1341962
milestone54.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 1341962 - Update ccache stats parser for version 3.3.3. r=glandium The "unsupported code directive" is added to the 'ccache -s' output in https://github.com/ccache/ccache/commit/b6d7cf55028c4e23778fb02595e7d1ee6596a5a8 We need to teach our parser for it. MozReview-Commit-ID: IrrJv7I7BVa
python/mozbuild/mozbuild/controller/building.py
python/mozbuild/mozbuild/test/controller/test_ccachestats.py
--- a/python/mozbuild/mozbuild/controller/building.py
+++ b/python/mozbuild/mozbuild/controller/building.py
@@ -496,16 +496,17 @@ class CCacheStats(object):
         ('preprocessor_error', 'preprocessor error'),
         ('cant_use_pch', "can't use precompiled header"),
         ('compiler_missing', "couldn't find the compiler"),
         ('cache_file_missing', 'cache file missing'),
         ('bad_args', 'bad compiler arguments'),
         ('unsupported_lang', 'unsupported source language'),
         ('compiler_check_failed', 'compiler check failed'),
         ('autoconf', 'autoconf compile/link'),
+        ('unsupported_code_directive', 'unsupported code directive'),
         ('unsupported_compiler_option', 'unsupported compiler option'),
         ('out_stdout', 'output to stdout'),
         ('out_device', 'output to a non-regular file'),
         ('no_input', 'no input file'),
         ('bad_extra_file', 'error hashing extra file'),
         ('num_cleanups', 'cleanups performed'),
         ('cache_files', 'files in cache'),
         ('cache_size', 'cache size'),
--- a/python/mozbuild/mozbuild/test/controller/test_ccachestats.py
+++ b/python/mozbuild/mozbuild/test/controller/test_ccachestats.py
@@ -147,16 +147,38 @@ class TestCcacheStats(unittest.TestCase)
     unsupported compiler option          322
     no input file                     309538
     cleanups performed                     1
     files in cache                     17358
     cache size                          15.4 GB
     max cache size                      17.2 GB
     """
 
+    STAT7 = """
+    cache directory                     /Users/tlin/.ccache
+    primary config                      /Users/tlin/.ccache/ccache.conf
+    secondary config      (readonly)    /usr/local/Cellar/ccache/3.3.3/etc/ccache.conf
+    cache hit (direct)                 27035
+    cache hit (preprocessed)           13939
+    cache miss                         62630
+    cache hit rate                     39.55 %
+    called for link                     1280
+    called for preprocessing             736
+    compile failed                       550
+    preprocessor error                   638
+    bad compiler arguments                20
+    autoconf compile/link               1751
+    unsupported code directive             2
+    no input file                       2378
+    cleanups performed                  1792
+    files in cache                      3479
+    cache size                           4.4 GB
+    max cache size                       5.0 GB
+    """
+
     def test_parse_garbage_stats_message(self):
         self.assertRaises(ValueError, CCacheStats, self.STAT_GARBAGE)
 
     def test_parse_zero_stats_message(self):
         stats = CCacheStats(self.STAT0)
         self.assertEqual(stats.cache_dir, "/home/tlin/.ccache")
         self.assertEqual(stats.hit_rates(), (0, 0, 0))
 
@@ -192,17 +214,24 @@ class TestCcacheStats(unittest.TestCase)
         stat4 = CCacheStats(self.STAT4)
         stat5 = CCacheStats(self.STAT5)
         stats_diff = stat5 - stat4
         self.assertTrue(stat4)
         self.assertTrue(stat5)
         self.assertTrue(stats_diff)
 
     def test_stats_version33(self):
+        # Test stats for 3.3.2.
         stat3 = CCacheStats(self.STAT3)
         stat6 = CCacheStats(self.STAT6)
         stats_diff = stat6 - stat3
         self.assertTrue(stat6)
         self.assertTrue(stat3)
         self.assertTrue(stats_diff)
 
+        # Test stats for 3.3.3.
+        stat7 = CCacheStats(self.STAT7)
+        stats_diff = stat7 - stat6
+        self.assertTrue(stat7)
+        self.assertTrue(stats_diff)
+
 if __name__ == '__main__':
     main()