diff options
| -rwxr-xr-x | scripts/oe-build-perf-test | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/oe-build-perf-test b/scripts/oe-build-perf-test index 0a9fc9e7d4..ca90f69e1e 100755 --- a/scripts/oe-build-perf-test +++ b/scripts/oe-build-perf-test | |||
| @@ -52,6 +52,17 @@ def pre_run_sanity_check(): | |||
| 52 | return True | 52 | return True |
| 53 | 53 | ||
| 54 | 54 | ||
| 55 | def setup_file_logging(log_file): | ||
| 56 | """Setup loggin to file""" | ||
| 57 | log_dir = os.path.dirname(log_file) | ||
| 58 | if not os.path.exists(log_dir): | ||
| 59 | os.makedirs(log_dir) | ||
| 60 | formatter = logging.Formatter(LOG_FORMAT) | ||
| 61 | handler = logging.FileHandler(log_file) | ||
| 62 | handler.setFormatter(formatter) | ||
| 63 | log.addHandler(handler) | ||
| 64 | |||
| 65 | |||
| 55 | def parse_args(argv): | 66 | def parse_args(argv): |
| 56 | """Parse command line arguments""" | 67 | """Parse command line arguments""" |
| 57 | parser = argparse.ArgumentParser( | 68 | parser = argparse.ArgumentParser( |
| @@ -76,8 +87,11 @@ def main(argv=None): | |||
| 76 | # Check our capability to drop caches and ask pass if needed | 87 | # Check our capability to drop caches and ask pass if needed |
| 77 | KernelDropCaches.check() | 88 | KernelDropCaches.check() |
| 78 | 89 | ||
| 79 | # Run actual tests | 90 | # Set-up log file |
| 80 | out_dir = 'results-{}'.format(datetime.now().strftime('%Y%m%d%H%M%S')) | 91 | out_dir = 'results-{}'.format(datetime.now().strftime('%Y%m%d%H%M%S')) |
| 92 | setup_file_logging(os.path.join(out_dir, 'output.log')) | ||
| 93 | |||
| 94 | # Run actual tests | ||
| 81 | runner = BuildPerfTestRunner(out_dir) | 95 | runner = BuildPerfTestRunner(out_dir) |
| 82 | ret = runner.run_tests() | 96 | ret = runner.run_tests() |
| 83 | 97 | ||
