Commit b2942ae9 authored by Sergiy Belozorov's avatar Sergiy Belozorov Committed by Commit Bot

[tools] Remove RunnableGenericConfig and its corresponding tests

This is dead code as no benchmarks seem to be using it and removing this
additional logic will reduce maintenance cost for the perf infrastructure.

R=machenbach@chromium.org, tmrts@chromium.org

No-Try: true
No-Tree-Checks: true
Change-Id: I952af069d4d18d63624510b4c461fa1891703db9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1570008
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60947}
parent c8b5feec
......@@ -320,59 +320,6 @@ def AccumulateResults(
return res
def AccumulateGenericResults(graph_names, suite_units, output_iter):
"""Iterates over the output of multiple benchmark reruns and accumulates
generic results.
Args:
graph_names: List of names that configure the base path of the traces. E.g.
['v8', 'Octane'].
suite_units: Measurement default units as defined by the benchmark suite.
output_iter: Iterator over the output of each test run.
Returns: A 'Results' object.
"""
traces = OrderedDict()
for output in output_iter():
if output.stdout is None:
continue
for line in output.stdout.strip().splitlines():
match = GENERIC_RESULTS_RE.match(line)
if match:
stddev = ''
graph = match.group(1)
trace = match.group(2)
body = match.group(3)
units = match.group(4)
match_stddev = RESULT_STDDEV_RE.match(body)
match_list = RESULT_LIST_RE.match(body)
errors = []
if match_stddev:
result, stddev = map(str.strip, match_stddev.group(1).split(','))
results = [result]
elif match_list:
results = map(str.strip, match_list.group(1).split(','))
else:
results = [body.strip()]
try:
results = map(lambda r: str(float(r)), results)
except ValueError:
results = []
errors = ['Found non-numeric in %s' %
'/'.join(graph_names + [graph, trace])]
trace_result = traces.setdefault(trace, Results([{
'graphs': graph_names + [graph, trace],
'units': (units or suite_units).strip(),
'results': [],
'stddev': '',
}], errors))
trace_result.traces[0]['results'].extend(results)
trace_result.traces[0]['stddev'] = stddev
return reduce(lambda r, t: r + t, traces.itervalues(), Results())
class Node(object):
"""Represents a node in the suite tree structure."""
def __init__(self, *args):
......@@ -573,20 +520,6 @@ class RunnableTraceConfig(TraceConfig, RunnableConfig):
)
# TODO(sergiyb): Deprecate and remove. No benchmarks are using this code.
class RunnableGenericConfig(RunnableConfig):
"""Represents a runnable suite definition with generic traces."""
def __init__(self, suite, parent, arch):
super(RunnableGenericConfig, self).__init__(suite, parent, arch)
def Run(self, runner, trybot):
output, output_secondary = Unzip(runner())
return (
AccumulateGenericResults(self.graphs, self.units, output),
AccumulateGenericResults(self.graphs, self.units, output_secondary),
)
def MakeGraphConfig(suite, arch, parent):
"""Factory method for making graph configuration objects."""
if isinstance(parent, RunnableConfig):
......@@ -600,10 +533,6 @@ def MakeGraphConfig(suite, arch, parent):
else:
# This graph has no subgraphs, it's a leaf.
return RunnableTraceConfig(suite, parent, arch)
elif suite.get('generic'):
# This is a generic suite definition. It is either a runnable executable
# or has a main js file.
return RunnableGenericConfig(suite, parent, arch)
elif suite.get('tests'):
# This is neither a leaf nor a runnable.
return GraphConfig(suite, parent, arch)
......
......@@ -391,36 +391,6 @@ class PerfTest(unittest.TestCase):
self._VerifyMock(
os.path.join('out', 'x64.release', 'd7'), '--flag', 'run.js')
def testOneRunGeneric(self):
test_input = dict(V8_GENERIC_JSON)
self._WriteTestInput(test_input)
self._MockCommand(['.'], [
'RESULT Infra: Constant1= 11 count\n'
'RESULT Infra: Constant2= [10,5,10,15] count\n'
'RESULT Infra: Constant3= {12,1.2} count\n'
'RESULT Infra: Constant4= [10,5,error,15] count\n'])
self.assertEquals(1, self._CallMain())
self.assertEquals([
{'units': 'count',
'graphs': ['test', 'Infra', 'Constant1'],
'results': ['11.0'],
'stddev': ''},
{'units': 'count',
'graphs': ['test', 'Infra', 'Constant2'],
'results': ['10.0', '5.0', '10.0', '15.0'],
'stddev': ''},
{'units': 'count',
'graphs': ['test', 'Infra', 'Constant3'],
'results': ['12.0'],
'stddev': '1.2'},
{'units': 'count',
'graphs': ['test', 'Infra', 'Constant4'],
'results': [],
'stddev': ''},
], self._LoadResults()['traces'])
self._VerifyErrors(['Found non-numeric in test/Infra/Constant4'])
self._VerifyMock(os.path.join('out', 'x64.release', 'cc'), '--flag', '')
def testOneRunCrashed(self):
self._WriteTestInput(V8_JSON)
self._MockCommand(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment