Skip to content

Commit

Permalink
Bug 1628073 - Remove the view_gecko_profile.py tool; r=sparky,perftes…
Browse files Browse the repository at this point in the history
…t-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D74294
  • Loading branch information
gregtatum committed May 22, 2020
1 parent af96a9b commit 4d20207
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 251 deletions.
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ exclude =
testing/parse_build_tests_ccov.py,
testing/runtimes/writeruntimes.py,
testing/tools/iceserver/iceserver.py,
testing/tools/view_gecko_profile/view_gecko_profile.py,
testing/tools/websocketprocessbridge/websocketprocessbridge.py,
testing/web-platform,
toolkit/components/featuregates,
Expand Down
19 changes: 0 additions & 19 deletions testing/mozharness/mozharness/mozilla/testing/raptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,10 +704,6 @@ def create_virtualenv(self, **kwargs):
os.path.basename(_python_interp),
'site-packages')

# If running gecko profiling, install its requirements
if self.gecko_profile:
self._install_view_gecko_profile_req()

sys.path.append(_path)
return

Expand Down Expand Up @@ -740,10 +736,6 @@ def create_virtualenv(self, **kwargs):
'requirements.txt')]
)

# If we're running gecko profiling, install its requirements
if self.gecko_profile:
self._install_view_gecko_profile_req()

def install(self):
if not self.config.get('noinstall', False):
if self.app in self.firefox_android_browsers:
Expand All @@ -752,17 +744,6 @@ def install(self):
else:
super(Raptor, self).install()

def _install_view_gecko_profile_req(self):
# If running locally and gecko profiing is on, we will be using the
# view-gecko-profile tool which has its own requirements too
if self.gecko_profile and self.run_local:
tools = os.path.join(self.config['repo_path'], 'testing', 'tools')
view_gecko_profile_req = os.path.join(tools,
'view_gecko_profile',
'requirements.txt')
self.info("Installing requirements for the view-gecko-profile tool")
self.install_module(requirements=[view_gecko_profile_req])

def _artifact_perf_data(self, src, dest):
if not os.path.isdir(os.path.dirname(dest)):
# create upload dir if it doesn't already exist
Expand Down
16 changes: 0 additions & 16 deletions testing/mozharness/mozharness/mozilla/testing/talos.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,10 +570,6 @@ def create_virtualenv(self, **kwargs):
os.path.basename(_python_interp),
'site-packages')

# if running gecko profiling install the requirements
if self.gecko_profile:
self._install_view_gecko_profile_req()

sys.path.append(_path)
return

Expand Down Expand Up @@ -603,18 +599,6 @@ def create_virtualenv(self, **kwargs):
requirements=[os.path.join(self.talos_path,
'requirements.txt')]
)
self._install_view_gecko_profile_req()

def _install_view_gecko_profile_req(self):
# if running locally and gecko profiing is on, we will be using the
# view-gecko-profile tool which has its own requirements too
if self.gecko_profile and self.run_local:
tools = os.path.join(self.config['repo_path'], 'testing', 'tools')
view_gecko_profile_req = os.path.join(tools,
'view_gecko_profile',
'requirements.txt')
self.info("installing requirements for the view-gecko-profile tool")
self.install_module(requirements=[view_gecko_profile_req])

def _validate_treeherder_data(self, parser):
# late import is required, because install is done in create_virtualenv
Expand Down
45 changes: 5 additions & 40 deletions testing/raptor/raptor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@
from __future__ import absolute_import

import os
import subprocess
import sys
import time
import yaml

from distutils.util import strtobool

from logger.logger import RaptorLogger
from mozgeckoprofiler import view_gecko_profile

LOG = RaptorLogger(component='raptor-utils')
here = os.path.dirname(os.path.realpath(__file__))
Expand Down Expand Up @@ -64,46 +61,14 @@ def view_gecko_profile_from_raptor():
# automatically load the latest raptor gecko-profile archive in profiler.firefox.com
LOG_GECKO = RaptorLogger(component='raptor-view-gecko-profile')

profile_zip = os.environ.get('RAPTOR_LATEST_GECKO_PROFILE_ARCHIVE', None)
if profile_zip is None or not os.path.exists(profile_zip):
profile_zip_path = os.environ.get('RAPTOR_LATEST_GECKO_PROFILE_ARCHIVE', None)
if profile_zip_path is None or not os.path.exists(profile_zip_path):
LOG_GECKO.info("No local raptor gecko profiles were found so not "
"launching profiler.firefox.com")
return

