diff options
author | qsr@chromium.org <qsr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-03 16:04:46 +0000 |
---|---|---|
committer | qsr@chromium.org <qsr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-03 16:04:46 +0000 |
commit | a6b5ca620426821b3ce3f83d1bb19a3d959480f3 (patch) | |
tree | dde2aa076e1e0d9cea7199a49eba8b915f3fca07 /tools | |
parent | 352cae102e858dc676794419d4b79964e784df63 (diff) | |
download | chromium_src-a6b5ca620426821b3ce3f83d1bb19a3d959480f3.zip chromium_src-a6b5ca620426821b3ce3f83d1bb19a3d959480f3.tar.gz chromium_src-a6b5ca620426821b3ce3f83d1bb19a3d959480f3.tar.bz2 |
Updating the OOM killer profiler to show which application has been killed.
R=bulach@chromium.org
BUG=244975
Review URL: https://codereview.chromium.org/25392004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226769 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r-- | tools/telemetry/telemetry/core/platform/profiler/oomkiller_profiler.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/tools/telemetry/telemetry/core/platform/profiler/oomkiller_profiler.py b/tools/telemetry/telemetry/core/platform/profiler/oomkiller_profiler.py index 621936f..825fc71 100644 --- a/tools/telemetry/telemetry/core/platform/profiler/oomkiller_profiler.py +++ b/tools/telemetry/telemetry/core/platform/profiler/oomkiller_profiler.py @@ -8,7 +8,13 @@ from telemetry.core.platform import profiler class UnableToFindApplicationException(Exception): """Exception when unable to find a launched application""" - pass + + def __init__(self, application): + super(UnableToFindApplicationException, self).__init__() + self.application = application + + def __str__(self): + return repr(self.application) class OOMKillerProfiler(profiler.Profiler): @@ -40,14 +46,15 @@ class OOMKillerProfiler(profiler.Profiler): return browser_type.startswith('android') def CollectProfile(self): - if not self._AreProcessRunnings(): - raise UnableToFindApplicationException() - return [] + missing_applications = self._MissingApplications() + if not len(missing_applications): + return [] + raise UnableToFindApplicationException(', '.join(missing_applications)) - def _AreProcessRunnings(self): + def _MissingApplications(self): must_have_apps = [ 'org.chromium.memconsumer', 'com.android.launcher', ] - return all([self._platform_backend.IsApplicationRunning(app) - for app in must_have_apps]) + return [app for app in must_have_apps if + not self._platform_backend.IsApplicationRunning(app)] |