Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: client/profilers/perf/perf.py

Issue 6816032: perf: allow events to be specified as an iterable (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: Extra line snuck in from me staging changes in chunks Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/profilers/perf/perf.py
diff --git a/client/profilers/perf/perf.py b/client/profilers/perf/perf.py
index 211d562bdaea058341afad4fcbda3b65ec0e3664..e6f9bb71afd441cf1b42e416087e476b0d1b629f 100644
--- a/client/profilers/perf/perf.py
+++ b/client/profilers/perf/perf.py
@@ -13,8 +13,11 @@ from autotest_lib.client.bin import profiler, os_dep, utils
class perf(profiler.profiler):
version = 1
- def initialize(self, events="cycles,instructions"):
- self.events = events
+ def initialize(self, events=["cycles","instructions"]):
+ if type(events) == str:
+ self.events = [events]
lmr 2011/04/08 00:36:46 If we are going to support the old way of passing
+ else:
+ self.events = events
self.perf_bin = os_dep.command('perf')
perf_help = utils.run('%s report help' % self.perf_bin,
ignore_status=True).stderr
@@ -31,8 +34,10 @@ class perf(profiler.profiler):
def start(self, test):
self.logfile = os.path.join(test.profdir, "perf")
- cmd = ("%s record -a -o %s -e %s" %
- (self.perf_bin, self.logfile, self.events))
+ cmd = ("%s record -a -o %s" %
+ (self.perf_bin, self.logfile))
+ for event in self.events:
+ cmd += " -e %s" % event
self._process = subprocess.Popen(cmd, shell=True,
stderr=subprocess.STDOUT)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698