# need the view-gecko-profile tool, it's in repo/testing/tools
repo_dir = os.environ.get('MOZ_DEVELOPER_REPO_DIR', None)
if repo_dir is None:
LOG_GECKO.info("unable to find MOZ_DEVELOPER_REPO_DIR, can't launch view-gecko-profile")
return

view_gp = os.path.join(repo_dir, 'testing', 'tools',
'view_gecko_profile', 'view_gecko_profile.py')
if not os.path.exists(view_gp):
LOG_GECKO.info("unable to find the view-gecko-profile tool, cannot launch it")
return

command = [sys.executable,
view_gp,
'-p', profile_zip]

LOG_GECKO.info('Auto-loading this profile in perfhtml.io: %s' % profile_zip)
LOG_GECKO.info(command)

# if the view-gecko-profile tool fails to launch for some reason, we don't
# want to crash talos! just dump error and finish up talos as usual
try:
view_profile = subprocess.Popen(command)
# that will leave it running in own instance and let talos finish up
except Exception as e:
LOG_GECKO.info("failed to launch view-gecko-profile tool, exeption: %s" % e)
return

time.sleep(5)
ret = view_profile.poll()
if ret is None:
LOG_GECKO.info("view-gecko-profile successfully started as pid %d" % view_profile.pid)
else:
LOG_GECKO.error('view-gecko-profile process failed to start, poll returned: %s' % ret)
LOG_GECKO.info("Profile saved locally to: %s" % profile_zip_path)
view_gecko_profile(profile_zip_path)


def write_yml_file(yml_file, yml_data):
Expand Down
42 changes: 5 additions & 37 deletions testing/talos/talos/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import copy
import os
import subprocess
import sys
import time
import traceback
Expand All @@ -24,6 +23,7 @@
from talos.results import TalosResults
from talos.ttest import TTest
from talos.utils import TalosError, TalosRegression
from mozgeckoprofiler import view_gecko_profile

# directory of this file
here = os.path.dirname(os.path.realpath(__file__))
Expand Down Expand Up @@ -348,45 +348,13 @@ def run_tests(config, browser_config):


def view_gecko_profile_from_talos():
profile_zip = os.environ.get('TALOS_LATEST_GECKO_PROFILE_ARCHIVE', None)
if profile_zip is None or not os.path.exists(profile_zip):
profile_zip_path = os.environ.get('TALOS_LATEST_GECKO_PROFILE_ARCHIVE', None)
if profile_zip_path is None or not os.path.exists(profile_zip_path):
LOG.info("No local talos gecko profiles were found so not launching profiler.firefox.com")
return

# need the view-gecko-profile tool, it's in repo/testing/tools
repo_dir = os.environ.get('MOZ_DEVELOPER_REPO_DIR', None)
if repo_dir is None:
LOG.info("unable to find MOZ_DEVELOPER_REPO_DIR, can't launch view-gecko-profile")
return

view_gp = os.path.join(repo_dir, 'testing', 'tools',
'view_gecko_profile', 'view_gecko_profile.py')
if not os.path.exists(view_gp):
LOG.info("unable to find the view-gecko-profile tool, cannot launch it")
return

command = ['python',
view_gp,
'-p', profile_zip]

LOG.info('Auto-loading this profile in profiler.firefox.com: %s' % profile_zip)
LOG.info(' '.join(command))

# if the view-gecko-profile tool fails to launch for some reason, we don't
# want to crash talos! just dump error and finsh up talos as usual
try:
view_profile = subprocess.Popen(command)
# that will leave it running in own instance and let talos finish up
except Exception as e:
LOG.info("failed to launch view-gecko-profile tool, exeption: %s" % e)
return

time.sleep(5)
ret = view_profile.poll()
if ret is None:
LOG.info("view-gecko-profile successfully started as pid %d" % view_profile.pid)
else:
LOG.error('view-gecko-profile process failed to start, poll returned: %s' % ret)
LOG.info("Profile saved locally to: %s" % profile_zip_path)
view_gecko_profile(profile_zip_path)


def make_comparison_result(base_and_reference_results):
Expand Down
17 changes: 0 additions & 17 deletions testing/tools/view_gecko_profile/README.txt

This file was deleted.

1 change: 0 additions & 1 deletion testing/tools/view_gecko_profile/requirements.txt

This file was deleted.

120 changes: 0 additions & 120 deletions testing/tools/view_gecko_profile/view_gecko_profile.py

This file was deleted.

0 comments on commit 4d20207

Please sign in to comment.