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

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: Return list instead of 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..9f522631b1e6e6591c49d595a8985f5657e78180 100644
--- a/tools/profile_chrome/chrome_controller.py
+++ b/tools/profile_chrome/chrome_controller.py
@@ -47,16 +47,17 @@ class ChromeTracingController(controllers.BaseController):
raise RuntimeError('Performance trace category list marker not found. '
'Is the correct version of the browser running?')
- record_categories = []
- disabled_by_default_categories = []
+ record_categories = set()
+ disabled_by_default_categories = set()
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)
+ for category in item.split(','):
+ if category.startswith('disabled-by-default'):
+ disabled_by_default_categories.add(category)
+ else:
+ record_categories.add(category)
- return record_categories, disabled_by_default_categories
+ return list(record_categories), list(disabled_by_default_categories)
def StartTracing(self, interval):
self._trace_interval = interval
« 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