aboutsummaryrefslogtreecommitdiff
path: root/heat_map.py
diff options
context:
space:
mode:
authorCaroline Tice <cmtice@google.com>2016-01-13 09:48:29 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-01-22 19:30:55 +0000
commit88272d479f2761cc1906fea564c73033f77a6270 (patch)
tree4da9c114d64522f59494a908cf9a85b09c994d32 /heat_map.py
parent439f2b77c86987362f53bd4f6e39896aa6d77f66 (diff)
downloadtoolchain-utils-88272d479f2761cc1906fea564c73033f77a6270.tar.gz
Fix cros lint errors.
Also move deprecated scripts to the 'deprecated' directory. BUG=chromiumos:570464 TEST=tested scripts to make sure they still work. Change-Id: I3442a86d898104591233a0849ea0bafb52ecf1f7 Reviewed-on: https://chrome-internal-review.googlesource.com/244221 Commit-Ready: Caroline Tice <cmtice@google.com> Tested-by: Caroline Tice <cmtice@google.com> Reviewed-by: Yunlian Jiang <yunlian@google.com>
Diffstat (limited to 'heat_map.py')
-rwxr-xr-xheat_map.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/heat_map.py b/heat_map.py
index 7d4be65f..ae234b51 100755
--- a/heat_map.py
+++ b/heat_map.py
@@ -1,9 +1,11 @@
-#!/usr/bin/python
+#!/usr/bin/python2
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Wrapper to generate heat maps for chrome."""
+from __future__ import print_function
+
import argparse
import shutil
import os
@@ -11,9 +13,7 @@ import sys
import tempfile
from sets import Set
-from utils import command_executer
-from utils import misc
-
+from cros_utils import command_executer
def IsARepoRoot(directory):
"""Returns True if directory is the root of a repo checkout."""
@@ -31,6 +31,10 @@ class HeatMapProducer(object):
self.binary = binary
self.tempDir = ''
self.ce = command_executer.GetCommandExecuter()
+ self.loading_address = None
+ self.temp_perf = ''
+ self.temp_perf_inchroot = ''
+ self.perf_report = ''
def copyFileToChroot(self):
self.tempDir = tempfile.mkdtemp(
@@ -41,7 +45,8 @@ class HeatMapProducer(object):
os.path.basename(self.tempDir))
def getPerfReport(self):
- cmd = 'cd %s; perf report -D -i perf.data > perf_report.txt' % self.temp_perf_inchroot
+ cmd = ('cd %s; perf report -D -i perf.data > perf_report.txt' %
+ self.temp_perf_inchroot)
retval = self.ce.ChrootRunCommand(self.chromeos_root, cmd)
if retval:
raise RuntimeError('Failed to generate perf report')
@@ -89,7 +94,7 @@ def main(argv):
"""Parse the options.
Args:
- argv: The options with which this script was invoked.
+ argv: The options with which this script was invoked.
Returns:
0 unless an exception is raised.
@@ -132,7 +137,7 @@ def main(argv):
print('\nheat map and time histgram genereated in the current directory '
'with name heat_map.png and timeline.png accordingly.')
except RuntimeError, e:
- print e
+ print(e)
finally:
heatmap_producer.RemoveFiles()