Index: lnt/lnttool/viewcomparison.py =================================================================== --- lnt/lnttool/viewcomparison.py +++ lnt/lnttool/viewcomparison.py @@ -89,7 +89,7 @@ with contextlib.closing(config.get_database('default')) as db: session = db.make_session() import_and_report(config, 'default', db, session, report_a, - '', testsuite, select_machine='match') + '', testsuite, select_machine='match') import_and_report(config, 'default', db, session, report_b, '', testsuite, select_machine='match') Index: lnt/server/db/testsuitedb.py =================================================================== --- lnt/server/db/testsuitedb.py +++ lnt/server/db/testsuitedb.py @@ -59,7 +59,7 @@ self.order_fields = list(self.test_suite.order_fields) self.run_fields = list(self.test_suite.run_fields) self.sample_fields = list(sorted(self.test_suite.sample_fields, - key = lambda s: s.schema_index)) + key = lambda s: s.schema_index)) self.machine_to_latest_order_cache = {} sample_field_indexes = dict() Index: lnt/server/reporting/latestrunsreport.py =================================================================== --- lnt/server/reporting/latestrunsreport.py +++ lnt/server/reporting/latestrunsreport.py @@ -24,7 +24,8 @@ field_results = [] for machine in machines: machine_results = [] - machine_runs = list(reversed(session.query(ts.Run) + machine_runs = list(reversed( + session.query(ts.Run) .filter(ts.Run.machine_id == machine.id) .order_by(ts.Run.start_time.desc()) .limit(self.run_count) @@ -38,12 +39,12 @@ # take all tests from latest run and do a comparison oldest_run = machine_runs[0] - run_tests = session.query(ts.Test) \ - .join(ts.Sample) \ - .join(ts.Run) \ - .filter(ts.Sample.run_id == oldest_run.id) \ - .filter(ts.Sample.test_id == ts.Test.id) \ - .all() + run_tests = (session.query(ts.Test) + .join(ts.Sample) + .join(ts.Run) + .filter(ts.Sample.run_id == oldest_run.id) + .filter(ts.Sample.test_id == ts.Test.id) + .all()) # Create a run info object. sri = lnt.server.reporting.analysis.RunInfo(session, ts, machine_runs_ids) Index: lnt/server/reporting/report.py =================================================================== --- lnt/server/reporting/report.py +++ lnt/server/reporting/report.py @@ -126,9 +126,9 @@ report_css_styles = { "body": ("color:#000000; background-color:#ffffff; " - "font-family: Helvetica, sans-serif; font-size:9pt"), + "font-family: Helvetica, sans-serif; font-size:9pt"), "table": ("font-size:9pt; border-spacing: 0px; " - "border: 1px solid black"), + "border: 1px solid black"), "th": ( "background-color:#eee; color:#666666; font-weight: bold; " "cursor: default; text-align:center; font-weight: bold; " Index: lnt/server/ui/regression_views.py =================================================================== --- lnt/server/ui/regression_views.py +++ lnt/server/ui/regression_views.py @@ -60,7 +60,7 @@ regression, _ = new_regression(session, ts, form.field_changes.data) flash("Created " + regression.title, FLASH_SUCCESS) return v4_redirect(v4_url_for(".v4_regression_list", - highlight=regression.id)) + highlight=regression.id)) if request.method == 'POST' and request.form['btn'] == "Ignore Changes": msg = "Ignoring changes: " ignored = [] @@ -158,7 +158,7 @@ links.append(r.bug) new_regress, _ = new_regression(session, ts, - [x.field_change_id for x in reg_inds]) + [x.field_change_id for x in reg_inds]) new_regress.state = regressions[target].state new_regress.title = regressions[target].title new_regress.bug = ' '.join(links) @@ -298,8 +298,8 @@ session.commit() flash("Updated " + regression_info.title, FLASH_SUCCESS) return v4_redirect(v4_url_for(".v4_regression_list", - highlight=regression_info.id, - state=int(form.edit_state.data))) + highlight=regression_info.id, + state=int(form.edit_state.data))) if request.method == 'POST' and \ request.form['save_btn'] == "Split Regression": # For each of the regression indicators, grab their field ids. @@ -318,8 +318,8 @@ session.commit() flash("Split " + second_regression.title, FLASH_SUCCESS) return v4_redirect(v4_url_for(".v4_regression_list", - highlight=second_regression.id, - state=int(form.edit_state.data))) + highlight=second_regression.id, + state=int(form.edit_state.data))) if request.method == 'POST' and request.form['save_btn'] == "Delete": # For each of the regression indicators, grab their field ids. title = regression_info.title @@ -334,7 +334,7 @@ session.commit() flash("Deleted " + title, FLASH_SUCCESS) return v4_redirect(v4_url_for(".v4_regression_list", - state=int(form.edit_state.data))) + state=int(form.edit_state.data))) form.field_changes.choices = list() form.state.default = regression_info.state form.process() Index: lnt/server/ui/views.py =================================================================== --- lnt/server/ui/views.py +++ lnt/server/ui/views.py @@ -288,7 +288,7 @@ .first() return v4_redirect(v4_url_for('.v4_run', id=machine_1_run.id, - compare_to=machine_2_run.id)) + compare_to=machine_2_run.id)) @v4_route("/machine/") @@ -468,7 +468,7 @@ # If we found one, redirect to it's report. if matched_run is not None: return v4_redirect(db_url_for(".v4_run", testsuite_name=tag, - id=matched_run.id)) + id=matched_run.id)) # Otherwise, report an error. return render_template("error.html", message="""\ @@ -1421,8 +1421,8 @@ extra_args.pop("day", None) return v4_redirect(v4_url_for(".v4_daily_report", - year=date.year, month=date.month, day=date.day, - **extra_args)) + year=date.year, month=date.month, + day=date.day, **extra_args)) @v4_route("/daily_report///") Index: lnt/tests/nt.py =================================================================== --- lnt/tests/nt.py +++ lnt/tests/nt.py @@ -1716,7 +1716,7 @@ for i in range(opts.multisample): print("%s: (multisample) running iteration %d" %\ - (timestamp(), i), file=sys.stderr) + (timestamp(), i), file=sys.stderr) report = run_test(opts.label, i, config) reports.append(report) Index: tests/server/db/ImportV4TestSuiteInstance.py =================================================================== --- tests/server/db/ImportV4TestSuiteInstance.py +++ tests/server/db/ImportV4TestSuiteInstance.py @@ -134,9 +134,9 @@ assert sorted(run_b.parameters.items()) == [('inferred_run_order', '2')] # Validate the samples. -samples = list(session.query(ts.Sample)\ - .join(ts.Run) \ - .order_by(ts.Run.order_id, ts.Sample.id)) +samples = list(session.query(ts.Sample) + .join(ts.Run) + .order_by(ts.Run.order_id, ts.Sample.id)) assert len(samples) == 3 sample_a_0, sample_a_1, sample_b = samples assert sample_a_0.run is run_a Index: tests/testing/cPerf.py =================================================================== --- tests/testing/cPerf.py +++ tests/testing/cPerf.py @@ -13,112 +13,148 @@ 'Inputs') self.fake_nm = 'python %s/fake-nm.py' % self.inputs - self.expected_data = {'fib-aarch64': {u'counters': {u'cycles': 240949386}, - u'functions': {u'fib': {u'counters': {u'cycles': 99.77243187496647}, - u'data': [[{u'cycles': 22.476272172208624}, - 4196040, - u'\ta9be4ff4 \tstp\tx20, x19, [sp,#-32]!'], - [{u'cycles': 20.81533649797271}, - 4196044, - u'\ta9017bfd \tstp\tx29, x30, [sp,#16]'], - [{}, - 4196048, - u'\t910043fd \tadd\tx29, sp, #0x10'], - [{}, - 4196052, - u'\t71000813 \tsubs\tw19, w0, #0x2'], - [{}, - 4196056, - u'\t540000eb \tb.lt\t4006f4 '], - [{u'cycles': 10.065491723992467}, - 4196060, - u'\t51000400 \tsub\tw0, w0, #0x1'], - [{}, - 4196064, - u'\t97fffffa \tbl\t4006c8 '], - [{u'cycles': 5.858831022967777}, - 4196068, - u'\t2a0003f4 \tmov\tw20, w0'], - [{}, - 4196072, - u'\t2a1303e0 \tmov\tw0, w19'], - [{}, - 4196076, - u'\t97fffff7 \tbl\t4006c8 '], - [{u'cycles': 7.57924022814841}, - 4196080, - u'\t0b140000 \tadd\tw0, w0, w20'], - [{u'cycles': 19.240308514111305}, - 4196084, - u'\ta9417bfd \tldp\tx29, x30, [sp,#16]'], - [{u'cycles': 13.964519840598708}, - 4196088, - u'\ta8c24ff4 \tldp\tx20, x19, [sp],#32'], - [{}, - 4196092, - u'\td65f03c0 \tret']]}}}, - 'fib2-aarch64': {u'counters': {u'branch-misses': 1820692, - u'cache-misses': 33054, - u'cycles': 243618286}, - u'functions': {u'fib': {u'counters': {u'branch-misses': 99.7405382129432, - u'cache-misses': 75.18000847098688, - u'cycles': 99.78902404723429}, - u'data': [[{u'branch-misses': 21.904846340904687, - u'cache-misses': 37.4486921529175, - u'cycles': 23.48637833693693}, - 4196040, - u'\ta9be4ff4 \tstp\tx20, x19, [sp,#-32]!'], - [{u'branch-misses': 2.6443747907452115, - u'cache-misses': 17.08651911468813, - u'cycles': 20.34001001463117}, - 4196044, - u'\ta9017bfd \tstp\tx29, x30, [sp,#16]'], - [{}, - 4196048, - u'\t910043fd \tadd\tx29, sp, #0x10'], - [{}, - 4196052, - u'\t71000813 \tsubs\tw19, w0, #0x2'], - [{}, - 4196056, - u'\t540000eb \tb.lt\t4006f4 '], - [{u'branch-misses': 30.264575146698622, - u'cache-misses': 20.69215291750503, - u'cycles': 9.787981545863996}, - 4196060, - u'\t51000400 \tsub\tw0, w0, #0x1'], - [{}, - 4196064, - u'\t97fffffa \tbl\t4006c8 '], - [{u'branch-misses': 0.11195131191739062, - u'cache-misses': 2.3621730382293764, - u'cycles': 7.702120542412432}, - 4196068, - u'\t2a0003f4 \tmov\tw20, w0'], - [{}, - 4196072, - u'\t2a1303e0 \tmov\tw0, w19'], - [{}, - 4196076, - u'\t97fffff7 \tbl\t4006c8 '], - [{u'branch-misses': 19.03265916580028, - u'cache-misses': 3.8229376257545273, - u'cycles': 7.362266427937867}, - 4196080, - u'\t0b140000 \tadd\tw0, w0, w20'], - [{u'branch-misses': 4.9891297644011345, - u'cache-misses': 7.553319919517103, - u'cycles': 18.387547715628735}, - 4196084, - u'\ta9417bfd \tldp\tx29, x30, [sp,#16]'], - [{u'branch-misses': 21.05246347953268, - u'cache-misses': 11.03420523138833, - u'cycles': 12.93369541658887}, - 4196088, - u'\ta8c24ff4 \tldp\tx20, x19, [sp],#32'], - [{}, - 4196092, - u'\td65f03c0 \tret']]}}}} + self.expected_data = { + "fib-aarch64": { + u"counters": {u"cycles": 240949386}, + u"functions": { + u"fib": { + u"counters": {u"cycles": 99.77243187496647}, + u"data": [ + [ + {u"cycles": 22.476272172208624}, + 4196040, + u"\ta9be4ff4 \tstp\tx20, x19, [sp,#-32]!", + ], + [ + {u"cycles": 20.81533649797271}, + 4196044, + u"\ta9017bfd \tstp\tx29, x30, [sp,#16]", + ], + [{}, 4196048, u"\t910043fd \tadd\tx29, sp, #0x10"], + [{}, 4196052, u"\t71000813 \tsubs\tw19, w0, #0x2"], + [{}, 4196056, u"\t540000eb \tb.lt\t4006f4 "], + [ + {u"cycles": 10.065491723992467}, + 4196060, + u"\t51000400 \tsub\tw0, w0, #0x1", + ], + [{}, 4196064, u"\t97fffffa \tbl\t4006c8 "], + [ + {u"cycles": 5.858831022967777}, + 4196068, + u"\t2a0003f4 \tmov\tw20, w0", + ], + [{}, 4196072, u"\t2a1303e0 \tmov\tw0, w19"], + [{}, 4196076, u"\t97fffff7 \tbl\t4006c8 "], + [ + {u"cycles": 7.57924022814841}, + 4196080, + u"\t0b140000 \tadd\tw0, w0, w20", + ], + [ + {u"cycles": 19.240308514111305}, + 4196084, + u"\ta9417bfd \tldp\tx29, x30, [sp,#16]", + ], + [ + {u"cycles": 13.964519840598708}, + 4196088, + u"\ta8c24ff4 \tldp\tx20, x19, [sp],#32", + ], + [{}, 4196092, u"\td65f03c0 \tret"], + ], + } + }, + }, + "fib2-aarch64": { + u"counters": { + u"branch-misses": 1820692, + u"cache-misses": 33054, + u"cycles": 243618286, + }, + u"functions": { + u"fib": { + u"counters": { + u"branch-misses": 99.7405382129432, + u"cache-misses": 75.18000847098688, + u"cycles": 99.78902404723429, + }, + u"data": [ + [ + { + u"branch-misses": 21.904846340904687, + u"cache-misses": 37.4486921529175, + u"cycles": 23.48637833693693, + }, + 4196040, + u"\ta9be4ff4 \tstp\tx20, x19, [sp,#-32]!", + ], + [ + { + u"branch-misses": 2.6443747907452115, + u"cache-misses": 17.08651911468813, + u"cycles": 20.34001001463117, + }, + 4196044, + u"\ta9017bfd \tstp\tx29, x30, [sp,#16]", + ], + [{}, 4196048, u"\t910043fd \tadd\tx29, sp, #0x10"], + [{}, 4196052, u"\t71000813 \tsubs\tw19, w0, #0x2"], + [{}, 4196056, u"\t540000eb \tb.lt\t4006f4 "], + [ + { + u"branch-misses": 30.264575146698622, + u"cache-misses": 20.69215291750503, + u"cycles": 9.787981545863996, + }, + 4196060, + u"\t51000400 \tsub\tw0, w0, #0x1", + ], + [{}, 4196064, u"\t97fffffa \tbl\t4006c8 "], + [ + { + u"branch-misses": 0.11195131191739062, + u"cache-misses": 2.3621730382293764, + u"cycles": 7.702120542412432, + }, + 4196068, + u"\t2a0003f4 \tmov\tw20, w0", + ], + [{}, 4196072, u"\t2a1303e0 \tmov\tw0, w19"], + [{}, 4196076, u"\t97fffff7 \tbl\t4006c8 "], + [ + { + u"branch-misses": 19.03265916580028, + u"cache-misses": 3.8229376257545273, + u"cycles": 7.362266427937867, + }, + 4196080, + u"\t0b140000 \tadd\tw0, w0, w20", + ], + [ + { + u"branch-misses": 4.9891297644011345, + u"cache-misses": 7.553319919517103, + u"cycles": 18.387547715628735, + }, + 4196084, + u"\ta9417bfd \tldp\tx29, x30, [sp,#16]", + ], + [ + { + u"branch-misses": 21.05246347953268, + u"cache-misses": 11.03420523138833, + u"cycles": 12.93369541658887, + }, + 4196088, + u"\ta8c24ff4 \tldp\tx20, x19, [sp],#32", + ], + [{}, 4196092, u"\td65f03c0 \tret"], + ], + } + }, + }, + } def _getNm(self, perf_data_fname, non_dynamic=False): stub = perf_data_fname.rsplit('.perf_data', 1)[0]