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

Unified Diff: tools/profile_chrome/chrome_controller.py

Issue 690103005: [Cleanup] List trace categories through script as shown by trace record dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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: tools/profile_chrome/chrome_controller.py
diff --git a/tools/profile_chrome/chrome_controller.py b/tools/profile_chrome/chrome_controller.py
index 91c2504a54c4e34583644db055ad6cd543dd6fb7..18313cb883f5b102e63f276e2c21e8fa4a782566 100644
--- a/tools/profile_chrome/chrome_controller.py
+++ b/tools/profile_chrome/chrome_controller.py
@@ -51,10 +51,18 @@ class ChromeTracingController(controllers.BaseController):
disabled_by_default_categories = []
json_data = json.loads(json_category_list)['traceCategoriesList']
for item in json_data:
- if item.startswith('disabled-by-default'):
- disabled_by_default_categories.append(item)
- else:
- record_categories.append(item)
+ categories = item.split(',')
+ try:
+ if item.startswith('disabled-by-default'):
dsinclair 2014/11/07 00:05:25 Don't we want to do this check against each item i
r.kasibhatla 2014/11/07 09:58:47 Correct. I was trying to club too many conditions
+ disabled_by_default_categories.append(
+ next(category for category in categories
+ if category not in disabled_by_default_categories))
+ else:
+ record_categories.append(
+ next(category for category in categories
+ if category not in record_categories))
+ except StopIteration, e:
+ pass
return record_categories, disabled_by_default_categories
« 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