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

Unified Diff: tools/perf/benchmarks/blink_perf.py

Issue 2864643002: Support tracing metrics for measureValueAsync method (Closed)
Patch Set: Address Wang Xianzhu's comment Created 3 years, 7 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
Index: tools/perf/benchmarks/blink_perf.py
diff --git a/tools/perf/benchmarks/blink_perf.py b/tools/perf/benchmarks/blink_perf.py
index 1808b8896ff8ff9896663cf889dad33f000058b0..65eb381561ba508f9281f26ac007cc76cba2911d 100644
--- a/tools/perf/benchmarks/blink_perf.py
+++ b/tools/perf/benchmarks/blink_perf.py
@@ -79,7 +79,7 @@ def CreateStorySetFromPath(path, skipped_file,
def _ComputeTraceEventsThreadTimeForBlinkPerf(
- renderer_thread, trace_events_to_measure):
+ model, renderer_thread, trace_events_to_measure):
""" Compute the CPU duration for each of |trace_events_to_measure| during
blink_perf test.
@@ -107,7 +107,17 @@ def _ComputeTraceEventsThreadTimeForBlinkPerf(
for event_name in trace_events_to_measure:
curr_test_runs_bound_index = 0
- for event in renderer_thread.IterAllSlicesOfName(event_name):
+ seen_uuids = set()
+ for event in model.IterAllEventsOfName(event_name):
+ # Trace events can be duplicated in some cases. Filter out trace events
+ # that have duplicated uuid.
+ event_uuid = None
+ if event.args:
+ event_uuid = event.args.get('uuid')
+ if event_uuid and event_uuid in seen_uuids:
+ continue
+ elif event_uuid:
+ seen_uuids.add(event_uuid)
while (curr_test_runs_bound_index < len(test_runs_bounds) and
event.start > test_runs_bounds[curr_test_runs_bound_index].max):
curr_test_runs_bound_index += 1
@@ -123,11 +133,9 @@ def _ComputeTraceEventsThreadTimeForBlinkPerf(
intersect_cpu_time = intersect_wall_time
trace_cpu_time_metrics[event_name][curr_test_runs_bound_index] += (
intersect_cpu_time)
-
return trace_cpu_time_metrics
-
class _BlinkPerfMeasurement(legacy_page_test.LegacyPageTest):
"""Tuns a blink performance test and reports the results."""
@@ -207,7 +215,7 @@ class _BlinkPerfMeasurement(legacy_page_test.LegacyPageTest):
model = model_module.TimelineModel(trace_data)
renderer_thread = model.GetRendererThreadFromTabId(tab.id)
trace_cpu_time_metrics = _ComputeTraceEventsThreadTimeForBlinkPerf(
- renderer_thread, trace_events_to_measure)
+ model, renderer_thread, trace_events_to_measure)
log = tab.EvaluateJavaScript('document.getElementById("log").innerHTML')
@@ -401,4 +409,3 @@ class BlinkPerfShadowDOM(_BlinkPerfBenchmark):
@classmethod
def ShouldDisable(cls, possible_browser): # http://crbug.com/702319
return possible_browser.platform.GetDeviceTypeName() == 'Nexus 5X'
-
« no previous file with comments | « third_party/WebKit/PerformanceTests/resources/runner.js ('k') | tools/perf/benchmarks/blink_perf_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698