summaryrefslogtreecommitdiffstats
path: root/tools/perf_expectations/make_expectations.py
diff options
context:
space:
mode:
authorjvoung@google.com <jvoung@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-19 20:37:13 +0000
committerjvoung@google.com <jvoung@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-19 20:37:13 +0000
commitb0a39178d73b6592dcf24114e53947d070399bab (patch)
tree6040f2492ec4b1df365138d64fddcf392d0e2137 /tools/perf_expectations/make_expectations.py
parent49e44ddbb8a44bf21bd75ec086f661f04682548d (diff)
downloadchromium_src-b0a39178d73b6592dcf24114e53947d070399bab.zip
chromium_src-b0a39178d73b6592dcf24114e53947d070399bab.tar.gz
chromium_src-b0a39178d73b6592dcf24114e53947d070399bab.tar.bz2
Refactor make_expectations to make it easier to override the base_url
and the expectations file. This will allow NaCl to DEPs in the whole src/tools/perf_expectations directory, yet still have its own values. Also ends up checking in NaCl perf expectation values... BUG= http://code.google.com/p/nativeclient/issues/detail?id=1479 TEST= ./make_expectations && ./make_expectations -c ../nacl_perf_expectations.cfg (test placing the file in another directory) Review URL: http://codereview.chromium.org/7409007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93092 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/perf_expectations/make_expectations.py')
-rwxr-xr-xtools/perf_expectations/make_expectations.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/tools/perf_expectations/make_expectations.py b/tools/perf_expectations/make_expectations.py
index bd6018a..fef237e 100755
--- a/tools/perf_expectations/make_expectations.py
+++ b/tools/perf_expectations/make_expectations.py
@@ -7,6 +7,7 @@
import hashlib
import math
import optparse
+import os
import re
import subprocess
import sys
@@ -21,7 +22,7 @@ except ImportError:
__version__ = '1.0'
-DEFAULT_EXPECTATIONS_FILE = 'perf_expectations.json'
+DEFAULT_CONFIG_FILE = 'chromium_perf_expectations.cfg'
DEFAULT_VARIANCE = 0.05
USAGE = ''
@@ -132,14 +133,22 @@ def Main(args):
parser = optparse.OptionParser(usage=USAGE, version=__version__)
parser.add_option('-v', '--verbose', action='store_true', default=False,
help='enable verbose output')
+ parser.add_option('-c', '--config', dest='config_file',
+ default=DEFAULT_CONFIG_FILE,
+ help='set the config file to FILE', metavar='FILE')
options, args = parser.parse_args(args)
if options.verbose:
print 'Verbose output enabled.'
+ config = ConvertJsonIntoDict(ReadFile(options.config_file))
+
# Get the list of summaries for a test.
- base_url = 'http://build.chromium.org/f/chromium/perf'
- perf = ConvertJsonIntoDict(ReadFile(DEFAULT_EXPECTATIONS_FILE))
+ base_url = config['base_url']
+ # Make the perf expectations file relative to the path of the config file.
+ perf_file = os.path.join(
+ os.path.dirname(options.config_file), config['perf_file'])
+ perf = ConvertJsonIntoDict(ReadFile(perf_file))
# Fetch graphs.dat for this combination.
perfkeys = perf.keys()
@@ -293,7 +302,7 @@ def Main(args):
if write_new_expectations:
print '\nWriting expectations... ',
- WriteJson(DEFAULT_EXPECTATIONS_FILE, perf, perfkeys)
+ WriteJson(perf_file, perf, perfkeys)
print 'done'
else:
if options.verbose: