def main(): target = Target() test_results = Results(target) test_results.log( target.execute('cat /sys/kernel/debug/sched_features | grep _WA_ ', as_root=True)) tests_to_run = [] # tests_to_run = ['SysBenchCpu', 'SysBenchMemory'] # tests_to_run = ['PerfBenchFutexWake'] time = 60 events = [ 'sched:sched_migrate_task', 'sched:sched_stick_numa', 'sched:sched_move_numa', 'sched:sched_swap_numa' ] events.extend(['migrate:mm_migrate_pages']) for test in test_registry.test_registry: if not tests_to_run or test(target).__class__.__name__ in tests_to_run: t = test(target, time=time) t.run_event(target, events, test_results) res_files = [] res_files.append(test_results.store('Res1')) res_files.append(test_results.store('Res2')) create_report(res_files, 'Report', 'Test Run')
def run_tests(test_name, target, tests_to_run, iter=0): test_results = Results(target) time = 60 event = [] for test in test_registry.test_registry: if not tests_to_run or test(target).__class__.__name__ in tests_to_run: t = test(target, time=time) t.run(target, test_results) return test_results.store(test_name, iteration=iter)
def run_single_test(result_name, test_name, target, res_files, iter=1): test_results = Results(target) test_time = 60 event = [] for test in test_registry.test_registry: if test(target).__class__.__name__ == test_name: for i in range(0, iter): t = test(target, time=test_time) time.sleep(1) t.run(target, test_results) f = test_results.store(result_name + '-' + test_name, iteration=0) res_files.append(f)
def run_tests(test_name, target, tests_to_run): test_results = Results(target) sched_features = target.execute( 'cat /sys/kernel/debug/sched_features | grep WA_ ', as_root=True) for f in sched_features.split(" "): if "WA_" in f: test_results.log(f) for test in test_registry.test_registry: if not tests_to_run or test(target).__class__.__name__ in tests_to_run: test(target).run_event(target, 'sched:sched_migrate_task', test_results) return test_results.store(test_name)