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

Side by Side Diff: ui/events/blink/input_handler_proxy.cc

Issue 2695603004: [VSync Queue] Add tracing for event queuing time and coalesced count (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « ui/events/blink/event_with_callback.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/blink/input_handler_proxy.h" 5 #include "ui/events/blink/input_handler_proxy.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 scroll_elasticity_controller_.reset(); 288 scroll_elasticity_controller_.reset();
289 input_handler_ = NULL; 289 input_handler_ = NULL;
290 client_->WillShutdown(); 290 client_->WillShutdown();
291 } 291 }
292 292
293 void InputHandlerProxy::HandleInputEventWithLatencyInfo( 293 void InputHandlerProxy::HandleInputEventWithLatencyInfo(
294 WebScopedInputEvent event, 294 WebScopedInputEvent event,
295 const LatencyInfo& latency_info, 295 const LatencyInfo& latency_info,
296 const EventDispositionCallback& callback) { 296 const EventDispositionCallback& callback) {
297 DCHECK(input_handler_); 297 DCHECK(input_handler_);
298 TRACE_EVENT0("input", "InputHandlerProxy::HandleInputEventWithLatencyInfo");
298 299
299 if (uma_latency_reporting_enabled_) 300 if (uma_latency_reporting_enabled_)
300 ReportInputEventLatencyUma(*event, latency_info); 301 ReportInputEventLatencyUma(*event, latency_info);
301 302
302 TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow", 303 TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow",
303 TRACE_ID_DONT_MANGLE(latency_info.trace_id()), 304 TRACE_ID_DONT_MANGLE(latency_info.trace_id()),
304 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, 305 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT,
305 "step", "HandleInputEventImpl"); 306 "step", "HandleInputEventImpl");
306 307
307 std::unique_ptr<EventWithCallback> event_with_callback = 308 std::unique_ptr<EventWithCallback> event_with_callback =
(...skipping 20 matching lines...) Expand all
328 329
329 // We have to dispatch the event to know whether the gesture sequence will be 330 // We have to dispatch the event to know whether the gesture sequence will be
330 // handled by the compositor or not. 331 // handled by the compositor or not.
331 DispatchSingleInputEvent(std::move(event_with_callback), 332 DispatchSingleInputEvent(std::move(event_with_callback),
332 tick_clock_->NowTicks()); 333 tick_clock_->NowTicks());
333 } 334 }
334 335
335 void InputHandlerProxy::DispatchSingleInputEvent( 336 void InputHandlerProxy::DispatchSingleInputEvent(
336 std::unique_ptr<EventWithCallback> event_with_callback, 337 std::unique_ptr<EventWithCallback> event_with_callback,
337 const base::TimeTicks now) { 338 const base::TimeTicks now) {
339 TRACE_EVENT0("input", "InputHandlerProxy::DispatchSingleInputEvent");
338 if (compositor_event_queue_ && 340 if (compositor_event_queue_ &&
339 IsGestureScollOrPinch(event_with_callback->event().type())) { 341 IsGestureScollOrPinch(event_with_callback->event().type())) {
340 // Report the coalesced count only for continuous events to avoid the noise 342 // Report the coalesced count only for continuous events to avoid the noise
341 // from non-continuous events. 343 // from non-continuous events.
342 if (IsContinuousGestureEvent(event_with_callback->event().type())) { 344 if (IsContinuousGestureEvent(event_with_callback->event().type())) {
345 TRACE_EVENT_INSTANT2(
346 "input", "InputHandlerProxy::CoalescedContinusGestureEvent",
tdresser 2017/02/14 16:31:54 Continuous
347 TRACE_EVENT_SCOPE_THREAD, "type", event_with_callback->event().type(),
348 "coalesced_count", event_with_callback->coalesced_count());
349
343 UMA_HISTOGRAM_CUSTOM_COUNTS( 350 UMA_HISTOGRAM_CUSTOM_COUNTS(
344 "Event.CompositorThreadEventQueue.Continuous.HeadQueueingTime", 351 "Event.CompositorThreadEventQueue.Continuous.HeadQueueingTime",
345 (now - event_with_callback->creation_timestamp()).InMicroseconds(), 1, 352 (now - event_with_callback->creation_timestamp()).InMicroseconds(), 1,
346 kTenSeconds, 50); 353 kTenSeconds, 50);
347 354
348 UMA_HISTOGRAM_CUSTOM_COUNTS( 355 UMA_HISTOGRAM_CUSTOM_COUNTS(
349 "Event.CompositorThreadEventQueue.Continuous.TailQueueingTime", 356 "Event.CompositorThreadEventQueue.Continuous.TailQueueingTime",
350 (now - event_with_callback->last_coalesced_timestamp()) 357 (now - event_with_callback->last_coalesced_timestamp())
351 .InMicroseconds(), 358 .InMicroseconds(),
352 1, kTenSeconds, 50); 359 1, kTenSeconds, 50);
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, 1621 scroll_elasticity_controller_->GetWeakPtr(), gesture_event,
1615 scroll_result)); 1622 scroll_result));
1616 } 1623 }
1617 1624
1618 void InputHandlerProxy::SetTickClockForTesting( 1625 void InputHandlerProxy::SetTickClockForTesting(
1619 std::unique_ptr<base::TickClock> tick_clock) { 1626 std::unique_ptr<base::TickClock> tick_clock) {
1620 tick_clock_ = std::move(tick_clock); 1627 tick_clock_ = std::move(tick_clock);
1621 } 1628 }
1622 1629
1623 } // namespace ui 1630 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/blink/event_with_callback.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698