summaryrefslogtreecommitdiffstats
path: root/scripts/oe-build-perf-test
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-05-11 13:16:37 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-01 15:22:47 (GMT)
commit8329d56cd43ef0a51c8040b62d3a40eb59bb39f7 (patch)
tree8856c5cfecccf03629cc8704972160d53434e70b /scripts/oe-build-perf-test
parent5599645d3303d2c1b4090b4e6ae3d41cb7206ede (diff)
downloadpoky-8329d56cd43ef0a51c8040b62d3a40eb59bb39f7.tar.gz
oe-build-perf-test: enable logging into file
(From OE-Core rev: d5bbcdaf332b2a15382672d6a40b2d2b807b9dde) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/oe-build-perf-test')
-rwxr-xr-xscripts/oe-build-perf-test16
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/oe-build-perf-test b/scripts/oe-build-perf-test
index 0a9fc9e..ca90f69 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
55def 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
55def parse_args(argv): 66def 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