blob: 178e1af230de2661302d36b2450ca6185958a751 [file] [log] [blame]
#!/usr/bin/env python
# Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
from chrome_telemetry_build import chromium_config
from core import path_util
path_util.AddTelemetryToPath()
from telemetry import record_wpr
# This is required to resolve importing davclient in tools/perf/third_party/
# when record_wpr try to dynamically discover benchmark classes.
import third_party # pylint: disable=unused-import
_WARNING_PATTERN = '\033[93m%s\033[0m' # Use yellow color for warning.
def _WarnPythonVersion():
print (_WARNING_PATTERN %
("Your system python's version is less than 2.7.9. "
'For best recording results, please run record_wpr with Python '
'version 2.7.9 or after (See '
'https://github.com/chromium/web-page-replay/issues/73 '
'for more information).\n'
'For instructions on how to upgrade Python on Ubuntu 14.04, see:\n'
'http://mbless.de/blog/2016/01/09/upgrade-to-python-2711-on-ubuntu-1404-lts.html'))
if __name__ == '__main__':
if sys.version_info < (2, 7, 9):
_WarnPythonVersion()
config = chromium_config.ChromiumConfig(
benchmark_dirs=[path_util.GetPerfBenchmarksDir()],
top_level_dir=path_util.GetPerfDir())
sys.exit(record_wpr.Main(environment=config))