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

Unified Diff: tools/deep_memory_profiler/graph.py

Issue 567173002: graph.py in dmprof needs to support policies without l2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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: tools/deep_memory_profiler/graph.py
diff --git a/tools/deep_memory_profiler/graph.py b/tools/deep_memory_profiler/graph.py
index 66b329e99e1bb483b2becfdca5f391dccf4fc240..cffb7807c99df9f434189b03989a1780ca3513fb 100755
--- a/tools/deep_memory_profiler/graph.py
+++ b/tools/deep_memory_profiler/graph.py
@@ -17,7 +17,7 @@ google.load('visualization', '1', {packages:['corechart', 'table']});
google.setOnLoadCallback(drawVisualization);
function drawVisualization() {
// Apply policy 'l2' by default.
- var default_policy = 'l2';
+ var default_policy = '$DEF_POLICY';
document.getElementById(default_policy).style.fontWeight = 'bold';
turnOn(default_policy);
}
@@ -66,6 +66,11 @@ Click to change an applied policy.
def _GenerateGraph(json_data):
policies = list(json_data['policies'])
+
+ default_policy = "l2"
+ if default_policy not in policies:
+ default_policy = policies[0]
+
policies = "".join(map(lambda x: '<li id="'+x+'">'+x+'</li>', policies))
all_data = {}
@@ -83,6 +88,7 @@ def _GenerateGraph(json_data):
print Template(_HTML_TEMPLATE).safe_substitute(
{'POLICIES': policies,
+ 'DEF_POLICY': default_policy,
'ALL_DATA': json.dumps(all_data)})
« 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